Tuesday, December 11, 2018

Generate Single Mosaic Raster/Map from Map Tiles (Basemap Series Part 6)

This post is designed as continuation from previous Post

Now if you understand from my previous blog posts, many online map providers publish their online maps as tiled raster/vector map. There also many geospatial data format has been developed to store these tiles. One of them is MBTILES Format.

MBTILES stores all tiles into one packed file grouped into its respective zoom levels. Because the tiles structure inside the MBTILES has been standardized, mosaicking those tiles into one single raster dataset is pretty much possible.

There are plenty ways to do the mosaicking, one of them is utilizing MOBAC software. You can also use SasPlanet to do this.

At my previous post, I show you how to make custom styles of Google Maps using snazzymaps, now I will continue to generate single raster maps of my Area of Interest from the custom google maps.

Here is the workflow

1. From my previous post, the endpoint URL of my custom styled Google Maps is shown below.


2. Now create An XML file using text editor (like Notepad++), and prepare XML structure like this below, and paste the above URL between the url Tag.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><customMultiLayerMapSource>







<url>paste the URL above here</url>


3. Modify the {z}, {x} and {y} from the URL to {$z}, {$x} and {$y}, then save the XML file into MapSources folder in the MOBAC folder. 

4. This step is optional. Until this point, if you open the MOBAC and load the XML, it will return/load the map tiles. If you still find error like the tiles are not loaded (marked with white rectangle), changes the HTTPS in the URL to only HTTP, and see if it solves the error. 

5. Open the MOBAC software, Create New Atlas in MBTILES Format. 

6. Boot Up the Google Custom Map created in the previous steps until the tiles shown in the map page. 

7. Continue with the Zoom level selection, Add Zoom level selection and Create Atlas. 

8. Once the atlas creation finished, click Atlas Menu on the top left corner of MOBAC interface, and choose Convert Atlas Format, Choose PNG + World File Format. 

9. Click Create Atlas Button once again, MOBAC will generate mosaic of the downloaded tiles in PNG format, for every Zoom Level. 

10. The coordinate system used in the mosaic dataset depends on the coordinate system used by the Map Provider (usually in Web Mercator Projection), if you need another Coordinate System, you can convert it using QGIS, ArcGIS or any other GIS software. 

11. Here is an example of mosaic created from 5435 tiles of Google Maps custom style at Zoom Level 19. 

Here is a video tutorial about how to download and customize the google map style