Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segfault with getfeatureinfo or wfs access on clustered layer! #5219

Closed
ruhri opened this issue Jan 6, 2016 · 11 comments
Closed

segfault with getfeatureinfo or wfs access on clustered layer! #5219

ruhri opened this issue Jan 6, 2016 · 11 comments

Comments

@ruhri
Copy link

ruhri commented Jan 6, 2016

GetMap against a service /layer with clustering works, GetFeatureInfo produces a segfault (tested locally on the server), WFS-Requests also produce segfaults...
Datasource is PostGIS, the layer looks similar to the example in http://mapserver.org/mapfile/cluster.html , but is simpler.

my MAPFILE (connection was xxx'ed):

# Layer: ÖPNV-Haltestellen
LAYER
    NAME "oepnv_haltestellen"
    CONNECTIONTYPE POSTGIS
    CONNECTION "xxx"
    PROCESSING "CLOSE_CONNECTION=DEFER"
    DATA "geom FROM (SELECT id, geom, stop_nr, stop_name, kommune FROM oepnv_data_ds.oepnv_haltestellen_tb) AS subquery USING UNIQUE id USING srid=25832"

    METADATA
        "wms_enable_request"                    "*"
        "ows_srs"                               "EPSG:25832 EPSG:25833 EPSG:3857 EPSG:4258 EPSG:4326 EPSG:31466 EPSG:31467 EPSG:31468 EPSG:31469 EPSG:900913"
        "ows_extent"                            "300000.0 5620000.0 440000.0 5770000.0"
        "ows_title"                             "ÖPNV-Haltestellen"
        "ows_abstract"                          "Ebene ÖPNV-Haltestellen"

        "wfs_enable_request"                    "*"
        "wfs_getfeature_formatlist"             "gml2,gml3,shapezip,csv,geojson,gpx"
        "gml_featureid"                         "id"
        "gml_include_items"                     "all"
        "gml_geometries"                        "geom"
        "gml_geom_type"                         "point"
    END

    HEADER "./html/query-header.html"
    TEMPLATE "./html/haltestelle.html"
    FOOTER "./html/query-footer.html"

    UNITS PIXELS
    TOLERANCE 50

    TYPE POINT

    PROJECTION
        "init=epsg:25832"
    END

    MINSCALEDENOM 1
    MAXSCALEDENOM 501000

    CLUSTER
        MAXDISTANCE 50
        REGION "ellipse"
    END

    CLASS
        NAME "Haltestelle"
        STYLE
            SYMBOL "haltestelle"
            SIZE 14
        END
        KEYIMAGE "./haltestelle.png"
    END
END

Turning clustering off, featureinfo and wfs do work well.

MAPFILE-VARIANT (moving Featureinfo/WFS to another hidden grouped layer), it works too, :

# Layer: ÖPNV-Haltestellen
LAYER
    NAME "oepnv_haltestellen"
    CONNECTIONTYPE POSTGIS
    CONNECTION "xxx"
    PROCESSING "CLOSE_CONNECTION=DEFER"
    DATA "geom FROM (SELECT id, geom, stop_nr, stop_name, kommune FROM oepnv_data_ds.oepnv_haltestellen_tb) AS subquery USING UNIQUE id USING srid=25832"

    METADATA
        "wms_enable_request"                    "!GetFeatureInfo"
        "ows_srs"                               "EPSG:25832 EPSG:25833 EPSG:3857 EPSG:4258 EPSG:4326 EPSG:31466 EPSG:31467 EPSG:31468 EPSG:31469 EPSG:900913"
        "ows_extent"                            "300000.0 5620000.0 440000.0 5770000.0"
        "wms_layer_group"                       "/oepnv"
        "ows_title"                             "ÖPNV-Haltestellen"
        "ows_abstract"                          "Ebene ÖPNV-Haltestellen"
    END

    TEMPLATE "./html/fooOnlyForWMSGetFeatureInfo.html"

    TYPE POINT

    PROJECTION
        "init=epsg:25832"
    END

    MINSCALEDENOM 1
    MAXSCALEDENOM 501000

    CLUSTER
        MAXDISTANCE 50
        REGION "ellipse"
    END

    CLASS
        NAME "Haltestelle"
        STYLE
            SYMBOL "haltestelle"
            SIZE 14
        END
        KEYIMAGE "/home/geoadmin/mapserver/symbols/haltestelle.png"
    END
END

# versteckter Layer: ÖPNV-Haltestellen (WFS, GetFeatureInfo) gruppiert mit ÖPNV-Haltestellen
LAYER
    NAME "oepnv_haltestellen_wfs"
    GROUP "oepnv_haltestellen"
    CONNECTIONTYPE POSTGIS
    CONNECTION "xxx'"
    PROCESSING "CLOSE_CONNECTION=DEFER"
    DATA "geom FROM (SELECT id, geom, stop_nr, stop_name, kommune FROM oepnv_data_ds.oepnv_haltestellen_tb) AS subquery USING UNIQUE id USING srid=25832"

    METADATA
        "wms_enable_request"                    "!GetCapabilities !GetMap !GetLegendGraphic"
        "wfs_enable_request"                    "*"
        "wfs_getfeature_formatlist"             "gml2,gml3,shapezip,csv,geojson,gpx"
        "ows_srs"                               "EPSG:25832 EPSG:25833 EPSG:3857 EPSG:4258 EPSG:4326 EPSG:31466 EPSG:31467 EPSG:31468 EPSG:31469 EPSG:900913"
        "ows_extent"                            "300000.0 5620000.0 440000.0 5770000.0"
        "ows_title"                             "ÖPNV-Haltestellen"
        "ows_abstract"                          "Ebene ÖPNV-Haltestellen (Basisdaten)"
        "gml_featureid"                         "id"
        "gml_include_items"                     "all"
        "gml_geometries"                        "geom"
        "gml_geom_type"                         "point"
    END

    HEADER "./html/query-header.html"
    TEMPLATE "./html/haltestelle.html"
    FOOTER "./html/query-footer.html"

    TYPE POINT
    MASK "maske"

    PROJECTION
        "init=epsg:25832"
    END

    MINSCALEDENOM 1
    MAXSCALEDENOM 501000

    UNITS PIXELS
    TOLERANCE 50
END
@tbonfort
Copy link
Member

tbonfort commented Jan 6, 2016

very probably a duplicate of #5205

@gsueur
Copy link

gsueur commented Jun 9, 2016

Hi,
Not sure it's a duplicate. I ran into this problem with a clustered layer. WFS mode requests always send a segfault, despite my tonight update to the current 7.0 branch.

@tbonfort
Copy link
Member

tbonfort commented Jun 9, 2016

@gsueur please provide a backtrace and reopen

@ruhri
Copy link
Author

ruhri commented Jun 10, 2016

Hi gsueur,
I can't confirm your observations with the latest build from branch (two days ago) in my scenario.
The error decribed above was solved with the last commits from May, the FeatureInfo and WFS on clustered layers don't throw segfaults anymore.

@m431m
Copy link

m431m commented Jun 10, 2016

Hi,

No segfault but... a GetFeature request returns this warning:

<!-- WARNING: FeatureId item 'id' not found in typename ...

Removes 'CLUSTER' and it normally works.

@ruhri
Copy link
Author

ruhri commented Jun 10, 2016

You are right, I was to fast...
Now there seems to be something screwed up:
clustering on getmap works fine,
getfeatureinfo also "works",
wfs technically also works, but no id and the content is geometrically screwed up, it's not the original dataset nor is it the clustered dataset I see in FeatureInfo...
Moreover using (PROCESSING "CLUSTER_GET_ALL_SHAPES=ON") doesn't help with wfs...
With this Processing Option enabled, getFeatureInfo result in my opinion makes no sense anymore. The result on a clustered Point (based on three different points) throws 3 objects with same geometry and cluster-attrbutes - I would have expected the original geometries and attributes...

@yjacolin
Copy link
Contributor

Hello, we get similar segfault with a clustered layer with WMS-T. We will try to test the last master release.

@gsueur
Copy link

gsueur commented Jun 10, 2016

I confirm m431m remark. My yesterday's install was screwed up, the system was still using the older lib. But with a clean install of 7.0 branch, I don't segfault anymore but the request's result is not correct. Only one record is returned and mapserver complains about the lack of gid.

@tbonfort
Copy link
Member

The segfault reported in this ticket has been fixed, please open a new issue for this failure (and add @szekerest in cc)

@ruhri
Copy link
Author

ruhri commented Jun 10, 2016

@szekerest
After some further testing and reading mailing lists some notes:

The Processing Options “CLUSTER_GET_ALL_SHAPES” only works as KVP. So adding an equal sign plus anything does it (i.e. “=ON”, also =OFF works ;-) ) this should be documented.
Adding processing ITEMS gives the base attributes for each clustered Feature and their ids.
Example for my mapfile (first post on top):

PROCESSING "CLUSTER_GET_ALL_SHAPES=ON"
PROCESSING "ITEMS=id,stop_nr,stop_name,kommune"

--> This does it finally - draw a clustered map and after featureinfo'ing such a clustered point list all underlying Features and their attributes.
--> It should be documented, that GetFeatureInfo on clustered layers with the Goal to list all base-features needs PROCESSING "CLUSTER_GET_ALL_SHAPES=ON" and also PROCESSING "ITEMS=xxx" in order to work well.

The Processing Options
“CLUSTER_KEEP_LOCATIONS”
and
“CLUSTER_USE_MAP_UNITS”

are not documented - it would be nice, if this could also be done.

@jmckenna
Copy link
Member

@ruhri please file a documentation ticket (in https://github.com/mapserver/docs/issues) describing all of the changes that you need, and I'll tackle them. The more detailed you make the ticket (with examples) the easier and faster it will be done. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants