[Geoserver-devel] More bugs in GetFeature request

Iam using geoserver 1.1.1 and my feature type fire:fire has the following schema:

<xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema&quot; name="fire_Type">
    <xs:complexContent>
        <xs:extension base="gml:AbstractFeatureType">
        <xs:sequence>
          <xs:element name="the_geom" minOccurs="0" nillable="true" type="gml:MultiPolygonPropertyType" />
          <xs:element name="ID" minOccurs="1" nillable="true" type="xs:int" />
          <xs:element name="NAME" minOccurs="1" nillable="true" type="xs:string" />
          <xs:element name="COUNTY" minOccurs="1" nillable="true" type="xs:string" />
          <xs:element name="COUNTY_ID" minOccurs="1" nillable="true" type="xs:int" />
          <xs:element name="EDIT_DATE" minOccurs="0" nillable="true" type="xs:string" />
          </xs:sequence>
          </xs:extension>
      </xs:complexContent>
</xs:complexType>

When I make this request: http://localhost:8080/geoserver/wfs?REQUEST=GetFeature&OUTPUTFORMAT=GML2&TYPENAME=fire:fire&PROPERTYNAME=fire:the_geom

I get only the features with the specified property name (which is an optional property), but the wfs specification says that the server must return the fetched property and all the mandatories properties defined in the schema.

The same occurs when I make the request with a mandatory property (I get only the specified property).

By the way, I am finding those bugs because I am building a wfs testing engine to check if a wfs follows the ogc specifications. (When the testing engine is finished, we have planned to donate it as open source).

--
Miguel Ángel Esbrí
Dept. Information Systems
(Lenguajes y Sistemas Informáticos)
Universitat Jaume I
E-12071 Castellón, Spain
mailto:maesbri@anonymised.com
http://edugi.uji.es

When I make this request:
http://localhost:8080/geoserver/wfs?REQUEST=GetFeature&OUTPUTFORMAT=GML2&TYPENAME=fire:fire&PROPERTYNAME=fire:the_geom

I get only the features with the specified property name (which is an
optional property), but the wfs specification says that the server must
return the fetched property and all the mandatories properties defined
in the schema.

The same occurs when I make the request with a mandatory property (I get
only the specified property).

Yeah, our solution to that requirement for WFS is a bit hacky. In 1.2
it'll be done with schema.xml files, for 1.1 the information is
duplicated. Basically what you need to do is set the attributes that are
mandatory in the info.xml file <attributes><attribute name="gid"
mandatory="true"></attributes> I think is the form, check the
advanced.htm in the user docs, and I think one of the sample info.xml
files also has it. Note that the non-mandatory ones you will also have to
list, or they will not show up at all (this is how you 'hide' attributes).

By the way, I am finding those bugs because I am building a wfs testing
engine to check if a wfs follows the ogc specifications. (When the
testing engine is finished, we have planned to donate it as open source).

Sounds great, but are you aware that the OGC has already done a very
comprehensive testing engine for WFS? The engine itself is not open
source, so your code could be useful, but I just want to be sure you're
not needlessly duplicating the effort. It is available at
http://cite.occamlab.com/tsOGC. Though there are a few little things that
could be done a bit better, and a truly open source test suite will allow
all to make it better, but they've done a pretty good job on this one.

Thanks a lot for the good bug reports - we actually have only ever done
real extensive tests of GeoServer with Postgis, it looks like you've been
hitting it hard with shapefiles, which is good. I think I've got fixes
for the date and maxFeatures bugs, I just need to test and upload them.
And I'll tackle the namespace one, it was previously impossible with our
old writers, now it's possible I just haven't motivated because that is
one of the few things that slips past the cite tests.

Chris

--

Chris Holmes wrote:

When I make this request: http://localhost:8080/geoserver/wfs?REQUEST=GetFeature&OUTPUTFORMAT=GML2&TYPENAME=fire:fire&PROPERTYNAME=fire:the_geom

I get only the features with the specified property name (which is an optional property), but the wfs specification says that the server must return the fetched property and all the mandatories properties defined in the schema.

The same occurs when I make the request with a mandatory property (I get only the specified property).
   

Yeah, our solution to that requirement for WFS is a bit hacky. In 1.2 it'll be done with schema.xml files, for 1.1 the information is duplicated.

I've tried to compile version 1.2 with "ant war", but I get an error related to junit or something like that.

Basically what you need to do is set the attributes that are mandatory in the info.xml file <attributes><attribute name="gid" mandatory="true"></attributes> I think is the form, check the advanced.htm in the user docs, and I think one of the sample info.xml files also has it. Note that the non-mandatory ones you will also have to list, or they will not show up at all (this is how you 'hide' attributes).

