[MapServer-users] Wrong and inconsistent GetFeatureInfo result for CLUSTER layer

Bob Basques bbasques at sharedgeo.org
Thu Feb 20 07:48:33 PST 2025


This might not be an approach that will get you exactly what you are
looking for, but have you thought about using two different layers, one for
queries and one for display, or maybe you are looking for some sort of
cluster based results back?  I don't have a lot of experience with CLUSTERs
myself.

bobb



On Fri, Feb 14, 2025 at 7:51 AM Guldberg, Erik via MapServer-users <
mapserver-users at lists.osgeo.org> wrote:

> Hi,
>
> I have a WMS service, https://kart.ra.no/wms/brukerminner, where I have
> problems getting correct getFeatureInfo results from a layer with CLUSTER
> content.
>
>
>
> It contains the cluster layer and a regular point layer for the same data.
> The regular point layer is shown at 1:50 000.
>
>
>
> For single objects in both the cluster layer, I want to be able to use
> getFeatureInfo. This works, but the problem is that the results most of the
> time are wrong, and that they change for time to time, likely due to change
> in zoom level. For the regular point layer, the result is always correct.
> I've also created a test cluster layer without the scale limit, and that
> also gives the correct result if I zoom in enough.
>
>
>
> All the symbols are placed correctly in the map, for all layers. I've used
> the database, and also this OGC API service (that uses the same data source
> as the WMS) as a reference: https://api.ra.no/brukerminner
>
>
>
> I'm using MapServer version 7.6.4.
>
>
>
> Some example queries, using QGIS.
>
> Wrong result. The object I get in the getfeatureinfo is 64 km away from
> where I clicked.
>
>
> https://kart.ra.no/wms/brukerminner?language=nor&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&BBOX=760392.02671199827454984%2C8263040.88853696268051863%2C1033357.36004533339291811%2C8407916.1385369636118412&CRS=EPSG%3A3857&WIDTH=1984&HEIGHT=1053&LAYERS=Brukerminner&STYLES=&FORMAT=image%2Fpng&QUERY_LAYERS=Brukerminner&INFO_FORMAT=text%2Fhtml&I=1069&J=616&FEATURE_COUNT=10
>
>
>
> Zoomed in a bit more gives another, wrong result. This is 8.7 km away from
> where I clicked:
>
>
> https://kart.ra.no/wms/brukerminner?language=nor&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&BBOX=871972.11004533257801086%2C8307721.07603696547448635%2C940213.44337866583373398%2C8343939.88853696547448635&CRS=EPSG%3A3857&WIDTH=1984&HEIGHT=1053&LAYERS=Brukerminner&STYLES=&FORMAT=image%2Fpng&QUERY_LAYERS=Brukerminner&INFO_FORMAT=text%2Fhtml&I=1022&J=627&FEATURE_COUNT=10
>
>
>
> This is the Test-layer, how it looks now. I've tried different variations
> of PROCESSING settings.
>
>
>
> LAYER
>
>                 NAME "TEST"
>
>                 DEBUG 5
>
>                 TYPE POINT
>
>                 STATUS ON
>
>                 TEMPLATE "../templates/brukerminner.html"
>
>                 HEADER "../templates/header.html"
>
>                 FOOTER "../templates/footer.html"
>
>     TOLERANCEUNITS pixels
>
>                 TOLERANCE 25
>
>     # MINSCALEDENOM 50000
>
>                 METADATA
>
>                                "wms_enable_request" "*"
>
>         "wms_include_items" "tittel"
>
>
>
>         "wms_title" "TEST"
>
>                                "wms_feature_info_mime_type" "text/html"
>
>
>
> END
>
> PROJECTION
>
>                 "init=epsg:4326"
>
> END
>
>
>
> EXTENT -19.76 54.57 45.57 82.67  #4326
>
> PROCESSING "CLOSE_CONNECTION=DEFER"
>
>
>
> CONNECTIONTYPE POSTGIS
>
> CONNECTION "host=host  dbname=db user=user password=password port=5432"
>
> DATA "geom from xx.xx using unique id using srid=4326"
>
>
>
>
>
> LABELITEM "Cluster_FeatureCount"
>
>
>
> # PROCESSING "CLUSTER_ALGORITHM=SIMPLE"
>
> PROCESSING "CLUSTER_GET_ALL_SHAPES=ON"
>
> PROCESSING
> "ITEMS=tittel,beskrivelse,fylke,kommune,opprettet,endret,opprettet_av,linkkulturminnesok,gpsposisjon"
>
> # PROCESSING "CLUSTER_KEEP_LOCATIONS=ON"
>
> CLUSTER
>
> MAXDISTANCE 50
>
>
>
> REGION "ellipse"
>
> END
>
>
>
> CLASS
>
>                 NAME "Brukerminne"
>
>     EXPRESSION ("[Cluster_FeatureCount]" = "1")
>
>                 STYLE
>
>                                SYMBOL "brukerminne"
>
>         COLOR 200 0 0
>
>                                SIZE 27
>
>         OFFSET 0 -13.5
>
>                 END
>
> END
>
> END
>
>
>
>
>
> Anyone with ideas on what's wrong?
>
>
>
>
>
> Thanks,
>
> Erik
>
>
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>


-- 
Bob Basques
bbasques at sharedgeo.org
612.598.9210
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20250220/f8da0e45/attachment.htm>


More information about the MapServer-users mailing list