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

A layer is not hide-able when it is in a wms_layer_group #4533

Closed
aperi2007 opened this Issue Nov 29, 2012 · 14 comments

Comments

Projects
None yet
4 participants
@aperi2007

I notice that the option
"wms_enable_request" "!*"
to hide a layer from the GetCapabilities responsework only when a layer is not grouped using the option
"wms_layer_group"

Googling I find also this old ticket:
http://trac.osgeo.org/mapserver/ticket/3931

AFAIK this ticket say that the issue was resolved for the GROUP option but never for the wms_layer_group.

I test this on the mapserver 6.3-svn and actually the issue is still open.

If a layer is on a named group with the wms_layer_group option it is not hidden-able using the
"wms_enable_request" "!*"
option.

@Schpidi

This comment has been minimized.

Show comment
Hide comment
@Schpidi

Schpidi Jan 3, 2013

Member

This should have been covered with these tests but apparently I've overlooked this specific case. Thanks for reporting, I'll have a look.

FYI the referenced ticket is now here: #3931

Member

Schpidi commented Jan 3, 2013

This should have been covered with these tests but apparently I've overlooked this specific case. Thanks for reporting, I'll have a look.

FYI the referenced ticket is now here: #3931

@aperi2007

This comment has been minimized.

Show comment
Hide comment
@aperi2007

aperi2007 Feb 6, 2013

Hi,

Can you confirm this bug ?

Hi,

Can you confirm this bug ?

@Schpidi

This comment has been minimized.

Show comment
Hide comment
@Schpidi

Schpidi Feb 6, 2013

Member

Hi,

yes, I had an initial look at it but it turned out to be more involved. I hope to find some time soon.

Member

Schpidi commented Feb 6, 2013

Hi,

yes, I had an initial look at it but it turned out to be more involved. I hope to find some time soon.

@ghost ghost assigned szekerest Mar 3, 2013

@szekerest

This comment has been minimized.

Show comment
Hide comment
@szekerest

szekerest Mar 3, 2013

Member

Issue is now fixed in master and branch-6-2

Member

szekerest commented Mar 3, 2013

Issue is now fixed in master and branch-6-2

@szekerest

This comment has been minimized.

Show comment
Hide comment
@szekerest

szekerest Mar 3, 2013

Member

This change requires to update ows_wms_capabilities.xml in msautotest.

Member

szekerest commented Mar 3, 2013

This change requires to update ows_wms_capabilities.xml in msautotest.

@aperi2007

This comment has been minimized.

Show comment
Hide comment
@aperi2007

aperi2007 Mar 3, 2013

I check the change.
Apply-ing a
"wms_enable_request" "!GetCapabilities"
to a layer on a group defined with the
wms_group_layer
will produce an error in the XML returned from a getcapabilities.

This is the error returned as seem from a browser.

XML Parsing Error: mismatched tag. Expected: .
Location: http://localhost/wmsraster/com.rt.wms.RTmap/wms?map=wmsofc&SERVICE=WMS&REQUEST=GetCapabilities
Line Number 1879, Column 5:

I check the XML returned comparing it with the xml it will return if not apply the !getCapabilites.

I notice it apply always the same number of

     </Layer>
    </Layer>
  </Layer>
</Layer>

Instead when the !getCapabilities is applied it should remove a for every !getCapabilites
applied.

Andrea.

I check the change.
Apply-ing a
"wms_enable_request" "!GetCapabilities"
to a layer on a group defined with the
wms_group_layer
will produce an error in the XML returned from a getcapabilities.

This is the error returned as seem from a browser.

XML Parsing Error: mismatched tag. Expected: .
Location: http://localhost/wmsraster/com.rt.wms.RTmap/wms?map=wmsofc&SERVICE=WMS&REQUEST=GetCapabilities
Line Number 1879, Column 5:

I check the XML returned comparing it with the xml it will return if not apply the !getCapabilites.

I notice it apply always the same number of

     </Layer>
    </Layer>
  </Layer>
</Layer>

Instead when the !getCapabilities is applied it should remove a for every !getCapabilites
applied.

Andrea.

@szekerest

This comment has been minimized.

Show comment
Hide comment
@szekerest

szekerest Mar 3, 2013

Member

Could you provide a sample map file to be able to reproduce the same issue?

Member

szekerest commented Mar 3, 2013

Could you provide a sample map file to be able to reproduce the same issue?

@aperi2007

This comment has been minimized.

Show comment
Hide comment
@aperi2007

aperi2007 Mar 3, 2013

This is a working map file .
It correctly return an xml response from a GetCapabilites request.

MAP 
  #
  NAME      "test"  #name to give your map service
  SIZE      800 600
  MAXSIZE   4096
  UNITS meters
  ANGLE       0
  CONFIG "PROJ_LIB" "/usr/local/share/proj/"
  CONFIG "ON_MISSING_DATA" "LOG"
  DEBUG 4
  PROJECTION
    "+init=epsg:25832 +towgs84=0,0,0,0,0,0,0"
  END
  DEFRESOLUTION 91
  RESOLUTION 91
  IMAGECOLOR 255 255 255
  IMAGETYPE PNG8
  OUTPUTFORMAT
    NAME "AGGA"
    DRIVER AGG/PNG
    MIMETYPE "image/png"
    IMAGEMODE RGBA    #serve RGBA per avere il trasparente
    EXTENSION "png"
    FORMATOPTION "GAMMA=0.75"
    FORMATOPTION "INTERLACE=true"
    FORMATOPTION "QUANTIZE_DITHER=OFF"
    FORMATOPTION "COMPRESSION=6"  # Compression: 0=no compression, 9=best, 6=default compression
    FORMATOPTION "QUANTIZE_FORCE=ON"
    FORMATOPTION "QUANTIZE_COLORS=256"
    TRANSPARENT ON
  END
  WEB
    MINSCALEDENOM 1
    MAXSCALEDENOM 4000000
    METADATA
      "wms_title" "test"
      "wms_onlineresource" "http://localhost/wmsraster/com.rt.wms.RTmap/wms?map=test&"
      "wms_srs" "EPSG:25832 EPSG:3003 EPSG:4326 EPSG:3857"
      #"wms_feature_info_mime_type" "application/vnd.ogc.gml,application/vnd.ogc.wms_xml, text/xml, text/html, text/plain"
      "wms_enable_request" "*"
    END
  END 
  # End Web
  # layers we will want to display
  # Start of LAYER DEFINITIONS ---------------------------------------------
  LAYER
    NAME "layer1"
    STATUS OFF
    TYPE POINT
    METADATA
      "wms_title" "layer1"
      #  "wms_srs" "EPSG:25832 EPSG:3003 EPSG:4326"
      "wms_layer_group" "/layer1/layer2/layer3"
    END
  END
#-----
  LAYER
    NAME "layer2"
    STATUS OFF
    TYPE POINT
    # ... other standard raster processing functions here
    METADATA
      "wms_title" "layer2"
      "wms_layer_group" "/layer1/layer2/layer3"
      #"wms_enable_request" "!GetCapabilities"
    END
  END
#-----
  LAYER
    NAME "layer3"
    STATUS OFF
    TYPE LINE
    TRANSFORM LL
    UNITS percentages
    FEATURE
      POINTS 0.02 -0.5 0.98 -0.50 END
      TEXT 'text- blah blah'
    END
    METADATA
      "wms_title" "layer3"
      "wms_layer_group" "/layer1/layer2/layer3"
    END
    CLASS
      LABEL
        TYPE TRUETYPE
        FORCE true
        BUFFER 1
        COLOR "#FFFFFF25"
        ANTIALIAS false
        PRIORITY 10
        SIZE 130
        ANGLE auto
        OFFSET 0 140
        FONT "LiberationSansNarrow-Bold"
        POSITION LR
        REPEATDISTANCE 1000
      END
    END
  END
#======
  # End of LAYER DEFINITIONS -------------------------------
  # INCLUDE "layers.inc.map"
END # Map File

Adding a metadata
"wms_enable_request" "!GetCapabilities"
to the layer2 definition.

It is removed from group but the tags


are not correctly closed.

This is the sample with the
"wms_enable_request" "!GetCapabilities" added.

