Giter Club home page Giter Club logo

ninanor / garmincustommaps Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 6.0 138 KB

The GarminCustomMap plugin exports the current map canvas to a .kmz-file, which is compatible with Garmin`s Custom Maps format for handheld GPS units. That way individual maps styled in QGIS can be used as background (raster) maps on the compatible Garmin GPS units, like Alpha, Astro, Dakota, Oregon, Colorado, GPSMAP 62 series, GPSMAP 64 series, GPSMAP 78 series, Edge 800, Montana, Rino, eTrex® 20 and 30.

License: GNU General Public License v2.0

Python 76.74% Makefile 15.05% Batchfile 5.16% Shell 3.06%

garmincustommaps's People

Contributors

chrismuller avatar esan0 avatar ghtmtt avatar ninsbl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

garmincustommaps's Issues

Support for QGIS 3.2

Hi - I don't seem to be able to get this plugin to work with the new 3.2 version of QGIS - has anyone done any work to get this functionality into the 3.2 version? or can offer any suggestions?

Low Resolution Output on Garmin GPSMAP64s

I'm trying to export a map using the GarminCustomMaps plugin for use on a Garmin GPSMAP64s. The area of interest (AOI) is a Canadian forest management unit over 1MM hectares (10,000sq-km) in size.

I've read the tips in the export dialogue, used the highest recommended scale factor (along with countless other iterations with other variables), but no matter what I try, the resolution on the GPS unit is very low to the point that it can't be used. Sometimes the GPS doesn't display anything.

My organization has traditionally used a program called Mapwell which outputs IMG files which scale nicely on our GPS units, but the software is clunky and often doesn't hold our symbology choices when it gets to the GPS.

Has anyone encountered this? I was thinking it might be the size of the AOI, but I tried a much smaller AOI and the quality wasn't much better.

Thank you!
Jon

GarminCustomMap makes minidump and crashes QGIS on terminating QGIS

I work on win7 64 bit and use QGIS 2.18.10 and 2.18.11 both 64 bit.

After installing plugin GarminCustomMap v. 1.2 it makes QGIS crash and makes a minidump when teminating the program.
After uninstalling the plugin the program crashes again one time but after restart there is no problems.

Error in line 554: expected array of dim 2

\GarminCustomMap.py", line 554, in run
t_file.GetRasterBand(1).WriteArray(t_band_1)
File "C:\PROGRA1\QGIS31.4\apps\Python37\lib\site-packages\osgeo\gdal.py", line 2653, in WriteArray
callback_data=callback_data)
File "C:\PROGRA1\QGIS31.4\apps\Python37\lib\site-packages\osgeo\gdal_array.py", line 394, in BandWriteArray
raise ValueError("expected array of dim 2")
ValueError: expected array of dim 2

To avoid issue #9, I turned off "Skip production of empty tiles". Now instead of throwing an error at line 551, it throws an error at 554.

Add JNX Support.

An interesting hint from Mike on JNX format:

"The KMZ Format is very slow. So if you want to show maps its cool to use JNX format.

Todo this A. Whiter added a Firmware Patch and also has some Format Information about JNX.

Actually I can download WMS Tiles using Mobile Atlas Creator and use tools to convert it to JNX.

Last but not least you could create IMG files, but the easiest way would to create JNX Files.
Also note: If you load the JNX Files to your Garmin, you can see it in the Basecamp Software, too!
Very cool."

A high resolution map canvas export (to GeoTIFF) could be easily converted to JNX using mklandkarte

QgsMapSettings.setFlags(): argument 1 has unexpected type 'int'

Unable to use the plugin. Error argument 1 has unexpected type 'int'

I have tried even with a simple map of a vector gpkg of points and with/without esri basemap.

Thrown as WARNING.

2022-04-08T14:59:02 WARNING Traceback (most recent call last):
File "/Users/nthewoods/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/GarminCustomMap/GarminCustomMap.py", line 347, in run
mapSettings.setFlags(QgsMapSettings.Antialiasing | QgsMapSettings.UseAdvancedEffects | QgsMapSettings.ForceVectorOutput | QgsMapSettings.DrawLabeling)
TypeError: QgsMapSettings.setFlags(): argument 1 has unexpected type 'int'

QGIS version 3.24.1-Tisler QGIS code revision 9d1e5b189a
Qt version 5.15.2
Python version 3.9.5
GDAL/OGR version 3.3.2
PROJ version 8.1.1
EPSG Registry database version v10.028 (2021-07-07)
GEOS version 3.9.1-CAPI-1.14.2
SQLite version 3.35.2
PDAL version 2.3.0
PostgreSQL client version unknown
SpatiaLite version 5.0.1
QWT version 6.1.6
QScintilla2 version 2.11.5
OS version macOS Mojave (10.14)
       
Active Python plugins
numericalDigitize 0.4.6
QuickOSM 2.0.1
profiletool 4.2.2
lines_ranking 1.0
quick_map_services 0.19.29
Hy2roresO-master 0.0.1
LAStools 1.4
SRTM-Downloader 3.1.17
GarminCustomMap 3.3
latlontools 3.6.3
qfieldsync v4.0.0
qgis_resource_sharing 0.16.0
pointsamplingtool 0.5.3
GroupStats 2.2.5
qtiles 1.7.1
processing 2.12.99
sagaprovider 2.12.99
grassprovider 2.12.99
db_manager 0.1.20
MetaSearch 0.3.6
QGIS version 3.24.1-Tisler QGIS code revision [9d1e5b189a](https://github.com/qgis/QGIS/commit/9d1e5b189a) Qt version 5.15.2 Python version 3.9.5 GDAL/OGR version 3.3.2 PROJ version 8.1.1 EPSG Registry database version v10.028 (2021-07-07) GEOS version 3.9.1-CAPI-1.14.2 SQLite version 3.35.2 PDAL version 2.3.0 PostgreSQL client version unknown SpatiaLite version 5.0.1 QWT version 6.1.6 QScintilla2 version 2.11.5 OS version macOS Mojave (10.14)

Active Python plugins
numericalDigitize
0.4.6
QuickOSM
2.0.1
profiletool
4.2.2
lines_ranking
1.0
quick_map_services
0.19.29
Hy2roresO-master
0.0.1
LAStools
1.4
SRTM-Downloader
3.1.17
GarminCustomMap
3.3
latlontools
3.6.3
qfieldsync
v4.0.0
qgis_resource_sharing
0.16.0
pointsamplingtool
0.5.3
GroupStats
2.2.5
qtiles
1.7.1
processing
2.12.99
sagaprovider
2.12.99
grassprovider
2.12.99
db_manager
0.1.20
MetaSearch
0.3.6

Beginner Help

Is there a manual I didn't find? I think I'm making some basic mistakes. I'm trying to make a topo and boating map of the entire Yukon Territory. I've downloaded about 7 vector files from http://mapservices.gov.yk.ca/GeoYukon/ . Each layer is 200MB to 1.5GB. After downloading the shape file, I unzip it and import it using Layer>Add Layer>Add Vector Layer. I did this for all of the files and then cropped them to the political boundary of the Yukon Territory. At this point, I'm showing the cropped layers (the original layers are still in the layer windows, but not displayed). Everything I want is visible and I'm zoomed out to the full extents of the map. The file must be huge since every click takes a long time to process. I go to Plugins>GarminCustomMap>Create Garmin Custom Map from map canvas. What specifically is a map canvas? I left all of the inputs as the default except the zoom, which I chose to be 12 as that was the maximum zoom for <=100 tiles. The export says it finished successfully with 16 tiles and 48 rows. I ended up with a kmz file that is 881kB. For comparison if I were to buy the Backroads Map Book GPS file it is 1.6GB.
I just installed QGIS 3.6.3 and GarminCustomMaps yesterday.

Any help would be appreciated! Thank you.

QGIS 3.10 error

when using this plugin with the newly released version 3.10 of qgis export maps does not work because line 493 in GarminCustomMap.py (iface.messageBar().pushMessage("WARNING", "The number of tiles is likely to exceed Garmins limit of 100 tiles! Not all tiles will be displayed on your GPS unit. Consider reducing your map size (extend or zoom-factor).", duration=5)) produces an error.

If this line and line 492 is commented out it generates maps without problem.

Not sure if this check is needed, possibly a checkbox to select which kind of Garmin is used (100 or 500 tiles) and an appropriate messages would be better.

Zoom factor impacts raster layers

Hey, I've found the reason why my raster layer background is not shown in the kmz file. Whenever i use a zoom factor (for example 10), the raster layer appears in the top left corner as a small tile. The rest of the tiles just has a white background, with the vector layer in front.

image

But if i use a zoom factor of 1, the raster is shown perfectly fine with all vector layer on top. This is okay for my current work, but now the resolution is not the best. I´ll play around a bit more, but maybe someone has the same problem. Just use the zoom factor 1 and then maybe load more kmz files on your garmin device...

image

maximum zoom factor too low?

while trying to export a map for my GPSmap64s i wanted to follow the recommendation of the plugin and use a zoom-level of 39 only to find out that there is a hard limit of 25 configured in GarminCustomMap_dialog_base.ui.

Setting this to a higher maximum i was able to sucessfully generate and use a map on the gps.

Is there any reason why this limit was set to 25?

fails with 3.23.0-Master

2021-11-19T15:11:07 WARNING Python error : An error has occurred while executing Python code: See message log (Python Error) for more details.

2021-11-19T15:11:07 WARNING Traceback (most recent call last):
File "/Users/garth/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/GarminCustomMap/GarminCustomMap.py", line 347, in run
mapSettings.setFlags(QgsMapSettings.Antialiasing | QgsMapSettings.UseAdvancedEffects | QgsMapSettings.ForceVectorOutput | QgsMapSettings.DrawLabeling)
TypeError: QgsMapSettings.setFlags(): argument 1 has unexpected type 'int'

NOTE: Works normally with QGIS 3.20.3

GarminCustomMaps Version 3.3 updated at Fri May 1 17:48:34 2020
QGIS version | 3.23.0-Master | QGIS code revision | ac6bbd662d
Qt version | 5.15.2
Python version | 3.9.5
GDAL/OGR version | 3.3.2
PROJ version | 8.1.1
EPSG Registry database version | v10.028 (2021-07-07)
GEOS version | 3.9.1-CAPI-1.14.2
SQLite version | 3.35.2
PDAL version | 2.3.0
PostgreSQL client version | unknown
SpatiaLite version | 5.0.1
QWT version | 6.1.6
QScintilla2 version | 2.11.5
OS version | macOS High Sierra (10.13)
  |   |   |  
Active Python plugins
FreehandRasterGeoreferencer | 0.8.3
VectorBender | 0.2.1
AzimuthMeasurement | 0.2.2
rectanglify | 1.0.3
MagneticDeclination | 2.3.1
GarminCustomMap | 3.3
ViewshedAnalysis | 1.7
TerrainShading | 0.9
MemoryLayerSaver | 4.0.4
parcel_plugin | 3.8
valuetool | 3.0.15
shapetools | 3.4.1
mapswipetool_plugin | 1.2
coordinate_capture | 0.2
processing | 2.12.99
sagaprovider | 2.12.99
grassprovider | 2.12.99
db_manager | 0.1.20
MetaSearch | 0.3.5

GarminCustomMaps as published not acting as if a valid zip

As published here: https://plugins.qgis.org/plugins/GarminCustomMap/, click "Download latest", the resulting file downloaded to OS-X 10.11.6 fails to unpack w/ "The Unarchiver", which claims to be looking for other parts of archive. Some unzip tools will open GarminCustomMap-1.2.1.zip, but apparently not the one used internally by QGIS. I even changed the OS default to one that worked, no joy. The result is that I've not yet figured any way to install the plugin via the "official" method.

Zoom factor Error: <= 500 tiles

I'm trying to export for a gpsmap64s. It allow 500tiles custom map.
when I'm trying to export I get the warning:
"The number of tiles is likely to exceed Garmins limit of 100 tiles! Not all tiles will be displayed on your GPS unit. Consider reducing your map size (extend or zoom-factor)."

if the tiles number for <=100 is 14, I have to chose 10 tiles for have no problem kmz.

Adjust Makefile

Makefile is old for QGIS 3 and should be updated. Some issues with make package : when the created zip filed is uploaded an error appears:

Couldn't load plugin 'GarminCustomMap' due to an error when calling its classFactory() method 

ModuleNotFoundError: No module named 'GarminCustomMaps' 
Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS34~1.1/apps/qgis/./python\qgis\utils.py", line 335, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/anders/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\GarminCustomMap\__init__.py", line 34, in classFactory
    from .GarminCustomMap import GarminCustomMap
  File "C:/PROGRA~1/QGIS34~1.1/apps/qgis/./python\qgis\utils.py", line 672, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/anders/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\GarminCustomMap\GarminCustomMap.py", line 46, in 
    from GarminCustomMaps import resources
  File "C:/PROGRA~1/QGIS34~1.1/apps/qgis/./python\qgis\utils.py", line 672, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'GarminCustomMaps'


Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] 
QGIS version: 3.4.1-Madeira Madeira, 383851c597 

Python Path:
C:/PROGRA~1/QGIS34~1.1/apps/qgis/./python
C:/Users/anders/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/anders/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS34~1.1/apps/qgis/./python/plugins
C:\Python27\ArcGIS10.2\Lib\site-packages
C:\Program Files\QGIS 3.4.1\bin\python37.zip
C:\PROGRA~1\QGIS34~1.1\apps\Python37\DLLs
C:\PROGRA~1\QGIS34~1.1\apps\Python37\lib
C:\Program Files\QGIS 3.4.1\bin
C:\PROGRA~1\QGIS34~1.1\apps\Python37
C:\PROGRA~1\QGIS34~1.1\apps\Python37\lib\site-packages
C:\PROGRA~1\QGIS34~1.1\apps\Python37\lib\site-packages\win32
C:\PROGRA~1\QGIS34~1.1\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS34~1.1\apps\Python37\lib\site-packages\Pythonwin
C:/Users/anders/AppData/Roaming/QGIS/QGIS3\profiles\default/python

Raster not scaled with dual screen

Hy,

When i used dual screen, the raster is not scaled (vector are ok)
Exemple: The best place of the red zone near the river
ok

The kmz: the red zone vector is ok but the raster is not scaled on the river we can see on the google map view
offset

I used QGIS 3.22.5 on Windows 10

Thanks

Loading extension not possible in QGIS 3.22

Hy,

I used QGIS 3.22 . I have an error message when i want to load this extension
TypeError 'QVariant' object is not subscriptable
image

Thanks

PS: it seems to come from my test profil

Bug in calculating max_y_ext

Line 527 should read

if r == int(n_rows) and n_rows_rest > 0:

not

if r == (n_rows) and n_rows_rest > 0:

otherwise the condition will never be met and max_y_ext may be too large leading to lines 546 to 548 returning a NULL value which will through an exception later on.

error exporting for Garmin 64s

when exporting with zoom for device with 500 tiles, I get this error:

2019-02-27T23:04:50 WARNING Traceback (most recent call last):
File "/Users/----xx----/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/GarminCustomMap/GarminCustomMap.py", line 493, in run
iface.messageBar().pushMessage("WARNING", "The number of tiles is likely to exceed Garmins limit of 100 tiles! Not all tiles will be displayed on your GPS unit. Consider reducing your map size (extend or zoom-factor).", level=QgsMessageBar.WARNING, duration=5)
AttributeError: type object 'QgsMessageBar' has no attribute 'WARNING'

and no file is produced.

elia

Crash with zoom != 1.0 running QGIS in debug mode

First, nice plugin, thanks!

When running QGIS in debug mode (where ASSERTs will kill the app), the plugin causes QGIS to die when the zoom != 1.0. That's because the painter's DPI doesn't match the output DPI.

The way to fix this is to declare a DPI in the QImage used to paint the map:

                # create output image and initialize it
                image = QImage(QSize(width, height), QImage.Format_RGB555)
                image.setDotsPerMeterX(target_dpi / 0.0254);
                image.setDotsPerMeterY(target_dpi / 0.0254);
                image.fill(qRgb(255, 255, 255))

tile band becomes None type

Maybe a corner case, but for a mainly black map canvas the following error pops up:

Traceback (most recent call last):
File "C:/Users/stefan.blumentrath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\GarminCustomMap\GarminCustomMap.py", line 551, in run
if t_band_1.min() == 255 and t_band_2.min() == 255 and t_band_3.min() == 255 :
AttributeError: 'NoneType' object has no attribute 'min'

Scaling with Zoom-Factor no longer works (QGIS since 3.22?)

Not sure exactly since which version, but with 3.22 and 3.24 the scaling of a raster map with a Zoom-Factor =! 1.0 no longer works.

Solution: Comment out line 345 in GarminCustomMap.py

This line:
345: mapSettings.setOutputDpi(target_dpi)

is not needed and makes the map not being scaled (with all but the original canvas being white).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.