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

Content Dependent Legend Rendering Tracking (RFC 101) #4713

Closed
wants to merge 9 commits into from
Closed

Content Dependent Legend Rendering Tracking (RFC 101) #4713

wants to merge 9 commits into from

Conversation

tbonfort
Copy link
Member

@tbonfort tbonfort commented Jul 24, 2013

Track development around rfc101: http://mapserver.org/development/rfc/ms-rfc-101.html

@ghost ghost assigned tbonfort Jul 24, 2013
tbonfort added a commit to MapServer/msautotest_DEPRECATED that referenced this pull request Jul 25, 2013
tbonfort added a commit to MapServer/msautotest_DEPRECATED that referenced this pull request Jul 26, 2013
tbonfort added a commit that referenced this pull request Jul 26, 2013
adds cgi modes maplegend and maplegendicon
allow changing legend label by url
@tbonfort
Copy link
Member Author

tbonfort commented Jul 27, 2013

rebased and applied in 471cdf4, closing

@tbonfort tbonfort closed this Jul 27, 2013
@tbonfort tbonfort deleted the getlegendgrahic-content-dependant branch Jul 27, 2013
@tmcw
Copy link

tmcw commented Sep 2, 2013

(in this usage, isn't it dependent, not dependant?)

@tbonfort
Copy link
Member Author

tbonfort commented Sep 2, 2013

@tmcw, yet another reason to us US english only :) - fixed, thanks

@luca76
Copy link

luca76 commented Dec 2, 2014

Sorry for writing here. The CGI mode MAPLEGEND isn't documented, but as I have understand, it should return content based HTML template legend. But If I use:

http://local/cgi-bin/mapserv?map=map.map&mode=maplegend&MAPEXT=X1 Y1 X2 Y2&SRS=EPSG:25832

it always returns a empty legend... am I missing some other parameter?

@ruhri
Copy link

ruhri commented Dec 16, 2015

@tbonfort
Copy link
Member Author

tbonfort commented Jan 4, 2016

@ruhri can you provide a gdb backtrace of the crash, or a complete testcase that would allow me to reproduce this

@ruhri
Copy link

ruhri commented Jan 6, 2016

Hi tbonfort, thank you for your efforts.
Further investigation becomes more strange:
I like to use "Named group layers" as stated in http://mapserver.org/development/rfc/ms-rfc-75.html#named-group-layers.
mapfile-example: https://svn.osgeo.org/mapserver/sandbox/inspire_soc2011/msautotest/wxs/wms_inspire.map

my personal simplified case -which leads to the above posted segfault problem - is the following layer structure (it shows public transportation lines...):

# Gruppenlayer: ÖPNV
LAYER
    NAME "oepnv"
    METADATA
        "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"
        "ows_abstract"                          "Ebene ÖPNV"
    END
    TYPE POINT
END

# Layer: ÖPNV-Liniennetz
LAYER
    NAME "oepnv_linien"
    DATA "/data/spw/spw_web/oepnv/linien"

    METADATA
        "wms_enable_request"                    "*"
        "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"
        "wms_layer_group"                       "/oepnv"
        "ows_title"                             "ÖPNV-Liniennetz"
        "ows_abstract"                          "Ebene ÖPNV-Liniennetz"
        "gml_featureid"                         "gid"
        "gml_include_items"                     "all"
        "gml_geometries"                        "geom"
        "gml_geom_type"                         "multiline"
        "gml_verkehrsm_alias"                   "verkehrsmittel"
    END

    TYPE LINE

    PROJECTION
        "init=epsg:25832"
    END

    MAXSCALEDENOM 501000
    MINSCALEDENOM 1

    UNITS METERS
    CLASSITEM 'verkehrsm'
    CLASS
        NAME "Bus"
        EXPRESSION 'Bus'
        STYLE
            WIDTH 1.5
            COLOR 0 170 50
            OUTLINECOLOR 255 255 255
            OUTLINEWIDTH 0.5
            LINEJOIN ROUND
        END
    END
    CLASS
        NAME "Straßenbahn"
        EXPRESSION 'Straßenbahn'
        STYLE
            WIDTH 2.2
            COLOR 204 0 0
            OUTLINECOLOR 255 255 255
            OUTLINEWIDTH 0.7
            LINEJOIN ROUND
        END
    END
    CLASS
        NAME "Stadtbahn"
        EXPRESSION 'Stadtbahn'
        STYLE
            WIDTH 3.0
            COLOR 21 106 184
            OUTLINECOLOR 255 255 255
            OUTLINEWIDTH 1
            LINEJOIN ROUND
        END
    END
    CLASS
        NAME "U-Bahn"
        EXPRESSION 'U-Bahn'
        STYLE
            WIDTH 3.0
            COLOR 21 106 184
            OUTLINECOLOR 255 255 255
            OUTLINEWIDTH 1
            LINEJOIN ROUND
        END
    END