MAP 
  #
  NAME      "test"  #name to give your map service
  SIZE      800 600
  MAXSIZE   4096
  UNITS meters
  ANGLE       0
  CONFIG "PROJ_LIB" "/usr/local/share/proj/"
  CONFIG "ON_MISSING_DATA" "LOG"
  DEBUG 4
  PROJECTION
    "+init=epsg:25832 +towgs84=0,0,0,0,0,0,0"
  END
  DEFRESOLUTION 91
  RESOLUTION 91
  IMAGECOLOR 255 255 255
  IMAGETYPE PNG8
  OUTPUTFORMAT
    NAME "AGGA"
    DRIVER AGG/PNG
    MIMETYPE "image/png"
    IMAGEMODE RGBA    #serve RGBA per avere il trasparente
    EXTENSION "png"
    FORMATOPTION "GAMMA=0.75"
    FORMATOPTION "INTERLACE=true"
    FORMATOPTION "QUANTIZE_DITHER=OFF"
    FORMATOPTION "COMPRESSION=6"  # Compression: 0=no compression, 9=best, 6=default compression
    FORMATOPTION "QUANTIZE_FORCE=ON"
    FORMATOPTION "QUANTIZE_COLORS=256"
    TRANSPARENT ON
  END
  WEB
    MINSCALEDENOM 1
    MAXSCALEDENOM 4000000
    METADATA
      "wms_title" "test"
      "wms_onlineresource" "http://localhost/wmsraster/com.rt.wms.RTmap/wms?map=test&"
      "wms_srs" "EPSG:25832 EPSG:3003 EPSG:4326 EPSG:3857"
      #"wms_feature_info_mime_type" "application/vnd.ogc.gml,application/vnd.ogc.wms_xml, text/xml, text/html, text/plain"
      "wms_enable_request" "*"
    END
  END 
  # End Web
  # layers we will want to display
  # Start of LAYER DEFINITIONS ---------------------------------------------
  LAYER
    NAME "layer1"
    STATUS OFF
    TYPE POINT
    METADATA
      "wms_title" "layer1"
      #  "wms_srs" "EPSG:25832 EPSG:3003 EPSG:4326"
      "wms_layer_group" "/layer1/layer2/layer3"
    END
  END
#-----
  LAYER
    NAME "layer2"
    STATUS OFF
    TYPE POINT
    # ... other standard raster processing functions here
    METADATA
      "wms_title" "layer2"
      "wms_layer_group" "/layer1/layer2/layer3"
      "wms_enable_request" "!GetCapabilities"
    END
  END
#-----
  LAYER
    NAME "layer3"
    STATUS OFF
    TYPE LINE
    TRANSFORM LL
    UNITS percentages
    FEATURE
      POINTS 0.02 -0.5 0.98 -0.50 END
      TEXT 'text- blah blah'
    END
    METADATA
      "wms_title" "layer3"
      "wms_layer_group" "/layer1/layer2/layer3"
    END
    CLASS
      LABEL
        TYPE TRUETYPE
        FORCE true
        BUFFER 1
        COLOR "#FFFFFF25"
        ANTIALIAS false
        PRIORITY 10
        SIZE 130
        ANGLE auto
        OFFSET 0 140
        FONT "LiberationSansNarrow-Bold"
        POSITION LR
        REPEATDISTANCE 1000
      END
    END
  END
#======
  # End of LAYER DEFINITIONS -------------------------------
  # INCLUDE "layers.inc.map"
END # Map File

Andrea.

This is a working map file .
It correctly return an xml response from a GetCapabilites request.

