I am working with a MapServer and a map file that is displaying a color-relief image.

    NAME            "sum"
    DATA            "sum.vrt"   
    TYPE            RASTER
    STATUS          ON
    DEBUG           0
    MASK            "masklayer"
    TOLERANCE       0

enter image description here

Note: I had it working with a PNG raster instead of the VRT with the TIF file also.

I need to be able to identify the pixel value at a point

I did a WMS request GetCapabilities. It is saying that my sum layer is not queryable.

I tried to do a WMS call with the GetFeatureInfo and I made the bbox from the lat/lng of the point. I thought that would work but since the layers are not queryable, the request will fail.

What can be done to get the value at a point? Could it be done on the front end with open layers?

  • Are you doing some on-the-fly processing for your source files.with your .vrt file? Should GetFeatureInfo return the raw pixel values or processed ones? – user30184 Aug 15 '19 at 5:44
  • 2
    You can get the pixel value of a layer in OpenLayers (even if the layer is hidden beneath another). This demo jsfiddle.net/28r541b3 uses mouse position but for a specific coordinate get the pixel using map.getPixelFromCoordinate() – Mike Aug 15 '19 at 9:02
  • Thank you, I will try this out and let you know. – Christian4423 Aug 15 '19 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.