Wednesday 27 March 2019

Using HERE background maps in QGIS


The OpenLayers plugin for QGIS allows one to add background maps from various sources to the data frame. These sources include OSM, Google, Bing, MapQuest, and Apple. However, Nokia's HERE Maps, is not among them.


Does anyone know how to add this, or is there another option available to use HERE Maps as a background in QGIS?


As far as I know, there is no straightforward way to add HERE Maps as a background in ArcMap, but it is possible in FME Data Inspector, as long as you have a HERE Developer account.



Answer



I posted an answer about how to add a BaseLayer as Rasterlayer some weeks ago: High resolution, printable alternative to OpenLayers plugin for QGIS? . What I described there can also be used for HERE-Layers.




As user Mapperz already mentioned you need an app_id and app_code to use Here-Tiles. You will get these credentials here: https://developer.here.com/rest-apis/documentation/enterprise-map-tile/common/credentials.html . You should also have a look at the terms of use if there are legal restrictions about how the tiles can be used or requested.





To load the HERE-Baselayer in QGIS you can use the GDAL minidriver.


Here's the XML-Code:




http://1.base.maps.api.here.com/maptile/2.1/maptile/newest/normal.day/${z}/${x}/${y}/256/png8?app_id=YOURAPPID&app_code=YOURAPPCODE


-20037508.34
20037508.34

20037508.34
-20037508.34

20
1
1
top

EPSG:3857
256

256
3



Just save this as a xml-file (Replace the placeholder YOURAPPID and YOURAPPCODE) and open it with the "add Raster Layer" button:




enter image description here


This works for a bunch of different layertypes, just have a look at this for further information: https://developer.here.com/rest-apis/documentation/enterprise-map-tile/topics/examples.html


Here some screenshots:



"Here Normal Day":


enter image description here


"Here Traffic" with the up to date traffic information: enter image description here




EDIT 1: Added another Option: Tile-Layer-Plugin:


If you use the TileLayer-Plugin you can even store your userdefined tile-layer-settings:


Install the plugin: enter image description here


You will need to use a textfile where you store your userdefined Layers. lets call it "tile_layer_plugin.tsv".


The content can look like this:


#title  credit  serviceUrl  yOriginTop  zmin    zmax    xmin    ymin    xmax    ymax

here Normal Day © Here Nokia http://1.base.maps.api.here.com/maptile/2.1/maptile/newest/normal.day/{z}/{x}/{y}/256/png8?app_id=YOUR_APP_ID&app_code=YOUR_APP_CODE 1 0 20
here Traffic © Here Nokia http://1.traffic.maps.api.here.com/maptile/2.1/traffictile/newest/normal.day/{z}/{x}/{y}/256/png8?app_id=YOUR_APP_ID&app_code=YOUR_APP_CODE 1 0 20
here Aerial Terrain © Here Nokia http://1.aerial.maps.api.here.com/maptile/2.1/maptile/newest/terrain.day/{z}/{x}/{y}/256/png8?app_id=YOUR_APP_ID&app_code=YOUR_APP_CODE 1 0 20
here Aerial Satellite © Here Nokia http://2.aerial.maps.cit.api.here.com/maptile/2.1/maptile/newest/satellite.day/{z}/{x}/{y}/256/png8?app_id=YOUR_APP_ID&app_code=YOUR_APP_CODE 1 0 20
here Aerial Hybrid © Here Nokia http://2.aerial.maps.cit.api.here.com/maptile/2.1/maptile/newest/hybrid.day/{z}/{x}/{y}/256/png8?app_id=YOUR_APP_ID&app_code=YOUR_APP_CODE 1 0 20

IMPORTANT: Use TAB as delimiter! enter image description here


Replace the placeholders YOUR_APP_ID and YOUR_APP_CODE with your app-id and your app-code and save the file into a folder that you will use for this plugin.


Open the TileLayerPlugin ( You will find the Plugin in the "Web"-Menu) and click on "Settings". Point to the folder where you saved your textfile:


enter image description here



Then you can just open the plugin whenever you need these baselayers and add them with one click: enter image description here


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...