5

Export a single image from GIBBS tile server. // UNTESTED MAY NOT WORK

 3 years ago
source link: https://gist.github.com/jscarto/6c0413f4820ed5141744e96e19f31205
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Export a single image from GIBBS tile server. // UNTESTED MAY NOT WORK · GitHub

Instantly share code, notes, and snippets.

Export a single image from GIBBS tile server. // UNTESTED MAY NOT WORK

outformat=JPEG category=best layer=MODIS_Terra_CorrectedReflectance_TrueColor caldate=2020-09-09 tileset=250m ext=jpg tilelevel=9 bands=3 tmp_image=output.jpg

cmd="gdal_translate -q -of "$outformat" -outsize 18000 9000 -projwin -180 90 180 -90 '<GDAL_WMS><Service name=\"TMS\"><ServerUrl>https://gibs.earthdata.nasa.gov/wmts/epsg4326/$category/"$layer"/default/"$caldate"/"$tileset"/\${z}/\${y}/\${x}."$ext"</ServerUrl></Service><DataWindow><UpperLeftX>-180.0</UpperLeftX><UpperLeftY>90</UpperLeftY><LowerRightX>396.0</LowerRightX><LowerRightY>-198</LowerRightY><TileLevel>"$tilelevel"</TileLevel><TileCountX>2</TileCountX><TileCountY>1</TileCountY><YOrigin>top</YOrigin></DataWindow><Projection>EPSG:4326</Projection><BlockSizeX>512</BlockSizeX><BlockSizeY>512</BlockSizeY><BandsCount>"$bands"</BandsCount></GDAL_WMS>' $tmp_image" eval $cmd echo 'all done!'


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK