2

I know this has been discused before, but before somebody tell me about data base views or HTML templates, this is my concern:

Geoserver returns the geometry field from WMS getfeature info, enabling anyone to create scripts to download the data from the server as if it was WFS.

Is there a way to prevent this behaviour?

2 Answers 2

2

You can use the HTTP parameter "propertyName" to specify the properties that you want to be returned (comma-separated list), e.g. &propertyName=name,category. So, if you want all attributes, except for the geometry to be returned, you must include all property names in this list.

See: http://docs.geoserver.org/stable/en/user/services/wms/reference.html#getfeatureinfo for all details.

4
  • The issue though is that the provider of the GeoServer service wants to stop the Geometry from being provided. propertyName is a way of a user making a request for data, not a way for a provider to stop data from being published.
    – nmtoken
    Commented Aug 13, 2016 at 20:46
  • 1
    In that case you need to fall back to HTML output only (see other response to this question) and edit the FeatureInfo template to not display the Geometry.
    – janb
    Commented Aug 15, 2016 at 8:02
  • Is it possible like &propertyName!=Name Commented Feb 26, 2018 at 11:12
  • @Hyma That is unfortunately not possible at the moment.
    – janb
    Commented Mar 20, 2018 at 8:45
1

With the admin utility you can select allowed formats from the WMS settings page. GetFeatureFormats can be selected from "Allowed MIME types for a GetFeatureInfo request". Leave only text/html and text/plain left. You must also disable vector formats from "Allowed MIME types for a GetMap request" for preventing KML and perhaps SVG and some other outputformats.

1
  • I think this might solve it, but I was thinking of something like the "gml_include_items" of MapServer, without sacrificing GML output.
    – Leonardo
    Commented Oct 22, 2014 at 3:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.