<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div><br></div><div>Hi again,</div><div><br></div><div>I'm interested in trying to use the "Script-level Access via GDAL" guidance on the NASA "GIBS API for Developers" page:</div><div><br></div><div><a href="https://wiki.earthdata.nasa.gov/display/GIBS/GIBS+API+for+Developers" target="_blank">https://wiki.earthdata.nasa.gov/display/GIBS/GIBS+API+for+Developers</a></div><div><br></div><div>The layer I'm interested in is "ASTER_GDEM_Color_Index" which is elevation data. </div><div><br></div><div>The site contains advice on how to customize a WMS service description file for the multitude of data types offered and I came up with this:</div><div><br></div><div><div><GDAL_WMS></div><div> <Service name="TMS"></div><div> <ServerUrl><a href="http://map1.vis.earthdata.nasa.gov/wmts-geo/ASTER_GDEM_Color_Index/default/2014-01-01/EPSG4326_31m/$%7Bz%7D/$%7By%7D/$%7Bx%7D.png" target="_blank">http://map1.vis.earthdata.nasa.gov/wmts-geo/ASTER_GDEM_Color_Index/default/2014-01-01/EPSG4326_31m/${z}/${y}/${x}.png</a></ServerUrl></div><div> </Service></div><div> <DataWindow></div><div> <UpperLeftX>-180.0</UpperLeftX></div><div> <UpperLeftY>90</UpperLeftY></div><div> <LowerRightX>396.0</LowerRightX></div><div> <LowerRightY>-198</LowerRightY></div><div> <TileLevel>11</TileLevel></div><div> <TileCountX>2</TileCountX></div><div> <TileCountY>1</TileCountY></div><div> <YOrigin>top</YOrigin></div><div> </DataWindow></div><div> <Projection>EPSG:4326</Projection></div><div> <BlockSizeX>512</BlockSizeX></div><div> <BlockSizeY>512</BlockSizeY></div><div> <BandsCount>4</BandsCount></div><div></GDAL_WMS></div></div><div><br></div><div>I made two changes in order to make it work properly.</div><div><br></div><div>1. I think that the resolution is actually 31m which I found here</div><div><br></div><div><a href="http://map1.vis.earthdata.nasa.gov/wmts-geo/1.0.0/WMTSCapabilities.xml" target="_blank">http://map1.vis.earthdata.nasa.gov/wmts-geo/1.0.0/WMTSCapabilities.xml</a><br></div><div><br></div><div>2. The TileLevel is 11, which I believes follows from the increased resolution.</div><div><br></div><div>Anyway, the following command (adapted from one of the examples on the page) works beautifully:</div><div><br></div><div>gdal_translate -outsize 1200 1000 -projwin -105 42 -93 32 my.xml out.tif</div><div><br></div><div>However, it produces four bands of a colored GeoTIFF, whereas I'd like elevation values instead.</div><div><br></div><div>Is there some way to get elevation VALUES from this?</div><div><br></div><div>Normally, elevation values in the GDAL world come in a single band. Did I overlook another Layer name that has elevation values? Or is there some way to lookup elevations given the RGBA values?</div><div><br></div><div>Thank you very much,</div><div><br></div><div>carl</div></div>
</div><br></div>