WMS GetFeatureInfo: add options to precisely identify points through their symbols#7318
Conversation
0dbfa60 to
fe73abe
Compare
|
Feels like a good improvement. |
fe73abe to
3654302
Compare
yes, I've added tests for that. That was already checked by the original msQueryByPoint() function
Hard to answer 100% positive to that given identification and rendering are two different code paths. Checking further I saw that the identification code could potentially return non-drawn feature because of expression evaluation, when using a non-template code path. I've improved that. |
|
@sdlime @geographika Any thought on the proposed mapfile syntax ? |
|
Very nice improvement! Are there any other settings planned for an Question on the |
not yet, but for example I can imagine we could tweak identification to accept transparent pixels inside the symbol. Having a new block seemed cleaner to me than a processing option
I can imagine someone could create a symbol that is larger than the displayed one for the purpose of easier clicking |
|
As I understand it, OGC Maps API has no equivalent for The disadvantage of a new |
I'm not sure to follow you. This identification is really tied to map rendering and styling. That cannot be cleanly emulated using OGC API Features (or WFS). What would be the advantage of moving under METADATA wms_ keywords ? That isn't really metadata.
will do
ah yes, will do |
As I understand it, the functionality in this PR can only ever be used as part of a WMS |
I see your point. Obviously it could. That said maybe some day there will some kind of GetFeatureInfo for OGC API maps. Anyway I'm going to bring that to the mailing list |
24520b6 to
fb4a478
Compare
|
PR updated to:
|
|
documentation added in MapServer/MapServer-documentation#1035 |
fb4a478 to
3412e66
Compare
…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.
3412e66 to
b8f298d
Compare
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
to use the symbols from the style classes of the incoming WMS GFI request
or
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:
Note: this enhancement is currently restricted to POINT layers.