[mapserver-users] Point query from Mapserver raster

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Tue Nov 2 08:31:21 PDT 2021


Hi,

(Had to clip some text from the bottom because of the size limit of this list)

You do not seem to do anything wrong. Your WMS 1.3.0 EPSG:4326 lat-long BBOX=42.94,-122.09,42.95,-122.08& gets converted into long-lat order and for some reason the lower and higher values are equal {-122.082500,42.942500,-122.082500,42.942500}, thus this is no more a box but a point.
GetFeatureInfo with a small bbox and width=2 and height=2 is a trick that is certainly not heavily tested because the corresponding GetMap is pretty odd despite being valid.  Maybe using slightly bigger BBOX makes Mapserver to query the backend raster with a rectangle instead of a point.
BTW X=1 and Y=1 are not valid in WMS 1.3.0, you are supposed to use i= and j= instead. That makes me think that maybe you could have a try with a full and valid WMS 1.1.0 GetFeatureInfo request with SRS= and BBOX in long-lat order and see if it has any effect on the msProjectRect()

-Jukka Rahkonen-

Lähettäjä: MapServer-users <mapserver-users-bounces at lists.osgeo.org<mailto:mapserver-users-bounces at lists.osgeo.org>> Puolesta Carl Godkin
Lähetetty: tiistai 2. marraskuuta 2021 17.06
Vastaanottaja: mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
Aihe: Re: [mapserver-users] Point query from Mapserver raster

Hi,

Following Jukka's advice on my elevation point query, I am trying to use WMS GetFeatureInfo,

I've mostly got it working but have a few more questions.  (I am using MS4W 4.0.5 which includes MapServer 7.7.0)

I added a LAYER to my WMS map file:

  LAYER
    PROCESSING "RESAMPLE=BILINEAR"
    NAME SRTM_3_arc-second_grid
    METADATA
      "wms_title"           "SRTM - 3 arc-second grid"
      "ows_extent"          "-125 24 -66 50"
      "wms_include_items"   "all"
    END

    TYPE RASTER
    STATUS ON
    TILEINDEX "srtm_3_hgt-index.shp"
    TILEITEM "Location"
    TEMPLATE "../template.html"
    PROJECTION
      "init=epsg:4326"
    END
  END

and an empty template except for the

<!-- MapServer Template -->

line.  Here's my query:

http://localhost:8080/wms?
  SERVICE=WMS&
  VERSION=1.3.0&
  REQUEST=GetFeatureInfo&
  LAYERS=SRTM_3_arc-second_grid&
  CRS=EPSG:4326&
  BBOX=42.94,-122.09,42.95,-122.08&
  WIDTH=2&
  HEIGHT=2&
  X=1&
  Y=1&
  QUERY_LAYERS=SRTM_3_arc-second_grid

This works fine and returns the elevation I am expecting.  However, the MapServer log complains about a "degenerate rect" every time:

[Tue Nov  2 07:58:44 2021].66000 msProjectRect(): Warning: degenerate rect {-122.082500,42.942500,-122.082500,42.942500}

What am I doing wrong here?   As I posted originally, I am really only interested in a point here.

Thank you very much,

carl

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20211102/a748e2df/attachment-0001.html>


More information about the MapServer-users mailing list