[Geoserver-users] ogc:filter and gml:coordinates: NumberFormatException


Hi,

I’m using Geoserver 1.7.4. and I’m trying to call a WFS service using a BBOX filter but I always get a “NumberFormatException”. The filter that I’m using is:

ogc:Filter
ogc:BBOX
ogc:PropertyNamelocation</ogc:PropertyName>
<gml:Box srsName=“EPSG:4326”>
<gml:coordinates decimal=“.” cs=“,” ts=“”>-17.2,28.1 -17.1,28.2</gml:coordinates>
</gml:Box>
</ogc:BBOX>
</ogc:Filter>

And geoserver returns the following message:

<ows:Exception exceptionCode=“NoApplicableCode”>
ows:ExceptionTextjava.lang.RuntimeException: Parsing
failed for coordinates:
java.lang.NumberFormatException: For input string:
&quot;28.1 -17.1&quot; Parsing failed for
coordinates: java.lang.NumberFormatException: For
input string: &quot;28.1 -17.1&quot; For input
string: &quot;28.1 -17.1&quot;</ows:ExceptionText>
</ows:Exception>

If I don’t specify the “decimal”, “cs” and “ts” attributes I get a “NullPointerException”.
On the other hand, the WFS service works fine if I specify other types of filters and fields.

Is there something wrong with my code?

Thank you for your help.

Regards,

A. Diaz.

Hi Antonio,

Does your request specify explicitly version 1.0.0 of WFS? If not specified GeoServer will default to WFS 1.1, in which the syntax for a bounding box is different.

-Justin

Antonio Diaz Sanchez wrote:

   Hi,

   I'm using Geoserver 1.7.4. and I'm trying to call a WFS service using a BBOX filter but I always get a "NumberFormatException". The filter that I'm using is:

<ogc:Filter>
      <ogc:BBOX>
         <ogc:PropertyName>location</ogc:PropertyName>
         <gml:Box srsName="EPSG:4326">
            <gml:coordinates decimal="." cs="," ts="">-17.2,28.1 -17.1,28.2</gml:coordinates>
         </gml:Box>
      </ogc:BBOX>
</ogc:Filter>

And geoserver returns the following message:

  <ows:Exception exceptionCode="NoApplicableCode">
    <ows:ExceptionText>java.lang.RuntimeException: Parsing
      failed for coordinates:
      java.lang.NumberFormatException: For input string:
      &amp;quot;28.1 -17.1&amp;quot; Parsing failed for
      coordinates: java.lang.NumberFormatException: For
      input string: &amp;quot;28.1 -17.1&amp;quot; For input
      string: &amp;quot;28.1 -17.1&amp;quot;</ows:ExceptionText>
  </ows:Exception>

If I don't specify the "decimal", "cs" and "ts" attributes I get a "NullPointerException".
On the other hand, the WFS service works fine if I specify other types of filters and fields.

Is there something wrong with my code?

   Thank you for your help.

   Regards,

A. Diaz.

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

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects

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

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

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Hi Antonio,

this one was pending for moderation, and since it´s already answered on the GeoServer-spanish mailing list I'll just point out the problem was using filter 1.0 BBOX syntax on a 1.1 WFS.

Cheers,

Gabriel

Antonio Diaz Sanchez wrote:

   Hi,

   I'm using Geoserver 1.7.4. and I'm trying to call a WFS service using a BBOX filter but I always get a "NumberFormatException". The filter that I'm using is:

<ogc:Filter>
      <ogc:BBOX>
         <ogc:PropertyName>location</ogc:PropertyName>
         <gml:Box srsName="EPSG:4326">
            <gml:coordinates decimal="." cs="," ts="">-17.2,28.1 -17.1,28.2</gml:coordinates>
         </gml:Box>
      </ogc:BBOX>
</ogc:Filter>

And geoserver returns the following message:

  <ows:Exception exceptionCode="NoApplicableCode">
    <ows:ExceptionText>java.lang.RuntimeException: Parsing
      failed for coordinates:
      java.lang.NumberFormatException: For input string:
      &amp;quot;28.1 -17.1&amp;quot; Parsing failed for
      coordinates: java.lang.NumberFormatException: For
      input string: &amp;quot;28.1 -17.1&amp;quot; For input
      string: &amp;quot;28.1 -17.1&amp;quot;</ows:ExceptionText>
  </ows:Exception>

If I don't specify the "decimal", "cs" and "ts" attributes I get a "NullPointerException".
On the other hand, the WFS service works fine if I specify other types of filters and fields.

Is there something wrong with my code?

   Thank you for your help.

   Regards,

A. Diaz.

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

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects

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

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

--
Gabriel Roldan
OpenGeo - http://opengeo.org
Expert service straight from the developers.