Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to get elevation data from the tile received from USGS server.

I query the data using Image Format image/Png. When I read the data I get color values. I need to know how to read the elevation values from it. Is there any documentation or sample available.

share|improve this question

2 Answers 2

WMS returns an image of your data, if you want to use it as data then you need a WCS.

share|improve this answer
    
Yes but there is only WMS implementation is available for the data. How we can get the elevation data from the color values (heightmaps) –  Mohit Feb 13 '12 at 12:40
    
You can't directly - it might be possible to convert the colour back to a height but it will probably not be accurate. –  iant Feb 13 '12 at 12:43

In a nutshell, you can't. As @iant says, WMS is just imagery that is designed to be displayed on your screen. To get the actual data, you'd need a WCS. If USGS doesn't supply that, then your options are limited.

You could make a guess at a pixel's height value if you know the range over which the greyscale covers. For instance, it might be [0-1000] metres, which means that each shade of grey in a 256-colour image covers a height of 1000/256 ~= 4 metres. So you'd just need to multiply the grey value you get by that number to get an approximate height. But unless your horizontal resolution is quite large, a 4 metre vertical resolution would be a noticeable stair-step.

Also, as WMS is designed to produce pretty maps rather than analysable data, you are likely going to get all sorts of other cruft such as place names, roads, and contour lines, that will throw your calculations right off.

If I were you, I'd investigate where they got their source data from to generate these WMS tiles. If its fairly low resolution, it's probably based on SRTM data, which you can get for free for (almost) anywhere on the earth.

Either that, or petition the USGS to provide a WCS server of the data you want, but I wouldn't hold your breath!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.