Prequesites
I have vector data in a Shapefile N47E007_CONTOURS.shp produced with
wget -O N47E007.zip http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL1.003/2000.02.11/N47E007.SRTMGL1.hgt.zipunzip N47E007.zipgdal_translate -co "COMPRESS=LZW" -of GTiff N47E007.hgt N47E007_WGS84.tifgdalwarp N47E007_WGS84.tif N47E007_WebMercartor.tif -s_srs EPSG:4326 -t_srs EPSG:3857 -r bilineargdal_contour -a elev -i 20 N47E007_WebMercartor.tif N47E007_CONTOURS.shp(Contour lines based on one patch (N47E007) of NASA SRTM elevation data.)
Process
From this, I generate TMS/WMTS tiles to be used by leaflet, by first rasterizing the vector data from the Shapefile with gdal_rasterize and then tiling it with gdal2tiles.py. I repeat both steps for every zoomlevel, so I can rasterize to a larger raster for higher zoomlevels, so that lines will have the same on-screen thickness on each one:
#!/bin/shfor z in $(seq 1 15)do gdal_rasterize \ --config GDAL_CACHEMAX 1024 \ -ts $(calc "2851
I have vector data in a Shapefile N47E007_CONTOURS.shp produced with
wget -O N47E007.zip http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL1.003/2000.02.11/N47E007.SRTMGL1.hgt.zipunzip N47E007.zipgdal_translate -co "COMPRESS=LZW" -of GTiff N47E007.hgt N47E007_WGS84.tifgdalwarp N47E007_WGS84.tif N47E007_WebMercartor.tif -s_srs EPSG:4326 -t_srs EPSG:3857 -r bilineargdal_contour -a elev -i 20 N47E007_WebMercartor.tif N47E007_CONTOURS.shp(Contour lines based on one patch (N47E007) of NASA SRTM elevation data.)
Process
From this, I generate TMS/WMTS tiles to be used by leaflet, by first rasterizing the vector data from the Shapefile with gdal_rasterize and then tiling it with gdal2tiles.py. I repeat both steps for every zoomlevel, so I can rasterize to a larger raster for higher zoomlevels, so that lines will have the same on-screen thickness on each one:
#!/bin/shfor z in $(seq 1 15)do gdal_rasterize \ --config GDAL_CACHEMAX 1024 \ -ts $(calc "2851