MAP 
  #
  NAME      "test"  #name to give your map service
  SIZE      800 600
  MAXSIZE   4096
  UNITS meters
  ANGLE       0
  CONFIG "PROJ_LIB" "/usr/local/share/proj/"
  CONFIG "ON_MISSING_DATA" "LOG"
  DEBUG 4
  PROJECTION
    "+init=epsg:25832 +towgs84=0,0,0,0,0,0,0"
  END
  DEFRESOLUTION 91
  RESOLUTION 91
  IMAGECOLOR 255 255 255
  IMAGETYPE PNG8
  OUTPUTFORMAT
    NAME "AGGA"
    DRIVER AGG/PNG
    MIMETYPE "image/png"
    IMAGEMODE RGBA    #serve RGBA per avere il trasparente
    EXTENSION "png"
    FORMATOPTION "GAMMA=0.75"
    FORMATOPTION "INTERLACE=true"
    FORMATOPTION "QUANTIZE_DITHER=OFF"
    FORMATOPTION "COMPRESSION=6"  # Compression: 0=no compression, 9=best, 6=default compression
    FORMATOPTION "QUANTIZE_FORCE=ON"
    FORMATOPTION "QUANTIZE_COLORS=256"
    TRANSPARENT ON
  END
  WEB
    MINSCALEDENOM 1
    MAXSCALEDENOM 4000000
    METADATA
      "wms_title" "test"
      "wms_onlineresource" "http://localhost/wmsraster/com.rt.wms.RTmap/wms?map=test&"
      "wms_srs" "EPSG:25832 EPSG:3003 EPSG:4326 EPSG:3857"
      #"wms_feature_info_mime_type" "application/vnd.ogc.gml,application/vnd.ogc.wms_xml, text/xml, text/html, text/plain"
      "wms_enable_request" "*"
    END
  END 
  # End Web
  # layers we will want to display
  # Start of LAYER DEFINITIONS ---------------------------------------------
  LAYER
    NAME "layer1"
    STATUS OFF
    TYPE POINT
    METADATA
      "wms_title" "layer1"
      #  "wms_srs" "EPSG:25832 EPSG:3003 EPSG:4326"
      "wms_layer_group" "/layer1/layer2/layer3"
    END
  END
#-----
  LAYER
    NAME "layer2"
    STATUS OFF
    TYPE POINT
    # ... other standard raster processing functions here
    METADATA
      "wms_title" "layer2"
      "wms_layer_group" "/layer1/layer2/layer3"
      #"wms_enable_request" "!GetCapabilities"
    END
  END
#-----
  LAYER
    NAME "layer3"
    STATUS OFF
    TYPE LINE
    TRANSFORM LL
    UNITS percentages
    FEATURE
      POINTS 0.02 -0.5 0.98 -0.50 END
      TEXT 'text- blah blah'
    END
    METADATA
      "wms_title" "layer3"
      "wms_layer_group" "/layer1/layer2/layer3"
    END
    CLASS
      LABEL
        TYPE TRUETYPE
        FORCE true
        BUFFER 1
        COLOR "#FFFFFF25"
        ANTIALIAS false
        PRIORITY 10
        SIZE 130
        ANGLE auto
        OFFSET 0 140
        FONT "LiberationSansNarrow-Bold"
        POSITION LR
        REPEATDISTANCE 1000
      END
    END
  END
#======
  # End of LAYER DEFINITIONS -------------------------------
  # INCLUDE "layers.inc.map"
END # Map File

Adding a metadata
"wms_enable_request" "!GetCapabilities"
to the layer2 definition.

It is removed from group but the tags


are not correctly closed.

This is the sample with the
"wms_enable_request" "!GetCapabilities" added.

MAP 
  #
  NAME      "test"  #name to give your map service
  SIZE      800 600
  MAXSIZE   4096
  UNITS meters
  ANGLE       0
  CONFIG "PROJ_LIB" "/usr/local/share/proj/"
  CONFIG "ON_MISSING_DATA" "LOG"
  DEBUG 4
  PROJECTION
    "+init=epsg:25832 +towgs84=0,0,0,0,0,0,0"
  END
  DEFRESOLUTION 91
  RESOLUTION 91
  IMAGECOLOR 255 255 255
  IMAGETYPE PNG8
  OUTPUTFORMAT
    NAME "AGGA"
    DRIVER AGG/PNG
    MIMETYPE "image/png"
    IMAGEMODE RGBA    #serve RGBA per avere il trasparente
    EXTENSION "png"
    FORMATOPTION "GAMMA=0.75"
    FORMATOPTION "INTERLACE=true"
    FORMATOPTION "QUANTIZE_DITHER=OFF"
    FORMATOPTION "COMPRESSION=6"  # Compression: 0=no compression, 9=best, 6=default compression
    FORMATOPTION "QUANTIZE_FORCE=ON"
    FORMATOPTION "QUANTIZE_COLORS=256"
    TRANSPARENT ON
  END
  WEB
    MINSCALEDENOM 1
    MAXSCALEDENOM 4000000
    METADATA
      "wms_title" "test"
      "wms_onlineresource" "http://localhost/wmsraster/com.rt.wms.RTmap/wms?map=test&"
      "wms_srs" "EPSG:25832 EPSG:3003 EPSG:4326 EPSG:3857"
      #"wms_feature_info_mime_type" "application/vnd.ogc.gml,application/vnd.ogc.wms_xml, text/xml, text/html, text/plain"
      "wms_enable_request" "*"
    END
  END 
  # End Web
  # layers we will want to display
  # Start of LAYER DEFINITIONS ---------------------------------------------
  LAYER
    NAME "layer1"
    STATUS OFF
    TYPE POINT
    METADATA
      "wms_title" "layer1"
      #  "wms_srs" "EPSG:25832 EPSG:3003 EPSG:4326"
      "wms_layer_group" "/layer1/layer2/layer3"
    END
  END
