See also the Potential natural vegetation map for eastern Africa for an example of a Google Earth layer created with MapTiler. The Potential Natural Vegetation map for Central and Southwest Kenya is an example of mash-up map created with MapTiler, with some adaptations of the page layout and the addition of a legend. System(paste("convert -transparent white ",tfwp, " ", tfwp, sep="")) # convert background color to transparent # Loop to set transparency and optimize the png images Tfwp <- list.files(path = "/home/paulo/vegethiopia", pattern = "png", all.files = FALSE, full.names = TRUE, recursive = TRUE) Of course you can use your own favorite scripting or programming language to do the same. I wrote a small script in R to convert the background color to transparent and to process all PNG tiles generated by MapTiler using the PNGNQ utility. You probably want to automate this because depending on the zoom level selected in MapTiles, there are potentially thousands of png files. I am doing this after the PNG tiles have been created at the same time I am optimizing the map tile images to speed up the download and save space on the server.Īs described in this blog the PNGNQ tool is excellent for post-processing of PNG tiles generated from MapTiler/GDAL2Tiles. See this post.Īs an alternative I am using ImageMagick to convert the image to png and make the pixels containing NODATA transparent. UPDATE: This now works for me, so the steps below should not be needed. There is an option in MapTiler to set a transparency for a color (NODATA), but for some reason this doesn’t work for me. For the map to blend well with the background maps the NODATA pixels should be transparent. MapTiler offers a wizard like interface which leads you step by step through the process. maptiler -o tiles map.tif -zoom +1 -1 Example: zoom levels are set to 0 - 4, as explicit minimum, relative maximum to native zoom level maptiler -o tiles map.tif -zoom 0 -1 Tile formats The produced tiles can be saved in one of several image format. The result is then directly uploaded to MapTiler Cloud, and a new tileset is subsequently created in the Tiles section of the related account. The resulting file can be used in MapTiler to create map mashups for Google Earth, Google Maps or OpenLayer. We then only need to adjust the desired zoom levels (z0-z5) and launch rendering to get optimized vector tiles in a few minutes. To export the vegetation map from my GRASS GIS database to a georeferenced image, I used the r.out.tiff function. MapTiler requires a georeferences image file as input. Apart from the version mentioned in this post, I also created a version with MapTiler. ![]() The map together with documentation was initially made available on CD-ROM. For a project a few years ago we created a vegetation map for central and southwest Kenya (see here for more information).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |