![]() If that area that does not go too far north or south, you can safely omit this entire option. If you are working with raster data of a smaller area you will need to make sure that these numbers are adjusted to reflect the area it represents. The four big numbers after -te represent the western, southern, eastern and northern limits (respectively) of a web mercator map. The WGS 84 projection can safely contain data all the way to 90° North & South, while web mercator is really only intended to display data up to about 85.05° North & South. This is necessary because the Natural Earth geotiff contains data outside the bounds that the web mercator projection is intended to display. If you don’t mind waiting longer for very high-quality output, choose lanczos. If you want the command to run faster and don’t mind a rougher-looking output, choose near instead of bilinear. r bilinear is telling the program what resampling interpolation method to use. For any raster file you want to use with TileMill this should be EPSG:3857. t_srs means “target spatial reference system” - this is the projection that you want to convert the datasource to. s_srs means “source spatial reference system” - this is the projection that the flle you are starting with is stored in, which in the case of Natural Earth is EPSG:4326. ![]() A full description of the gdalwarp command options can be found in the GDAL documentation. Let’s go through what each piece of that command means. NE2_LR_LC_SR_W.tif natural-earth-2-mercator.tif Gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3857 -r bilinear \ (This is one command split across several lines you should be able to copy and paste the whole thing at once.) In your terminal, navigate to the directory where the geotiff is stored and run the following command. As an example, we’ll work with the medium-sized ‘Natural Earth II with Shaded Relief and Water’ geotiff available from Natural Earth, which is projected to WGS 84 (aka ‘EPSG:4326’). You will also need to know the original projection of the geotiff you are converting. The projection we need to warp is Google Web Mercator, which can be referenced by the code ‘EPSG:3857’. This can be done with the gdalwarp command that comes with the GDAL library. For this reason it is recommended that you ensure the file is warped to the proper projection before importing it into your TileMill project. While TileMill’s renderer does support reprojecting raster data sources on-the-fly, this can slow down your map preview and exports significantly. ![]() This guide explains the basics of preparing a GeoTIFF for TileMill and adding it to a project. Set up GDAL for processing raster data in the terminal.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |