1

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?

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.

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

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.

  • 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 Aug 13 '16 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 Aug 15 '16 at 8:02
  • Is it possible like &propertyName!=Name – Satya Chandra Feb 26 '18 at 11:12
  • @Hyma That is unfortunately not possible at the moment. – janb Mar 20 '18 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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