[Geoserver-users] WFS getFeature BBOX

Hi list,
I'm trying to make a simple WFS getFeature request looking at the
WFS_getfeatureBBox in the GeoServer demo request section.

This is my request:

<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:gml="http://www.opengis.net/gml&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot;&gt;
  <wfs:Query typeName="ras:IDT_AA01G_COMUNI">
    <wfs:PropertyName>ras:AA01_NOME</wfs:PropertyName>
    <wfs:PropertyName>ras:AA01_COD_PROV_ISTAT</wfs:PropertyName>
    <wfs:PropertyName>ras:AA01_COD_REG_ISTAT</wfs:PropertyName>
    <ogc:Filter>
      <ogc:BBOX>
        <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
          <gml:coordinates>1448374.66,4513653.33
1448384.66,4513663.33</gml:coordinates>
        </gml:Box>
      </ogc:BBOX>
    </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

But I'm getting this response:

<ServiceExceptionReport version="1.2.0"
xmlns="http://www.opengis.net/ogc&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/ogc
http://coreweb2.corenet.it:80/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd&quot;&gt;
  <ServiceException
locator="org.vfny.geoserver.util.requests.readers.XmlRequestReader">org.xml.sax.SAXException:
Attempted to construct illegal filter: Got to the end state of an
incomplete filter, current state is leftValue
org.xml.sax.SAXException: Attempted to construct illegal filter: Got
to the end state of an incomplete filter, current state is
leftValue</ServiceException>
</ServiceExceptionReport>

What am I doing wrong?

Thanks,

Paolo

Hi Paulo,

Which version of GeoServer are you using? Also it would be handy if we
could have the complete error. There should be a stack trace on your
console or in the log. If you could include it that would be helpful.

Also... this is just a thought but which type of datasource are you
using. In the case of a database are you sure the geometry column is set
up properly.

Thanks,

-Justin

Paolo Moretti wrote:

Hi list,
I'm trying to make a simple WFS getFeature request looking at the
WFS_getfeatureBBox in the GeoServer demo request section.

This is my request:

<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:gml="http://www.opengis.net/gml&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot;&gt;
  <wfs:Query typeName="ras:IDT_AA01G_COMUNI">
    <wfs:PropertyName>ras:AA01_NOME</wfs:PropertyName>
    <wfs:PropertyName>ras:AA01_COD_PROV_ISTAT</wfs:PropertyName>
    <wfs:PropertyName>ras:AA01_COD_REG_ISTAT</wfs:PropertyName>
    <ogc:Filter>
      <ogc:BBOX>
        <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
          <gml:coordinates>1448374.66,4513653.33
1448384.66,4513663.33</gml:coordinates>
        </gml:Box>
      </ogc:BBOX>
    </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

But I'm getting this response:

<ServiceExceptionReport version="1.2.0"
xmlns="http://www.opengis.net/ogc&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/ogc
http://coreweb2.corenet.it:80/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd&quot;&gt;
  <ServiceException
locator="org.vfny.geoserver.util.requests.readers.XmlRequestReader">org.xml.sax.SAXException:
Attempted to construct illegal filter: Got to the end state of an
incomplete filter, current state is leftValue
org.xml.sax.SAXException: Attempted to construct illegal filter: Got
to the end state of an incomplete filter, current state is
leftValue</ServiceException>
</ServiceExceptionReport>

What am I doing wrong?

Thanks,

Paolo

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,47977880141221431913854!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Paolo Moretti ha scritto:

Hi list,
I'm trying to make a simple WFS getFeature request looking at the
WFS_getfeatureBBox in the GeoServer demo request section.

This is my request:

<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:gml="http://www.opengis.net/gml&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot;&gt;
  <wfs:Query typeName="ras:IDT_AA01G_COMUNI">
    <wfs:PropertyName>ras:AA01_NOME</wfs:PropertyName>
    <wfs:PropertyName>ras:AA01_COD_PROV_ISTAT</wfs:PropertyName>
    <wfs:PropertyName>ras:AA01_COD_REG_ISTAT</wfs:PropertyName>
    <ogc:Filter>
      <ogc:BBOX>
        <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
          <gml:coordinates>1448374.66,4513653.33
1448384.66,4513663.33</gml:coordinates>
        </gml:Box>
      </ogc:BBOX>
    </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

But I'm getting this response:

<ServiceExceptionReport version="1.2.0"
xmlns="http://www.opengis.net/ogc&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/ogc
http://coreweb2.corenet.it:80/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd&quot;&gt;
  <ServiceException
locator="org.vfny.geoserver.util.requests.readers.XmlRequestReader">org.xml.sax.SAXException:
Attempted to construct illegal filter: Got to the end state of an
incomplete filter, current state is leftValue
org.xml.sax.SAXException: Attempted to construct illegal filter: Got
to the end state of an incomplete filter, current state is
leftValue</ServiceException>
</ServiceExceptionReport>

What am I doing wrong?

You're specifying an invalid request, xml wise. The definition of BBOX in filter 1.0 spec (the one used by wfs 1.0) is:

<xsd:complexType name="BBOXType">
   <xsd:complexContent>
     <xsd:extension base="ogc:SpatialOpsType">
       <xsd:sequence>
         <xsd:element ref="ogc:PropertyName"/>
         <xsd:element ref="gml:Box"/>
       </xsd:sequence>
     </xsd:extension>
   </xsd:complexContent>
</xsd:complexType>

so you have to specify both the property name and the box.

Wondering which version of GeoServer you're using thought, trying
against 1.6.0 I got a different error message
Cheers
Andrea

Hmmm... you are right Andrea. I also checked filter 1.1 and it is the
same. I seem to remember somethng in the spec about BBOX saying that if
no PropertyName is included then it should be supplemented with "the
default". Perhaps my memory is playing tricks on me again :slight_smile:

Andrea Aime wrote:

Paolo Moretti ha scritto:

Hi list,
I'm trying to make a simple WFS getFeature request looking at the
WFS_getfeatureBBox in the GeoServer demo request section.

This is my request:

<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:gml="http://www.opengis.net/gml&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot;&gt;
  <wfs:Query typeName="ras:IDT_AA01G_COMUNI">
    <wfs:PropertyName>ras:AA01_NOME</wfs:PropertyName>
    <wfs:PropertyName>ras:AA01_COD_PROV_ISTAT</wfs:PropertyName>
    <wfs:PropertyName>ras:AA01_COD_REG_ISTAT</wfs:PropertyName>
    <ogc:Filter>
      <ogc:BBOX>
        <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
          <gml:coordinates>1448374.66,4513653.33
1448384.66,4513663.33</gml:coordinates>
        </gml:Box>
      </ogc:BBOX>
    </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

But I'm getting this response:

<ServiceExceptionReport version="1.2.0"
xmlns="http://www.opengis.net/ogc&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/ogc
http://coreweb2.corenet.it:80/geoserver/schemas//wfs/1.0.0/OGC-exception.xsd&quot;&gt;
  <ServiceException
locator="org.vfny.geoserver.util.requests.readers.XmlRequestReader">org.xml.sax.SAXException:
Attempted to construct illegal filter: Got to the end state of an
incomplete filter, current state is leftValue
org.xml.sax.SAXException: Attempted to construct illegal filter: Got
to the end state of an incomplete filter, current state is
leftValue</ServiceException>
</ServiceExceptionReport>

What am I doing wrong?

You're specifying an invalid request, xml wise. The definition of BBOX
in filter 1.0 spec (the one used by wfs 1.0) is:

<xsd:complexType name="BBOXType">
   <xsd:complexContent>
     <xsd:extension base="ogc:SpatialOpsType">
       <xsd:sequence>
         <xsd:element ref="ogc:PropertyName"/>
         <xsd:element ref="gml:Box"/>
       </xsd:sequence>
     </xsd:extension>
   </xsd:complexContent>
</xsd:complexType>

so you have to specify both the property name and the box.

Wondering which version of GeoServer you're using thought, trying
against 1.6.0 I got a different error message
Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,47984e90132927082231907!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Justin Deoliveira ha scritto:

Hmmm... you are right Andrea. I also checked filter 1.1 and it is the
same. I seem to remember somethng in the spec about BBOX saying that if
no PropertyName is included then it should be supplemented with "the
default". Perhaps my memory is playing tricks on me again :slight_smile:

No tricks, it's just what we have to do with the BBOX kvp
parameter. But it does not apply to xml :wink:
Cheers
Andrea

Paolo Moretti ha scritto:

Thanks for your help, I was specifying an invalid request.

No problem. Please, don't send me private mails thought.
http://docs.codehaus.org/pages/viewpage.action?pageId=57507867

However. I'm getting a new problem with GeoServer 1.5.4.

This is my new request:

<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:gml="http://www.opengis.net/gml&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd&quot;&gt;
  <wfs:Query typeName="ras:IDT_AA01G_COMUNI">
    <ogc:PropertyName>ras:AA01_NOME</ogc:PropertyName>
    <ogc:PropertyName>ras:AA01_COD_PROV_ISTAT</ogc:PropertyName>
    <ogc:PropertyName>ras:AA01_COD_REG_ISTAT</ogc:PropertyName>
    <ogc:Filter>
      <ogc:BBOX>
        <ogc:PropertyName>AA01_GEOMETRIA</ogc:PropertyName>
        <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326&quot;&gt;
          <gml:coordinates>1448374.66,4513653.33
1448384.66,4513663.33</gml:coordinates>
        </gml:Box>
      </ogc:BBOX>
    </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

And this is the response:

<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns="http://www.opengis.net/wfs&quot;
xmlns:wfs="http://www.opengis.net/wfs&quot;
xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:ras="http://www.regione.sardegna.it"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.regione.sardegna.it
http://coreweb2.corenet.it:80/geoserver/wfs/DescribeFeatureType?typeName=ras:IDT_AA01G_COMUNI
http://www.opengis.net/wfs
http://coreweb2.corenet.it:80/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd&quot;&gt;
  <gml:boundedBy>
    <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#3003&quot;&gt;
      <gml:coordinates xmlns:gml="http://www.opengis.net/gml&quot;
decimal="." cs="," ts=" ">1426638,4500228.5
1469937.38,4524490</gml:coordinates>
    </gml:Box>
  </gml:boundedBy>
  <gml:featureMember>
    <ras:IDT_AA01G_COMUNI fid="IDT_AA01G_COMUNI.090064">
      <gml:boundedBy>
        <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#3003&quot;&gt;
          <gml:coordinates xmlns:gml="http://www.opengis.net/gml&quot;
decimal="." cs="," ts=" ">1426638,4500228.5
1469937.38,4524490</gml:coordinates>
        </gml:Box>
      </gml:boundedBy>
      <ras:AA01_NOME>SASSARI</ras:AA01_NOME>
      <ras:AA01_COD_PROV_ISTAT>090</ras:AA01_COD_PROV_ISTAT>
      <ras:AA01_COD_REG_ISTAT>20</ras:AA01_COD_REG_ISTAT>
      <ras:AA01_AREA>547384000</ras:AA01_AREA>
      <ras:AA01_PERIMETRO>170973.797</ras:AA01_PERIMETRO>
      <ras:AA01_GEOMETRIA>
        <gml:MultiPolygon
srsName="http://www.opengis.net/gml/srs/epsg.xml#3003&quot;&gt;
          <gml:polygonMember>
            <gml:Polygon>
                ....
            </gml:Polygon>
          </gml:polygonMember>
        </gml:MultiPolygon>
      </ras:AA01_GEOMETRIA>
      <ras:AA01_ID_COMUNE>47</ras:AA01_ID_COMUNE>
    </ras:IDT_AA01G_COMUNI>
  </gml:featureMember>
</wfs:FeatureCollection>

It seems the tag <ogc:PropertyName> it's not working, because I'm
getting all the properties and the GML Geometry.

Strange... hum, in any case 1.5.4 is the last release of GeoServer
1.5.x series, so there is no much point trying to understand what's
wrong. Can you try with 1.6.0-rc3 and see if the problem is still there?

Cheers
Andrea