Opened 20 years ago

Closed 14 years ago

Last modified 14 years ago

#675 closed enhancement (fixed)

Mapserver WFS ignores PropertyName outside Filter

Reported by: bartvde@… Owned by: assefa
Priority: high Milestone: 5.6 release
Component: WFS Server Version: 4.2
Severity: minor Keywords:
Cc: mapserver@…

Description (last modified by dmorissette)

When a performing a GetFeature like the following:

<GetFeature service="WFS" version="1.0.0"
  maxFeatures="20" 
  xmlns="http://www.opengis.net/wfs" 
  xmlns:gml="http://www.opengis.net/gml" 
  xmlns:ogc="http://www.opengis.net/ogc" 
  xmlns:xlink="http://www.w3.org/1999/xlink" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="http://schemas.opengis.net/wfs/1.0.0 WFS-basic.xsd">
  <Query typeName="Gemeentes">
    <PropertyName>GEMCODE</PropertyName>
    <ogc:Filter>
      <ogc:BBOX>
      	<PropertyName>MS_GEOMETRY</PropertyName>
      	<gml:Box><gml:coordinates>121000,469000 
140000,470000</gml:coordinates></gml:Box>
      </ogc:BBOX>
    </ogc:Filter>
  </Query>
</GetFeature>

Mapserver should return only the GEMCODE attribute, it returns the full set.

This is what the WFS 1.0 spec says about the behaviour:

The <PropertyName> element is used to enumerate the feature properties that 
should be selected during a query and whose values should be included in the 
response to a GetFeature request. A client application can determine the 
properties of a feature by making a DescribeFeatureType request before 
composing a GetFeature request. The DescribeFeatureType operation [sec. 8] will 
generate a GML application schema defining the schema of the feature type. The 
client can then select the properties to be fetched. In addition, the client 
can determine which feature properties are mandatory and must be fetched in 
order for the WFS to be able to generate an instance of the feature type that 
will validate againt the generated GML application schema. In the event that a 
WFS encounters a query that does not select all mandatory properties of a 
feature, the WFS will internally augment the property name list to include all 
necessary property names. A WFS client must thus be prepared to deal with a 
situation where it receives more property values than it requests.
If no <PropertyName> elements are specified, then all feature properties should 
be fetched.

Attachments (3)

ms_ticket675_52.patch (6.9 KB ) - added by bartvde 16 years ago.
patch for HTTP POST against 5.2beta4
mapserver-5.2.0-675.patch (7.0 KB ) - added by bartvde 16 years ago.
mapserver-5.2.0-675.2.patch (8.7 KB ) - added by bartvde 15 years ago.
new patch incorporating alias fields

Download all attachments as: .zip

Change History (20)

comment:1 by assefa, 19 years ago

Milestone: FUTURE
Setting this as a Future enhancement. Tasks to be done :

  - extact the <Query typeName tga(s) and build a list of attributes
  - use the list of attributes in the msGMLWriteWFSQuery function to limit
    the output.

comment:2 by bartvde@…, 19 years ago

The same applies to the HTTP GET interface.

E.g.:

http://www.someserver.com/wfs.cgi&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&PROPERTYNAME=INWATERA_1M/WKB_GEOM,INWATERA_1M/TILE_ID&TYPENAME=INWATERA_1M

comment:3 by mapserver@…, 19 years ago

Cc: mapserver@… added

comment:4 by jdoyon@…, 18 years ago

I'm going to vote for this :)

Also I don't know if the spec says anything specific about this, but it'd be
nice if the geometry could also be treated equally.

In my use case, I'm interested only in the bounding box of a feature, so I could
suppress everything else easily.  And considering how the actualy geometry can
easily be biggest component of a FeatureMember, this could help improve
performance quite a bit.

I wonder if I can gml_exclude "msGeometry"?? I'm going to go try that, it not,
that'd be nice too :)


comment:5 by bartvde@…, 18 years ago

Assefa, how much work would be involved in this?

Also, could it be possible to only query the database for the columns needed?

comment:6 by hobu, 17 years ago

Milestone: FUTURE5.0 release

comment:7 by dmorissette, 17 years ago

Description: modified (diff)
Owner: changed from mapserverbugs to assefa

Reassigned to Assefa. Please update status and/or milestone.

comment:8 by assefa, 17 years ago

Milestone: 5.0 releaseFUTURE

won't be done for 5.0.

comment:9 by bartvde, 16 years ago

I am working on a patch for this issue. Hopefully I can cook up something soon.

by bartvde, 16 years ago

Attachment: ms_ticket675_52.patch added

patch for HTTP POST against 5.2beta4

by bartvde, 16 years ago

Attachment: mapserver-5.2.0-675.patch added

comment:10 by bartvde, 16 years ago

Milestone: FUTURE5.4 release

comment:11 by assefa, 15 years ago

Status: newassigned

Bart,

Are the patch submitted in this bug complete? I seem to only see modifications done in mapows.h.

I am going to work on this bug (support of PropertyName and also the possibility to execlude geometries from the result) I am also wondering if the the geometry exclusion would be better done using a specific tag like gml_exclude_geometry.

Thx

comment:12 by bartvde, 15 years ago

Hey Assefa, it is complete, but Trac only shows the first file. Please download the patch instead in its original format [1]

[1] http://trac.osgeo.org/mapserver/attachment/ticket/675/mapserver-5.2.0-675.patch

I think we need to decide on how METADATA relates to the WFS protocol definition, I think the WFS protocol should always override METADATA.

comment:13 by bartvde, 15 years ago

I just found out this patch currently does not incorporate alias fields.

by bartvde, 15 years ago

Attachment: mapserver-5.2.0-675.2.patch added

new patch incorporating alias fields

comment:14 by assefa, 15 years ago

Milestone: 5.4 release6.0 release

comment:15 by assefa, 14 years ago

Resolution: fixed
Status: assignedclosed

committed in trunk. Added msautotest

comment:16 by dmorissette, 14 years ago

Milestone: 6.0 release5.6 release

(Changing target milestone since trunk is currently 5.6)

comment:17 by bartvde, 14 years ago

I've tested this and it works fine.

Note: See TracTickets for help on using tickets.