[Geoserver-users] [WFS] Requesting gml:name and gml:description with GetFeature

Hello all,

I've installed Geoserver 1.4, and I would like to use it for WFS. I'm
having a problem when I do a GetFeature request where the default
properties of a gml:AbstractFeatureType are included (gml:name,
gml:description, gml:boundedBy). I'm getting a ServiceException with the
following message: "Requested property: name is not available for
cbs:wijk_2005_gen. The possible propertyName values are: <snip/>".

Since all feature types in Geoserver are derived from
gml:AbstractFeatureType (see
http://schemas.opengis.net/gml/2.1.2/feature.xsd), I expected that I
would get a list with requested feature, with null values (empty
elements) for the gml:name/gml:desc properties. (The gml:boundedBy
property could be calculated, and it will be returned when I check the
"Generate feature bounds" checkbox.)

My GetFeature request is (based on the WFS demo):

<wfs:GetFeature service="WFS" version="1.0.0"

  outputFormat="GML2"

  xmlns:topp="http://www.openplans.org/topp&quot;

  xmlns:wfs="http://www.opengis.net/wfs&quot;

  xmlns:ogc="http://www.opengis.net/ogc&quot;

  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;

  xmlns:gml="http://www.opengis.net/gml&quot;

  xsi:schemaLocation="http://www.opengis.net/wfs

http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot;

  maxFeatures="5">

  <wfs:Query typeName="cbs:wijk_2005_gen">

    <ogc:PropertyName>gml:name</ogc:PropertyName>

    <ogc:PropertyName>the_geom</ogc:PropertyName>

    <ogc:PropertyName>WK_CODE</ogc:PropertyName>

    <ogc:PropertyName>GM_CODE</ogc:PropertyName>

    <ogc:PropertyName>WK_NAAM</ogc:PropertyName>

    <ogc:PropertyName>GM_NAAM</ogc:PropertyName>

  </wfs:Query>

</wfs:GetFeature>

Note that I've included the xmlns:gml attribute, to include the gml
namespace. This doesn't make any difference. As soon as I omit the
property gml:name I'm getting a list of features. The same is true for
gml:description and gml:boundedBy.

I've a few side-notes:

* I think it would be nice to (also) return the bounding box when the
client requests the gml:boundedBy property.

* I've noticed that the namespace of ogc:PropertyName isn't checked.
(I've typed wfs:PropertyName erroneously in first instance.)

* It would be interesting to see what happens when the feature would
have a name/description property on its own (name collision?).

Since I'm not subscribed to the Geoserver mailing list, please answer me
directly as well.

Regards,

Frank Steggink

Frank.Steggink@anonymised.com wrote:

Hello all,

I’ve installed Geoserver 1.4, and I would like to use it for WFS. I’m having a problem when I do a GetFeature request where the default properties of a gml:AbstractFeatureType are included (gml:name, gml:description, gml:boundedBy). I’m getting a ServiceException with the following message: “Requested property: name is not available for cbs:wijk_2005_gen. The possible propertyName values are: <snip/>”.

Since all feature types in Geoserver are derived from gml:AbstractFeatureType (see http://schemas.opengis.net/gml/2.1.2/feature.xsd), I expected that I would get a list with requested feature, with null values (empty elements) for the gml:name/gml:desc properties. (The gml:boundedBy property could be calculated, and it will be returned when I check the “Generate feature bounds” checkbox.)

Yes, I agree that such behavior is probably the best way to go. The name/desc/boundedBy stuff is a bit of a hack. If you turn citeConformanceHacks to true then it will properly bind any name/desc/boundedBy properties that already exist in your dataset with the proper GML prefix.

The solution we're waiting for is to allow people to do arbitrary mapping from their data to feature output, so they could specify what field in their database they want to show up as 'name' or 'description'.

But even with that, I think I agree that if a user does happen to request a gml:name or gml:desc then we should not be throwing an error. We should be returning empty elements.

My GetFeature request is (based on the WFS demo):

<wfs:GetFeature service="WFS" version="1.0.0"

  outputFormat="GML2"

  xmlns:topp="http://www.openplans.org/topp&quot;

  xmlns:wfs="http://www.opengis.net/wfs&quot;

  xmlns:ogc="http://www.opengis.net/ogc&quot;

  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;

  xmlns:gml="http://www.opengis.net/gml&quot;

  xsi:schemaLocation="http://www.opengis.net/wfs

                      http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot;

  maxFeatures="5">

  <wfs:Query typeName="cbs:wijk_2005_gen">

    <ogc:PropertyName>gml:name</ogc:PropertyName>

    <ogc:PropertyName>the_geom</ogc:PropertyName>

    <ogc:PropertyName>WK_CODE</ogc:PropertyName>

    <ogc:PropertyName>GM_CODE</ogc:PropertyName>

    <ogc:PropertyName>WK_NAAM</ogc:PropertyName>

    <ogc:PropertyName>GM_NAAM</ogc:PropertyName>

  </wfs:Query>

</wfs:GetFeature>

Note that I’ve included the xmlns:gml attribute, to include the gml namespace. This doesn’t make any difference. As soon as I omit the property gml:name I’m getting a list of features. The same is true for gml:description and gml:boundedBy.

Yes, that behavior makes sense with how it is coded. Could you submit a but to our task tracker? See: http://docs.codehaus.org/display/GEOSDOC/1+Reporting+Issues (you don't need to do all the steps, just report what you've got as it's sufficient, I can confirm it's a bug)

I’ve a few side-notes:

* I think it would be nice to (also) return the bounding box when the client requests the gml:boundedBy property.

Yes, I agree. Could you make a separate feature request in our tracker for that? We already have the infrastructure to make the boundedBy - we just need to put a switch to activate it when a user requests it...

* I’ve noticed that the namespace of ogc:PropertyName isn’t checked. (I’ve typed wfs:PropertyName erroneously in first instance.)

Yeah, I never thought of a real good reason to be that fastidious about checking namespaces on something like PropertyName that's not going to collide with anything else. Though our new parser framework (in 1.6) may check those things a bit more, I'm not sure. But the general philosophy is be loose on accepting stuff and strict when returning stuff.

* It would be interesting to see what happens when the feature would have a name/description property on its own (name collision?).

Right now the CiteConformanceHack allows some control over this. If it's set to true then those properties will end up with proper gml prefixes. If false, and if we implemented your request, then it'd accept all the properties, and return just the ones in your own namespace.

Oh, and a quick note on CiteConformanceHack property - the behavior your asking for used to be called gmlPrefixing. But it was a hack that no one used, except for passing cite tests, so we rolled it in with some even more obscure changes we have to do to pass the cite tests (like only report the output formats that cite can deal with, which is a random group of about 5 or 6).

best regards,

Chris

Since I’m not subscribed to the Geoserver mailing list, please answer me directly as well.

Regards,

Frank Steggink

!DSPAM:1003,45a3b9d58129771116852!

------------------------------------------------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

!DSPAM:1003,45a3b9d58129771116852!

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1003,45a3b9d58129771116852!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org