END

MAPFILE VERSION2:
if I just move the named group below it's sublayer in the mapfile (the only change!!!), the content dependent legend works well now:

# Layer: ÖPNV-Liniennetz
LAYER
    NAME "oepnv_linien"
    DATA "/data/spw/spw_web/oepnv/linien"

    METADATA
        "wms_enable_request"                    "*"
        "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"
        "wms_layer_group"                       "/oepnv"
        "ows_title"                             "ÖPNV-Liniennetz"
        "ows_abstract"                          "Ebene ÖPNV-Liniennetz"
        "gml_featureid"                         "gid"
        "gml_include_items"                     "all"
        "gml_geometries"                        "geom"
        "gml_geom_type"                         "multiline"
        "gml_verkehrsm_alias"                   "verkehrsmittel"
    END

    TYPE LINE

    PROJECTION
        "init=epsg:25832"
    END

    MAXSCALEDENOM 501000
    MINSCALEDENOM 1

    UNITS METERS
    CLASSITEM 'verkehrsm'
    CLASS
        NAME "Bus"
        EXPRESSION 'Bus'
        STYLE
            WIDTH 1.5
            COLOR 0 170 50
            OUTLINECOLOR 255 255 255
            OUTLINEWIDTH 0.5
            LINEJOIN ROUND
        END
    END
    CLASS
        NAME "Straßenbahn"
        EXPRESSION 'Straßenbahn'
        STYLE
            WIDTH 2.2
            COLOR 204 0 0
            OUTLINECOLOR 255 255 255
            OUTLINEWIDTH 0.7
            LINEJOIN ROUND
        END
    END
    CLASS
        NAME "Stadtbahn"
        EXPRESSION 'Stadtbahn'
        STYLE
            WIDTH 3.0
            COLOR 21 106 184
            OUTLINECOLOR 255 255 255
            OUTLINEWIDTH 1
            LINEJOIN ROUND
        END
    END
    CLASS
        NAME "U-Bahn"
        EXPRESSION 'U-Bahn'
        STYLE
            WIDTH 3.0
            COLOR 21 106 184
            OUTLINECOLOR 255 255 255
            OUTLINEWIDTH 1
            LINEJOIN ROUND
        END
    END
END

# Gruppenlayer: ÖPNV
LAYER
    NAME "oepnv"
    METADATA
        "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"
        "ows_abstract"                          "Ebene ÖPNV"
    END
    TYPE POINT
END

second strange thing:
If I duplicate the "public transportation lines"-layer in the same mapfile (MAPFILE VERSION 2) and change it's name to "NAME "oepnv_linien2" I have a second layer in my service - from that point nothing magic. standard-getlegend against that layer also works well; content dependent legend doesn't produce an error, but just shows the labels in the legend and NOT the legendsymbols... ???
This also happens, if I remove the the group-structure (delete named group layer "oepnv" and "wms_layer_group" keywords from the other layers completely).

default legend:
spw_web2

content dependent legend (MAPFILE VERSION 2):
spw_web3

content dependent legend - oepnv_linien2 (added to MAPFILE VERSION 2):
spw_web4

@tbonfort
Copy link
Member Author

tbonfort commented Jan 6, 2016

can you (privately) send me the data + full mapfile to reproduce this locally please

@ruhri
Copy link

ruhri commented Jan 6, 2016

Hi Thomas,
send it to 'thomas.bonfort@gmail.com'

@tbonfort
Copy link
Member Author

tbonfort commented Jan 6, 2016

@ruhri can you try with d02e6fb (applied to branch-7-0)

@ruhri
Copy link

ruhri commented Jan 6, 2016

works well in my scenario, now!!!

THUMBS UP

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

Successfully merging this pull request may close these issues.

None yet

4 participants