rouault · GitHub

@rouault

…their symbols
Currently, when MapServer receives a WMS GetFeatureInfo request on a point layer, it queries the
vector data source on a square centered on the value of the X and Y parameters of the query
(converted from image pixels to the layer coordinate reference system), with a radius expressed in
the LAYER.TOLERANCE MapFile parameter (or its default values if not specified). This behavior
works fine as long as symbols used to represent the point are of square shape, and with the symbol
being centered on the point. When the symbol is of rectangular shape and/or with a anchor point far
from its center, users may get unexpected results (false positives and false negatives) when clicking
on features on the map.
This PR adds a new IDENTIFY block under LAYER that can be set to
```
  IDENTIFY
      CLASSAUTO
  END
```
to use the symbols from the style classes of the incoming WMS GFI request
or
```
  IDENTIFY
      CLASSGROUP "name_of_class_group"
  END
```
to use a precise style group when identifying point symbols.
Identification takes into account potential transparency in the symbol.
The existing TOLERANCE and TOLERANCEUNITS are taken into account. Note
that for clarity of the mapfile, it is possible to move them under the IDENTIFY
block.
This also works with mode=query requests:
e.g:
```
mapserv -conf ../etc/mapserv.conf QUERY_STRING="MAP=point_symbol_identification.map&mode=query&layer=test_classgroup&qlayer=test_classgroup&imgxy=73+62&imgext=1000+2000+1400+2300&imgsize=200+150"
```
Note: this enhancement is currently restricted to POINT layers.

Read the original on github.com ↗