- QLandkarte GT
- Wikiloc
- Avenza Maps
- GDAL
- Converting Latitude and Longitue to Image Pixels
- QGIS
- QGIS Server
- Proj4
- Using Proj4 to convert co-ordinates from lat/long WGS84 to OSGB
- WMTS
- gvSig
- Converting TIFF World files to GeoTiff
- JOSM
- Vespucci
- OpenStreetMap
- Elevation Data
- Open Locations Codes (Plus Codes)
- Miscellaneous
- References
- Resources
GIS Tips
This document contains notes and tips relating to Geographic Information Systems (GIS).
QLandkarte GT
Excellent client for managing GPS maps, routes and tracks. Also good for georeferencing tif images. The documentation is thin, but with perseverance, once you've figured out how it all works, it's a very good tool indeed.
Workarounds
Some tasks can't be done immediately, but the following workarounds get you the same end result:
To modify a route, convert it to an overlay, modify the overlay and convert back to a route.
To split an overlay, convert it to a track, split the track and convert the parts to overlays.
Track segments can be joined.
The most useful feature of QLandkarte GT is it's SQLite Database Manager which can be used to store Waypoints, Routes, Tracks and Overlays. It can be structured hierarchically, with branches that can be defined as a Group, Project or Other, which apply differenct rules relating to opening the branches recursively. This really helps when managing many GIS features and planning routes etc.
When importing data or downloading from the GPS, if the data contains identifying keys previously provided by QLandkarte GT, it is associated with the record in the database. Be careful if you have modified the data since the export as QLandkarte GT may not pick up the change (depending on the version of QLandkarte GT), e.g. moving a waypoint.
Note: QLandkarte GT is apparently no longer being maintained. QMapShack is being developed to supersede it.
Issues
macOS shows dialog boxes using the wrong language
This seems to occur when there is no translation for the desired languge and
it defaults to the first locversion.plist
file found under QLandkarte
GT.app/Contents/Resources/
, which is Czech. These resource files are created
by ./MacOSX/mklocversion.sh
script in the source tree during the build.
Presumably there is a bug somewhere in the Mac OS X implementation such that
this happens with English. One ugly workaround is to create
./src/locale/qlandkartegt_en.ts
with English translations.
See "Translation the Application Menu and Native Dialogs" in http://doc.qt.io/qt-5/osx-issues.html.
- http://doc.qt.io/qt-5/internationalization.html
- http://doc.qt.io/qt-5/qcoreapplication.html#installTranslator
- http://doc.qt.io/qt-5/qtranslator.html
- http://doc.qt.io/qt-5/qfiledialog.html
- http://doc.qt.io/qt-5/qtlinguist-index.html
Cannot Create Map - All maps in a level must have the same projection
Run Qlandkarte GT from the command line with the -d
debug option. When the
maps are loaded, the projections used will be listed.
You can then use gdalwarp
to create tiffs using the same projection, perhaps
by copying one of the existing projections reported in the debug. E.g.
$ gdalwarp input.tiff output.tiff -t_srs "+proj=utm +zone=10 +ellps=GRS80 +towgs84=0.991,-1.9072,-0.5129,0,0,0,0 +units=m +no_defs "
You can also clip the source images using pixel sizes with the -srcwin
option to gdal_translate
, e.g.
$ gdal_translate -srcwin 913 999 7296 9103 \
-a_srs "+proj=utm +zone=10 +ellps=GRS80 +towgs84=0.991,-1.9072,-0.5192,0,0,0,0 +units=m +no_defs" \
input.tif output.tif
This example converts a geo-referenced PDF extracting a specificly named layer:
$ gdal_translate -srcwin 913 999 7296 9103 \
-a_srs "+proj=utm +zone=10 +ellps=GRS80 +towgs84=0.991,-1.9072,-0.5192,0,0,0,0 +units=m +no_defs" \
--config GDAL_PDF_LAYERS "Layer.name" --config GDAL_PDF_BANDS 3 --config GDAL_PDF_DPI 400 \
input.pdf output.tif
This example converts a geo-referenced PDF extracting all except a specificly named layer:
$ gdal_translate -srcwin 913 999 7296 9103 \
-a_srs "+proj=utm +zone=10 +ellps=GRS80 +towgs84=0.991,-1.9072,-0.5192,0,0,0,0 +units=m +no_defs" \
--config GDAL_PDF_LAYERS_OFF "ALL" --config GDAL_PDF_LAYERS_OFF "Layer.skip" \
--config GDAL_PDF_BANDS 3 --config GDAL_PDF_DPI 400 \
input.pdf output.tif
Building On macOS
Extract the source:
$ tar -xvf qlandkartegt-1.8.1.tar.gz
Check the build and installation instructions:
$ more ./qlandkartegt-1.8.1/INSTALL
Install required libraries, e.g. if using Macports:
$ sudo port install libproj4
When using Macports, install gpsbabel with the qt4 variant:
$ sudo port install gpsbabel +qt4
Run ccmake:
$ mkdir build_QLandkarteGT/
$ cd build_QLandkarteGT/
Configure the build environment:
$ ccmake -Wno-dev -D QT_QMAKE_EXECUTABLE=/opt/local/libexec/qt4/bin/qmake ../qlandkartegt-1.8.1
When the configuration cache window is displayed, press 'c' to configure, then 'g' to generate the configuration. You may need to press 'c' a second time before the 'g' generate option is shown.
Perform the build:
$ make
Custom Waypoints
Visit https://github.com/sdennler/waypoint-symbols for artwork and
instructions for creating custom waypoint symbols for Garmin devices. On Mac
OS X the WaypointIcons folder is under ~/Library/Application
Support/QLandkarte GT/WaypointIcons/
.
Wikiloc
Wikiloc provides the ability to manually plot a track on the website using both OpenStreetMap and satellite tile images (amongst other map options).
You must be registered and signed in.
Select the option to 'Upload trails'.
Select 'Draw your trail by hand'.
You can leave the search field blank and a world map is displayed which you can pan and zoom to the start location.
Single-click on the map to start the trail.
This facility is provided within the free version. By default the track/trail may be public (inconsistent behaviour). It can optionally be marked as private under the 'Privacy' option on the Step 3/4 details screen.
-- Frank Dean - 26 Jan 2024
Avenza Maps
Avenza Maps provide apps for Android and iOS that work with geo-referenced TIFF maps. Paths and placemarks are imported using KML files.
See AvenzaMapsTips for more information.
GDAL
When installing gdal on macOS using Macports, install with the poppler variant to support converting geospatial PDF files to tiff.
$ sudo port install gdal +popler
See also:
- http://www.gdal.org
- https://wiki.openstreetmap.org/wiki/Convert_GeoPDF_to_GeoTiff
- https://www.usgs.gov/faqs/can-i-convert-a-us-topo-geopdf-geotiff-format
Converting Latitude and Longitue to Image Pixels
- Convert latitude longitude pair to pixels in geotiff
- If You Have A GeoTiff, Would It Be Possible To Transform A Lat/Lon Point To An X,Y Using The GeoTransform?
QGIS
It appears that OpenLayers:900913 (Google transliterated to numbers) has been deprecated and you can use EPSG:3857 instead.
See http://wiki.openstreetmap.org/wiki/QGIS for details on using Open Street Map data with QGIS.
Importing GPS Data
Enable the GPS Tools plugin.
Note that not all data is imported, in particular relations are missing. See the following:
- https://hub.qgis.org/issues/8878
- http://gis.stackexchange.com/questions/73238/how-do-i-load-osm-vector-data-in-qgis-2-x/101746#101746
- http://anitagraser.com/2014/05/31/a-guide-to-googlemaps-like-maps-with-osm-in-qgis/
- http://gis.stackexchange.com/questions/86713/osm-import-some-features-are-missing.
OpenStreetMap Styling Rules
The following rules to seem to work well for hiking trail types in the United Kingdom:
Rights of Way
- Byway open to all traffic (BOAT) "designation" = 'byway_open_to_all_traffic'
- Restricted byway "designation" = 'restricted_byway' OR ("highway" = 'byway' AND "designation" IS NULL)
- Bridleway "highway" = 'bridleway'
- Public footpath "highway" IN ( 'footway') OR ("foot" = 'yes' AND "designation" = 'public_footpath')
Other
- Track "highway" = 'track' AND ("designation" NOT IN ('byway_open_to_all_traffic', 'restricted_byway') OR "designation" IS NULL)
- Path "highway" IN ('path' , 'pedestrian') AND ("foot" = 'yes' OR "designation" NOT IN ('byway_open_to_all_traffic', 'restricted_byway') OR "designation" IS NULL)
- Barrier "barrier" IN ('fence' , 'hedge', 'wall', 'wire_fence')
- Railway "railway" = 'rail'
- Stream "waterway" = 'stream'
Other features can usually be implemented as a simple attributes of the highway key. E.g. primary/primary_link/trunk/secondary/tertiary/unclassified/service/road/cycle_way/residential
Saving Geo-referenced Tiffs
Select Project -> Save as Image...
from the menu. QGIS saves the image
as a tif, together with a file of the same name, but with a 'tifw' extension.
The 'tifw' file does not include the project, so it is necessary to include
the project when using gdal_translate
to create a proper geo-referenced
tiff. E.g.
$ gdal_translate -a_srs EPSG:4326 example.tif example_ref.tif
Creating Garmin Custom Maps
Activate the GarminCustomMap plugin.
When you execute the plugin from the menu `Plugins->CustomGarminMap', the export dialog contains tabs which provide more information, e.g. estimation of the maximum number of tiles that will be produced at the current zoom level and what maximum zoom level you can use to stay within the limits of the target device.
Version 1.1 of this plugin didn't work well for me with Version 2.8 of
QGIS, not rendering tiles properley when setting the zoom level greater
than 1.0. Also, the Garmin eTrex 30 ignored KML files
with the
See also http://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin
Developing Plugins
http://docs.qgis.org/2.8/en/docs/pyqgis_developer_cookbook/plugins.html
There are some notes on Debugging QGIS Plugins, but this looks like it's only relevant to those written in C++.
QGIS References
- How to Create Garmin Topo Maps
- http://gis.stackexchange.com/questions/103144/qgis-making-a-backgound-map-for-topolines-on-garmin
- http://gis.stackexchange.com/questions/92354/automating-the-production-of-gps-compatible-map-tiles-from-georeferenced-raster
QGIS Server
Proj4
For Debian 7.0 (Wheezy) install the proj-bin
package.
Using Proj4 to convert co-ordinates from lat/long WGS84 to OSGB
$ cs2cs +proj=latlong +ellps=WGS84 +towgs84=0,0,0 +nodefs +to \
+proj=tmerc +ellps=airy +datum=OSGB36 \
+lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 \
+towgs84=446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894 \
+units=m +no_defs << EOF
6d12'7.38"W 57d23'25.38"N # NG 47600 41135
-6d12'7.38" 57d23'25.38"
-6.20205 57.390383
6.20205W 57.390383N
EOF
Note that the input values are longitude followed by latitude (x, y ordered).
and the inverse by adding the -I
parameter:
$ cs2cs -I +proj=latlong +ellps=WGS84 +towgs84=0,0,0 +nodefs +to \
+proj=tmerc +ellps=airy +datum=OSGB36 \
+lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 \
+towgs84=446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894 \
+units=m +no_defs << EOF
147600 841135
147599.75 841134.99
EOF
add a parameter of -f '%.8f'
to output as decimal degrees:
$ cs2cs -I +proj=latlong +ellps=WGS84 +towgs84=0,0,0 +nodefs +to \
+proj=tmerc +ellps=airy +datum=OSGB36 \
+lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 \
+towgs84=446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894 \
+units=m +no_defs -f '%.8f' << EOF
147600 841135
147599.75 841134.99
EOF
The values for +lat_0, _lon_0, +k, x_0, +y_0 are as published in Appendix A.2 of http://www.ordnancesurvey.co.uk/docs/support/guide-coordinate-systems-great-britain.pdf
See also:
- http://osgeo-org.1560.x6.nabble.com/OSGB36-td3850686.html
- http://stackoverflow.com/questions/1426941/proj-4-library-and-osgb36
- http://lists.maptools.org/pipermail/proj/2005-November/001854.html
WMTS
Web Map Tile Service - OGC Standard
gvSig
Open-source - Linux/Windows desktop application - Also have Android client
Converting TIFF World files to GeoTiff
In Debian, install the geotiff-bin
package
geotifcp -e foo.tfw foo.tif geo_foo.tif
See http://maps.cga.harvard.edu/qgis/wkshop/export_GeoTiff.php
JOSM
JOSM is a Java based GUI for editing OpenStreetMap data.
Vespucci
Vespucci is Vespucci is and Android app for editing OpenStreetMap data.
OpenStreetMap
- gosmparse - OpenStreetMap PBF Parser in Go
Elevation Data
- Open-Elevation
- https://en.wikipedia.org/wiki/Digital_elevation_model
- SRTM 90m Digital Elevation Data from The CGIAR Consortium for Spatial Information
Open Locations Codes (Plus Codes)
Miscellaneous
- Calculate distance and bearing between two Latitude/Longitude points using haversine formula in JavaScript
- Aviation Formulary V1.47—Great Circle Navigation Formulae
- sextant Turbo Pascal Navigation 1991
- Nanomaps - a small JavaScript library for displaying no-frills slippy maps on click and touch devices
- nanomaps-server - a simple tile map server written in Java
- iOS GPX Framework - a iOS framework for parsing/generating GPX files
- Remember - Progressive web app using geolocation and device orientation in React with Redux
- GoMap - Issue tracker for Go Map!!
References
- The GPS Exchange Format
- GPX 1.1 Schema Documentation
- GRASS GIS
- GeoTools
- JOSM
- MOBAC
- epsg.io
- Spatial Reference
- QGIS
- Vespucci
Resources
- GeoNames geographical database
- New OSGeoLive Release Opens Doors to Geospatial Worlds | LinuxInsider
- gdal - node-gdal
- qgis - Get value of clicked raster cell - Geographic Information Systems Stack Exchange
- Latitude Correction
-- Frank Dean - 4 Feb 2016
Related Topics:
AvenzaMapsTips, Garmin_eTrex30, GPSBabel, OsmAndMaps, ViewRangerTips