By the way, I am finding those bugs because I am building a wfs testing engine to check if a wfs follows the ogc specifications. (When the testing engine is finished, we have planned to donate it as open source).
   
Sounds great, but are you aware that the OGC has already done a very comprehensive testing engine for WFS? The engine itself is not open source, so your code could be useful, but I just want to be sure you're not needlessly duplicating the effort. It is available at http://cite.occamlab.com/tsOGC. Though there are a few little things that could be done a bit better, and a truly open source test suite will allow all to make it better, but they've done a pretty good job on this one.

Yes, I know about CITE tests. We are developing our testing engine as a part of an European project called ACE-GIS (you can learn more about it at this url: http://www.acegis.net).
Although our testing engine takes as model the assertions provided by CITE, it allows you to test your own data, so you don't have to include CITE data to be able to run their tests.
Moreover, you don't have to register to run the tests, you only have to put the wfs url and configure the test engine through a simple form.

And finally, it is written in Java, so everybody can improve the engine with not much effort (whereas CITE tests are written with XPath, making quite difficult to understand
what is being tested).

Thanks a lot for the good bug reports - we actually have only ever done real extensive tests of GeoServer with Postgis, it looks like you've been hitting it hard with shapefiles, which is good.

Well, the fact is that I am developing all my work in Windows and I needed a quite geoserver install so I took the easy way (the shapefiles :slight_smile: ).

I think I've got fixes for the date and maxFeatures bugs, I just need to test and upload them. And I'll tackle the namespace one, it was previously impossible with our old writers, now it's possible I just haven't motivated because that is one of the few things that slips past the cite tests.

Chris

--
Miguel Ángel Esbrí
Dept. Information Systems
(Lenguajes y Sistemas Informáticos)
Universitat Jaume I
E-12071 Castellón, Spain
mailto:maesbri@anonymised.com
http://edugi.uji.es

>>The same occurs when I make the request with a mandatory property (I get
>>only the specified property).
>>
>>
>Yeah, our solution to that requirement for WFS is a bit hacky. In 1.2
>it'll be done with schema.xml files, for 1.1 the information is
>duplicated.
>
I've tried to compile version 1.2 with "ant war", but I get an error
related to junit or something like that.

I assume this is the alpha release? You can get the war to build by
removing the 'test-all' (or something to that effect) dependancy in the
'war' build target in the build.xml file. Though 1.2-beta fixes all that
and much more. It should be out very, very soon (Jody?). Until it's out
you can work off of cvs, the war target definitely works.

>>By the way, I am finding those bugs because I am building a wfs testing
>>engine to check if a wfs follows the ogc specifications. (When the
>>testing engine is finished, we have planned to donate it as open source).
>
>Sounds great, but are you aware that the OGC has already done a very
>comprehensive testing engine for WFS? The engine itself is not open
>source, so your code could be useful, but I just want to be sure you're
>not needlessly duplicating the effort. It is available at
>http://cite.occamlab.com/tsOGC. Though there are a few little things that
>could be done a bit better, and a truly open source test suite will allow
>all to make it better, but they've done a pretty good job on this one.
>

Yes, I know about CITE tests. We are developing our testing engine as a
part of an European project called ACE-GIS (you can learn more about it
at this url: http://www.acegis.net).
Although our testing engine takes as model the assertions provided by
CITE, it allows you to test your own data, so you don't have to include
CITE data to be able to run their tests.
Moreover, you don't have to register to run the tests, you only have to
put the wfs url and configure the test engine through a simple form.

And finally, it is written in Java, so everybody can improve the engine
with not much effort (whereas CITE tests are written with XPath, making
quite difficult to understand
what is being tested).

Awesome! That's the answer I was hoping for :slight_smile: The biggest weakness of
cite is that you can't test your own data, putting their data on can be a
bitch. I'm excited you're putting GeoServer through it's paces, I'll try
to be fast with responses, but my time is more limited than it has been in
the past.

>Thanks a lot for the good bug reports - we actually have only ever done
>real extensive tests of GeoServer with Postgis, it looks like you've been
>hitting it hard with shapefiles, which is good.
>
Well, the fact is that I am developing all my work in Windows and I
needed a quite geoserver install so I took the easy way (the shapefiles
:slight_smile: ).

I definitely understand. And it's actually quite nice to have some one
seriously test shapefiles, since we only did postgis with cite.

Good luck with your test suite, and I'm excited to see the results.

Chris