Last active
January 18, 2022 16:55
-
-
Save jscarto/6c0413f4820ed5141744e96e19f31205 to your computer and use it in GitHub Desktop.
Export a single image from GIBBS tile server. // UNTESTED MAY NOT WORK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there any way to pass something like a bounding box to not query the entire earth?:)