Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

How can I use the output from MOBAC (Mobile Atlas Creator) as background layer in open source desktop GIS software (e.g., QGis or uDig, TileMill etc.)?

My goal: To put my question into context: I want to use my downloaded map tiles as background raster map. On top of this, I want to add GPX tracks to create a map with mountain bike routes.

My tiles: I have a set of tiles downloaded using MOBAC. The tiles are in PNG format, each having a size of 256x256px. The projection is GlobalMercator (as in Google Maps). The naming scheme is $(z)_$(x)_$(y).png. I only have z (zoom level) 14. I can access the tiles through a local web server using a URL such as http://localhost/~username/MyMaps/14_8622_5722.png

The problem: I can't find a way to feed output from MOBAC into GIS software.

Previous efforts:

  • I have successfully created an OpenLayers web map as follows:

    var name = 'Test Layer';
    var url = "/~username/MyMaps/${z}_${x}_${y}.png";
    var options = {
      type: 'png',
      sphericalMercator: true, 
      isBaseLayer: false, 
      minZoomLevel: 14
    };
    var layer = new OpenLayers.Layer.XYZ(name, url, options);
    
  • I have tried to directly add the image tiles as a layer in QGis. But the tiles are not georeferenced.

  • I have exported the tiles to MbTiles format using Mobac. But - surprising to me - not even TileMill seems to be able to load the .mbtiles file as background layer.

  • I have served the .mbtiles file using TileStream but could not access the TileStream server using QGis or uDig.
  • I have tried adding the tiles as GeoServer store using the Image Mosaic plugin, but I could not get it to work.

...Can you provide hints and help as to which route to take? I.e., which MOBAC export format should I use so to be able to import the map data into GIS software?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

If you can access your tiles via Openlayers, you can use the openlayers plugin to display them in Qgis. Just look for .qgis\python\plugins\openlayers\openlayers_plugin.py for the structure of adding the layers. Its not much apart from the original OL. Then you have to add a html file in the html subfolder. The call of the tiles is within that html file and has the format

"http://localhost/folder/${z}${x}${y}.png",

as you mentioned above.

share|improve this answer
    
great, thank you, this probably resolves my question - I'll upvote once I've tried your suggestion! thx, Johannes –  Johannes Sep 11 '12 at 15:31
    
This kind of works, but does not work very well * I guess I would have to generate or download tiles in zoom levels 1-13. Any ideas how to do this? * Also, when I pan around, some space in my QGis windows stays blank for some reason. Weird. –  Johannes Sep 12 '12 at 8:37
    
For the first part, you can set the default view to your area of interest. it is currrently set to 0;0 in the middle of the atlantic. For the second, just pan your canvas a millimetre, and you get the rest of the tiles. Weird, but seames to be a timeout problem not solved well. Before updating the OL plugin to a future version, make a copy for yourself, or your adaptation will get lost. –  Andre Joost Sep 12 '12 at 8:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.