Get values from geospatial image

575 views Asked by At

I have a Geoserver which serves WMS layers. I have a requirement where I select a location which has latitude and longitude and corresponding to the latitude and longitude I have to fetch the value from WMS layer. I am not able to find a solution to this requirement. Any help is highly appreciated.

1

There are 1 answers

0
Ian Turton On

The WMS spec provides a GetFeatureInfo request that allows you to query a point on the map, however it uses image coordinates rather than map coordinates (lat/lon). Provided that your image is reasonably small you should be able to get away with assuming a linear relationship between the two coordinate systems so by using the bounds of the map (which you know from the WMS request bbox param) and the size of the image (also part of the WMS request) you should be able to convert a lat/lon pair to an image coordinate (remember to flip the Y-axis though, as the image origin is top left).