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

Unable to pass FEATURE ITEMS from URL #5335

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
@tbonfort
Member

tbonfort commented Oct 12, 2016

We tried to pass a FEATURE via a URL parameter. This works perfectly for attributes WKT and TEXT of the FEATURE.
It doesn't seem to work for attribute ITEMS.

Example:

Layer definition in Mapfile:

LAYER
    NAME testLayer
    TYPE polygon
    STATUS on
    METADATA
       WMS_TITLE "TestLayer"
       WMS_SRS "EPSG:31468"
    END
    PROCESSING "ITEMS=zaehljahr"
    CLASSITEM "zaehljahr"
    CLASS
      EXPRESSION '0'
      NAME "0"
      STYLE
        OPACITY 60
    COLOR 0 255 0
    ANTIALIAS FALSE
      END
      TEXT "[zaehljahr]"
      LABEL
        TYPE truetype
        COLOR 255 255 255
        FONT arial
        SIZE 12
        ANTIALIAS false
        POSITION lc
        PARTIALS false
        BUFFER 0
      END
    END
    CLASS
      EXPRESSION '1'
      NAME "1"
      STYLE
        OPACITY 60
    COLOR 0 221 0
    ANTIALIAS FALSE
      END
      TEXT "[zaehljahr]"
      LABEL
        TYPE truetype
        COLOR 255 255 255
        FONT arial
        SIZE 12
        ANTIALIAS false
        POSITION lc
        PARTIALS false
        BUFFER 0
      END
    END
END

Request-URL:
http://localhost/cgi-bin/mapserv.fcgi?map=test.map&VERSION=1.1.1&LAYERS=testLayer&BBOX=4548756.4916980425,5451024.760221503,4548993.064391087,5451261.332914547&WIDTH=300&HEIGHT=300&SRS=EPSG:31468&FORMAT=image/png&STYLES=&TRANSPARENT=FALSE&SERVICE=WMS&REQUEST=GetMap&map.layer[testLayer]=FEATURE WKT "MULTIPOLYGON (((4548889.74 5451201.12, 4548897.895232 5451196.8590681, 4548903.707732 5451211.3590681, 4548925.645232 5451208.3590681, 4548919.020232 5451190.1715681, 4548932.21 5451186.42, 4548903.68 5451193.28, 4548889.74 5451201.12)))" ITEMS "1" END

Error-Message:

loadfeature(): Unknown identifier. Parsing error near (ITEMS):(line 1)

Thanks for looking into this.

@tbonfort

This comment has been minimized.

Show comment
Hide comment
@tbonfort

tbonfort Oct 12, 2016

Member

what mapserver version?

Member

tbonfort commented Oct 12, 2016

what mapserver version?

@itt-de

This comment has been minimized.

Show comment
Hide comment
@itt-de

itt-de Oct 12, 2016

We tried version 7.0.1 and 6.4.1 with the same result.

itt-de commented Oct 12, 2016

We tried version 7.0.1 and 6.4.1 with the same result.

@tbonfort

This comment has been minimized.

Show comment
Hide comment
@tbonfort

tbonfort Oct 12, 2016

Member

Attached patch should resolve the issue. Please confirm.

Member

tbonfort commented Oct 12, 2016

Attached patch should resolve the issue. Please confirm.

@sdlime

This comment has been minimized.

Show comment
Hide comment
@sdlime

sdlime Oct 12, 2016

Member

Since this input is so arbitrary I think we need to also update mapfile.c around line 950 to require a validation entry so it's not enabled by default. --Steve

Member

sdlime commented Oct 12, 2016

Since this input is so arbitrary I think we need to also update mapfile.c around line 950 to require a validation entry so it's not enabled by default. --Steve

@sdlime sdlime closed this Oct 12, 2016

@sdlime sdlime reopened this Oct 12, 2016

@tbonfort

This comment has been minimized.

Show comment
Hide comment
@tbonfort

tbonfort Oct 12, 2016

Member

@sdlime validation should be for whole FEATURE, not just ITEMS? (I mean, changing/setting the geometry is just as dangerous as changing just the items)

Member

tbonfort commented Oct 12, 2016

@sdlime validation should be for whole FEATURE, not just ITEMS? (I mean, changing/setting the geometry is just as dangerous as changing just the items)

@sdlime

This comment has been minimized.

Show comment
Hide comment
@sdlime

sdlime Oct 12, 2016

Member

You can't change anything about a feature and can only add them. Anyway, the the parser for the geometry portion of a feature already does specific validation (e.g. is a value a number or valid WKT), I'd think that's sufficient.

Member

sdlime commented Oct 12, 2016

You can't change anything about a feature and can only add them. Anyway, the the parser for the geometry portion of a feature already does specific validation (e.g. is a value a number or valid WKT), I'd think that's sufficient.

@itt-de

This comment has been minimized.

Show comment
Hide comment
@itt-de

itt-de Oct 13, 2016

Many thanks for the fast fix. Unfortunately I don't have any build-infrastructure, so I cant't confirm until the next official release. We will certainly make good use of this in future.

itt-de commented Oct 13, 2016

Many thanks for the fast fix. Unfortunately I don't have any build-infrastructure, so I cant't confirm until the next official release. We will certainly make good use of this in future.

tbonfort added a commit that referenced this pull request Dec 5, 2016

@tbonfort

This comment has been minimized.

Show comment
Hide comment
@tbonfort

tbonfort Dec 5, 2016

Member

applied to branch-7-0 in 93cc1ed

Member

tbonfort commented Dec 5, 2016

applied to branch-7-0 in 93cc1ed

@tbonfort tbonfort closed this Dec 5, 2016

@tbonfort tbonfort deleted the tbonfort:issues/5335-items-by-url branch Dec 5, 2016

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