#-----
  LAYER
    NAME "layer2"
    STATUS OFF
    TYPE POINT
    # ... other standard raster processing functions here
    METADATA
      "wms_title" "layer2"
      "wms_layer_group" "/layer1/layer2/layer3"
      "wms_enable_request" "!GetCapabilities"
    END
  END
#-----
  LAYER
    NAME "layer3"
    STATUS OFF
    TYPE LINE
    TRANSFORM LL
    UNITS percentages
    FEATURE
      POINTS 0.02 -0.5 0.98 -0.50 END
      TEXT 'text- blah blah'
    END
    METADATA
      "wms_title" "layer3"
      "wms_layer_group" "/layer1/layer2/layer3"
    END
    CLASS
      LABEL
        TYPE TRUETYPE
        FORCE true
        BUFFER 1
        COLOR "#FFFFFF25"
        ANTIALIAS false
        PRIORITY 10
        SIZE 130
        ANGLE auto
        OFFSET 0 140
        FONT "LiberationSansNarrow-Bold"
        POSITION LR
        REPEATDISTANCE 1000
      END
    END
  END
#======
  # End of LAYER DEFINITIONS -------------------------------
  # INCLUDE "layers.inc.map"
END # Map File

Andrea.

@szekerest

This comment has been minimized.

Show comment
Hide comment
@szekerest

szekerest Mar 4, 2013

Member

I hope the fix above will solve the issue with the layer closing tags
Also fixed the memory corruption when all layers are added to the same group

Member

szekerest commented Mar 4, 2013

I hope the fix above will solve the issue with the layer closing tags
Also fixed the memory corruption when all layers are added to the same group

@aperi2007

This comment has been minimized.

Show comment
Hide comment
@aperi2007

aperi2007 Mar 4, 2013

Hi,
It work like a charm.

great !

Hi,
It work like a charm.

great !

@szekerest

This comment has been minimized.

Show comment
Hide comment
@szekerest

szekerest Mar 5, 2013

Member

closing

Member

szekerest commented Mar 5, 2013

closing

@szekerest szekerest closed this Mar 5, 2013

@tbonfort

This comment has been minimized.

Show comment
Hide comment
@tbonfort

tbonfort Mar 5, 2013

Member

re-opening until the failing autotests are fixed

Member

tbonfort commented Mar 5, 2013

re-opening until the failing autotests are fixed

@tbonfort tbonfort reopened this Mar 5, 2013

@szekerest

This comment has been minimized.

Show comment
Hide comment
@szekerest

szekerest Mar 5, 2013

Member

I already updated ows_wms_capabilities.xml in msautotest, but it doesn't seem to have effect

Member

szekerest commented Mar 5, 2013

I already updated ows_wms_capabilities.xml in msautotest, but it doesn't seem to have effect

tbonfort added a commit that referenced this issue Mar 5, 2013

tbonfort added a commit that referenced this issue Mar 5, 2013

@tbonfort

This comment has been minimized.

Show comment
Hide comment
@tbonfort

tbonfort Mar 5, 2013

Member

@szekerest the autotest submodule needed to be updated in the mapserver source tree. c.f. the instructions in https://github.com/mapserver/mapserver/wiki/Test-Suite

Member

tbonfort commented Mar 5, 2013

@szekerest the autotest submodule needed to be updated in the mapserver source tree. c.f. the instructions in https://github.com/mapserver/mapserver/wiki/Test-Suite

@tbonfort tbonfort closed this Mar 5, 2013

mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013

mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013

mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013

mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013

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