I have a large number of tiff files (map tiles) along with tab and tfw file types as part of an Ordnance Survey download. This is for an offline iOS app. I managed to get the tiffs into QGIS with correct projections and save as a virtual raster. What I need to do now is somehow convert or save it to an mbtiles format.
How can this be done on a Mac?
Answer
I agree with mapbarker and say TileMill would be the best route. However the problem you have is that the original raster files are in British National grid (epsg:27700) and need to be warped to the google sperical mercator projection (epsg:3857)
The MapBox team have a good tutorial on this - https://www.mapbox.com/tilemill/docs/guides/reprojecting-geotiff/
So all you will have to do is warp your virtual raster, load into TileMill then export out.
The alternative is to use the gdal2tiles.py and then mbutil to load the directory of tiles into the mbtile. This is a painful and very time consuming route.
--EDIT--
Ok to explain further.
You said you had already created your VRT for the rasters using QGIS. So you need to warp the VRT from its current projection to the one required to created MBTiles - as explained in the link above.
Do you have GDAL installed? If not you could install it and then using the link above use the gdal_warp command to convert to the EPSG 3875.
If you dont want to install GDAL then you can use QGIS>Raster(from the top toolbar)>Projections>Warp
Then select your VRT file, then specificy an output to save to
Then select EPSG:27700 as the source SRS and then EPSG:3875 as the target SRS,
Then I would loolk at this previous question - Converting Ordnance Survey raster maps to WGS84 webmap tiles and determine which resampling method you want.
Then let QGIS do it works
Once the warp has finished you will have a new raster file
Load this into TileMill and then export out as an MBTile
No comments:
Post a Comment