[gdal-dev] Re: [WFS Drvier] "Id Only" and "Geometry Only"

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Fri Mar 16 11:22:16 EDT 2012


xavier lhomme <lhomme.xavier <at> gmail.com> writes:

> 
> Hello   I want to selectFeatures from a WFS DataSource. Is it possible to
return Geometry Only without the attribut ?  And Is it possible to return only
Id (without Geometry and Attribut ) ?thanks 

Hi,

It does not seem to be quite possible.
This one brings gml_id and geometry even geometry is not included in the
selection. I would not complain about it, geometry with ID is worth more than
geometry without ID.

ogrinfo  wfs:http://188.64.1.61/cgi-bin/tinyows -sql "select gml_id from
municipalities"

Selecting just geometry with ogr does not bring anything

ogrinfo  wfs:http://188.64.1.61/cgi-bin/tinyows -sql "select the_geom from
municipalities"

Selecting just geometry is rather simple with standard WFS but the result
contains also the fid and it is the same output than with ogr when just gml_id
is selected.

http://188.64.1.61/cgi-bin/tinyows?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=municipalities&propertyname=the_geom

I don't believe it is possible to get just feature IDs with WFS request. In
another direction, getting a feature by ID it goes well

http://188.64.1.61/cgi-bin/tinyows?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=municipalities&featureid=municipalities.4

However, you will get the featureIDs from WFS without geometries if even one
normal attribute is selected, here the name of the municipalities.

http://188.64.1.61/cgi-bin/tinyows?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=municipalities&propertyname=kunta_ni1&maxfeatures=5

-Jukka Rahkonen-



More information about the gdal-dev mailing list