Tuesday, 2 June 2015

Adding map from website maps-for-free.com as basemap on QGIS?



How can I add map from maps-for-free.com as my base map on QGIS 2.10 Pisa?


My operating system is Windows 7, x64 bit.


enter image description here




@Spacedman. Here, I've gone to ~/.qgis2-->python-->plugins-->quick_map_services-->data_sources


and created a new folder and named it freemap_relief


enter image description here.


But how to save it as metadate.ini ??



Answer



This can be done using the Quick Map Services plugin, which I'm finding better than the OpenLayers plugin for base maps - it has more base maps and loads tiles directly rather than using Javascript to pull in the HTML for a region that then loads the tiles. It also produces base map layers that work better with Map Composer windows, where the OpenLayers layers don't scale properly.



So if what you are trying to do is add the maps-for-free relief shaded layer as a base map in QGIS you will have to write a metadata.ini file for a new layer since the configuration isn't included either with the package or as one of the contributed packages.


The only non-trivial part of a metadata file for QMS is the url, which should be set to this:


 url = http://maps-for-free.com/layer/relief/z{z}/row{y}/{z}_{x}-{y}.jpg

I've just this second noticed the link on the page that says the tiles are CC0 licensed - until then I wasn't sure if this layer could be repurposed in QGIS. Now I know that, I'll give the full instructions...


Install QuickMapServices plugin for QGIS. Find your QGIS plugins folder (~/.qgis2/python/plugins on Linux, somewhere else under your home folder for other OSes) and find the quick_map_services folder underneath it. In the data_sources folder create a new folder called freemap_relief and inside that folder save the following text in a file called metadata.ini. Restart QGIS and it should appear in the available layers of QSM:


[general]
id = freemap_relief
type = TMS
is_contrib = True


[ui]
group = Freemap
alias = FreemapRelief
icon = freemap.svg

[license]
name = CC0
link = http://creativecommons.org/
copyright_text = unknown state

copyright_link = http://www.maps-for-free.com
terms_of_use = http://www.maps-for-free.com

[tms]
url = http://maps-for-free.com/layer/relief/z{z}/row{y}/{z}_{x}-{y}.jpg
zmax = 19

And here's the proof - relief layer overlaid with google labels layer:


maps for free relief layer


I should tidy this up, create an icon, and contribute it to the project along with some other QSM layer configs I've been working on...



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...