Skip to content

Instantly share code, notes, and snippets.

@atlantageek
atlantageek / gist:27d40309c23a3312e6985c16ca430ab6
Created September 6, 2023 20:41
Generating a png from a wms map and a geojson object.
% gdal_translate -of GTiff -projwin -83.55 34.55 -83.44 34.44 -projwin_srs WGS84 -outsize 1024 1024 frmt_wms_openstreetmap_tms.xml openstreetmap.tif
Input file size is 67108864, 67108864
0...10...20...30...40...50...60...70...80...90...100 - done.
% gdal_rasterize -b 1 -b 2 -b 3 -burn 255 -burn 0 -burn 0 source.geojson openstreetmap.tif
0...10...20...30...40...50...60...70...80...90...100 - done.
% gdal_translate -of PNG -ot Byte -colorinterp red,green,blue openstreetmap.tif openstreetmap.png
Input file size is 1024, 1024
0...10...20...30...40...50...60...70...80...90...100 - done.