[Geoserver-users] WFS turns strings with only number characters into real numbers

Hello,

How about this problem? In my database I have a VARCHAR column, but the characters are always just numbers. Geoserver WFS DescribeFeatureType reports about this:

  * <xs:element xmlns="http://www.w3.org/2001/XMLSchema&quot; minOccurs="0" name="PLOHKONRO" nillable="true">

    * <xs:simpleType xmlns="http://www.w3.org/2001/XMLSchema&quot;&gt;

      * <xs:restriction xmlns="http://www.w3.org/2001/XMLSchema&quot; base="xs:string">

        * <xs:maxLength xmlns="http://www.w3.org/2001/XMLSchema&quot; value="2147483647"></xs:maxLength>

        </xs:restriction>

      </xs:simpleType>

    </xs:element>

Then I send the following request with PLOHKONRO filter:

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS" version="1.0.0" maxFeatures="1000" outputFormat="GML2">
<wfs:Query xmlns:topp="http://www.openplans.org/topp&quot; typeName="topp:GIS_POLYGONS">
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName xmlns:topp="http://www.openplans.org/topp&quot;&gt;
topp:PLOHKONRO</ogc:PropertyName>
<ogc:Literal>
<![CDATA[8870234617]]>
</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

When Geoserver sends this to Oracle, the string with number character has turned into number:

  feature type: topp:GIS_POLYGONS
  filter: [ PLOHKONRO = 8.870234617E9 ]
  [properties: ALL ]

I was wondering if I should use "like" request instead, but that sends also number to Oracle:

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS" version="1.0.0" maxFeatures="1000" outputFormat="GML2">
<wfs:Query xmlns:topp="http://www.openplans.org/topp&quot; typeName="topp:GIS_POLYGONS">
<ogc:Filter>
<ogc:PropertyIsLike wildCard="*" singleChar="#" escape="!">
<ogc:PropertyName xmlns:topp="http://www.openplans.org/topp&quot;&gt;
topp:PLOHKONRO</ogc:PropertyName>
<ogc:Literal>
<![CDATA[8870234617]]>
</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

Query
  feature type: topp:GIS_POLYGONS
  filter: [ PLOHKONRO is like 8.870234617E9 ]
  [properties: ALL ]

Is there something wrong with the request that WFS client generates?

-Jukka-

Hi Jukka,

Are you sure the string is getting encoded by the number? It appears to
be the case given the string representation of the filter but if you
could turn up the logging level in geoserver you should see individual
sql statements themselves logged, and then we can know for sure.

Rahkonen Jukka wrote:

Hello,

How about this problem? In my database I have a VARCHAR column, but the characters are always just numbers. Geoserver WFS DescribeFeatureType reports about this:

  * <xs:element xmlns="http://www.w3.org/2001/XMLSchema&quot; minOccurs="0" name="PLOHKONRO" nillable="true">

    * <xs:simpleType xmlns="http://www.w3.org/2001/XMLSchema&quot;&gt;

      * <xs:restriction xmlns="http://www.w3.org/2001/XMLSchema&quot; base="xs:string">

        * <xs:maxLength xmlns="http://www.w3.org/2001/XMLSchema&quot; value="2147483647"></xs:maxLength>

        </xs:restriction>

      </xs:simpleType>

    </xs:element>

Then I send the following request with PLOHKONRO filter:

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS" version="1.0.0" maxFeatures="1000" outputFormat="GML2">
<wfs:Query xmlns:topp="http://www.openplans.org/topp&quot; typeName="topp:GIS_POLYGONS">
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName xmlns:topp="http://www.openplans.org/topp&quot;&gt;
topp:PLOHKONRO</ogc:PropertyName>
<ogc:Literal>
<![CDATA[8870234617]]>
</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

When Geoserver sends this to Oracle, the string with number character has turned into number:

  feature type: topp:GIS_POLYGONS
  filter: [ PLOHKONRO = 8.870234617E9 ]
  [properties: ALL ]

I was wondering if I should use "like" request instead, but that sends also number to Oracle:

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS" version="1.0.0" maxFeatures="1000" outputFormat="GML2">
<wfs:Query xmlns:topp="http://www.openplans.org/topp&quot; typeName="topp:GIS_POLYGONS">
<ogc:Filter>
<ogc:PropertyIsLike wildCard="*" singleChar="#" escape="!">
<ogc:PropertyName xmlns:topp="http://www.openplans.org/topp&quot;&gt;
topp:PLOHKONRO</ogc:PropertyName>
<ogc:Literal>
<![CDATA[8870234617]]>
</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

Query
  feature type: topp:GIS_POLYGONS
  filter: [ PLOHKONRO is like 8.870234617E9 ]
  [properties: ALL ]

Is there something wrong with the request that WFS client generates?

-Jukka-

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,464b333f299371961014482!

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

Hi Justin,

I switched logging to "ALL" and captured this SQL:
SELECT "PLOHKONRO" FROM "GIS_POLYGONS" WHERE
"PLOHKONRO" = 8.870130711E9;

Geoserver is biting this query for a long time, writes a lot into logfile and fails. Then I tried what happens with SQL*Plus. The does go through, and timing shows me 00:00:25.02.
When I changed the query to
SELECT "PLOHKONRO" FROM "GIS_POLYGONS" WHERE
"PLOHKONRO" = '8870130711';
timing was 00:00:00.01

If the former query is not totally wrong, the latter is however 2500 times faster. Should this be considered as a bug?

Regards,

-Jukka Rahkonen-

________________________________

Lähettäjä: Justin Deoliveira [mailto:jdeolive@anonymised.com]
Lähetetty: ke 16.5.2007 19:45
Vastaanottaja: Rahkonen Jukka
Kopio: geoserver-users@lists.sourceforge.net
Aihe: Re: [Geoserver-users] WFS turns strings with only number characters into real numbers

Hi Jukka,

Are you sure the string is getting encoded by the number? It appears to
be the case given the string representation of the filter but if you
could turn up the logging level in geoserver you should see individual
sql statements themselves logged, and then we can know for sure.

Rahkonen Jukka wrote:

Hello,

How about this problem? In my database I have a VARCHAR column, but the characters are always just numbers. Geoserver WFS DescribeFeatureType reports about this:

      * <xs:element xmlns="http://www.w3.org/2001/XMLSchema&quot; minOccurs="0" name="PLOHKONRO" nillable="true">

              * <xs:simpleType xmlns="http://www.w3.org/2001/XMLSchema&quot;&gt;

                      * <xs:restriction xmlns="http://www.w3.org/2001/XMLSchema&quot; base="xs:string">

                              * <xs:maxLength xmlns="http://www.w3.org/2001/XMLSchema&quot; value="2147483647"></xs:maxLength>

                              </xs:restriction>

                      </xs:simpleType>

              </xs:element>

Then I send the following request with PLOHKONRO filter:

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS" version="1.0.0" maxFeatures="1000" outputFormat="GML2">
<wfs:Query xmlns:topp="http://www.openplans.org/topp&quot; typeName="topp:GIS_POLYGONS">
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName xmlns:topp="http://www.openplans.org/topp&quot;&gt;
topp:PLOHKONRO</ogc:PropertyName>
<ogc:Literal>
<![CDATA[8870234617]]>
</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

When Geoserver sends this to Oracle, the string with number character has turned into number:

  feature type: topp:GIS_POLYGONS
  filter: [ PLOHKONRO = 8.870234617E9 ]
  [properties: ALL ]

I was wondering if I should use "like" request instead, but that sends also number to Oracle:

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS" version="1.0.0" maxFeatures="1000" outputFormat="GML2">
<wfs:Query xmlns:topp="http://www.openplans.org/topp&quot; typeName="topp:GIS_POLYGONS">
<ogc:Filter>
<ogc:PropertyIsLike wildCard="*" singleChar="#" escape="!">
<ogc:PropertyName xmlns:topp="http://www.openplans.org/topp&quot;&gt;
topp:PLOHKONRO</ogc:PropertyName>
<ogc:Literal>
<![CDATA[8870234617]]>
</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

Query
  feature type: topp:GIS_POLYGONS
  filter: [ PLOHKONRO is like 8.870234617E9 ]
  [properties: ALL ]

Is there something wrong with the request that WFS client generates?

-Jukka-

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,464b333f299371961014482!

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

Hi Jukka,

So if it is indeed getting encoded as a number and not a string then I
think that is a bug. I am surprised this problem has never come up
before. Just for reference which version of GeoServer are you using?

-Justin

Rahkonen Jukka wrote:

Hi Justin,

I switched logging to "ALL" and captured this SQL:
SELECT "PLOHKONRO" FROM "GIS_POLYGONS" WHERE
"PLOHKONRO" = 8.870130711E9;

Geoserver is biting this query for a long time, writes a lot into logfile and fails. Then I tried what happens with SQL*Plus. The does go through, and timing shows me 00:00:25.02.
When I changed the query to
SELECT "PLOHKONRO" FROM "GIS_POLYGONS" WHERE
"PLOHKONRO" = '8870130711';
timing was 00:00:00.01

If the former query is not totally wrong, the latter is however 2500 times faster. Should this be considered as a bug?

Regards,

-Jukka Rahkonen-

________________________________

Lähettäjä: Justin Deoliveira [mailto:jdeolive@anonymised.com]
Lähetetty: ke 16.5.2007 19:45
Vastaanottaja: Rahkonen Jukka
Kopio: geoserver-users@lists.sourceforge.net
Aihe: Re: [Geoserver-users] WFS turns strings with only number characters into real numbers

Hi Jukka,

Are you sure the string is getting encoded by the number? It appears to
be the case given the string representation of the filter but if you
could turn up the logging level in geoserver you should see individual
sql statements themselves logged, and then we can know for sure.

Rahkonen Jukka wrote:

Hello,

How about this problem? In my database I have a VARCHAR column, but the characters are always just numbers. Geoserver WFS DescribeFeatureType reports about this:

      * <xs:element xmlns="http://www.w3.org/2001/XMLSchema&quot; minOccurs="0" name="PLOHKONRO" nillable="true">

              * <xs:simpleType xmlns="http://www.w3.org/2001/XMLSchema&quot;&gt;

                      * <xs:restriction xmlns="http://www.w3.org/2001/XMLSchema&quot; base="xs:string">

                              * <xs:maxLength xmlns="http://www.w3.org/2001/XMLSchema&quot; value="2147483647"></xs:maxLength>

                              </xs:restriction>

                      </xs:simpleType>

              </xs:element>

Then I send the following request with PLOHKONRO filter:

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS" version="1.0.0" maxFeatures="1000" outputFormat="GML2">
<wfs:Query xmlns:topp="http://www.openplans.org/topp&quot; typeName="topp:GIS_POLYGONS">
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName xmlns:topp="http://www.openplans.org/topp&quot;&gt;
topp:PLOHKONRO</ogc:PropertyName>
<ogc:Literal>
<![CDATA[8870234617]]>
</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

When Geoserver sends this to Oracle, the string with number character has turned into number:

  feature type: topp:GIS_POLYGONS
  filter: [ PLOHKONRO = 8.870234617E9 ]
  [properties: ALL ]

I was wondering if I should use "like" request instead, but that sends also number to Oracle:

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS" version="1.0.0" maxFeatures="1000" outputFormat="GML2">
<wfs:Query xmlns:topp="http://www.openplans.org/topp&quot; typeName="topp:GIS_POLYGONS">
<ogc:Filter>
<ogc:PropertyIsLike wildCard="*" singleChar="#" escape="!">
<ogc:PropertyName xmlns:topp="http://www.openplans.org/topp&quot;&gt;
topp:PLOHKONRO</ogc:PropertyName>
<ogc:Literal>
<![CDATA[8870234617]]>
</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

Query
  feature type: topp:GIS_POLYGONS
  filter: [ PLOHKONRO is like 8.870234617E9 ]
  [properties: ALL ]

Is there something wrong with the request that WFS client generates?

-Jukka-

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

!DSPAM:4007,464db8d272611336712104!

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

No, this is actually a known bug, the filter parser is very naive, it just first tries an integer, then a double, then a string. One of the biggest bugs in the old parser, and there was really no good way of fixing it, I tried easy solutions on more than one occasion and none worked, since it needed knowledge of the data.

I think the new 1.6.x parsing may fix it? Jukka, you could try out a nightly build from trunk - http://geo.openplans.org/nightly/trunk/

Chris

Justin Deoliveira wrote:

Hi Jukka,

So if it is indeed getting encoded as a number and not a string then I
think that is a bug. I am surprised this problem has never come up
before. Just for reference which version of GeoServer are you using?

-Justin

Rahkonen Jukka wrote:

Hi Justin,
I switched logging to "ALL" and captured this SQL:
SELECT "PLOHKONRO" FROM "GIS_POLYGONS" WHERE
"PLOHKONRO" = 8.870130711E9;

Geoserver is biting this query for a long time, writes a lot into logfile and fails. Then I tried what happens with SQL*Plus. The does go through, and timing shows me 00:00:25.02.
When I changed the query to
SELECT "PLOHKONRO" FROM "GIS_POLYGONS" WHERE
"PLOHKONRO" = '8870130711';
timing was 00:00:00.01
If the former query is not totally wrong, the latter is however 2500 times faster. Should this be considered as a bug?
Regards,
-Jukka Rahkonen-

________________________________

Lähettäjä: Justin Deoliveira [mailto:jdeolive@anonymised.com]
Lähetetty: ke 16.5.2007 19:45
Vastaanottaja: Rahkonen Jukka
Kopio: geoserver-users@lists.sourceforge.net
Aihe: Re: [Geoserver-users] WFS turns strings with only number characters into real numbers

Hi Jukka,

Are you sure the string is getting encoded by the number? It appears to
be the case given the string representation of the filter but if you
could turn up the logging level in geoserver you should see individual
sql statements themselves logged, and then we can know for sure.

Rahkonen Jukka wrote:

Hello,

How about this problem? In my database I have a VARCHAR column, but the characters are always just numbers. Geoserver WFS DescribeFeatureType reports about this:

      * <xs:element xmlns="http://www.w3.org/2001/XMLSchema&quot; minOccurs="0" name="PLOHKONRO" nillable="true">

              * <xs:simpleType xmlns="http://www.w3.org/2001/XMLSchema&quot;&gt;

                      * <xs:restriction xmlns="http://www.w3.org/2001/XMLSchema&quot; base="xs:string">

                              * <xs:maxLength xmlns="http://www.w3.org/2001/XMLSchema&quot; value="2147483647"></xs:maxLength>

                              </xs:restriction>

                      </xs:simpleType>

              </xs:element>

Then I send the following request with PLOHKONRO filter:

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS" version="1.0.0" maxFeatures="1000" outputFormat="GML2">
<wfs:Query xmlns:topp="http://www.openplans.org/topp&quot; typeName="topp:GIS_POLYGONS">
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName xmlns:topp="http://www.openplans.org/topp&quot;&gt;
topp:PLOHKONRO</ogc:PropertyName>
<ogc:Literal>
<![CDATA[8870234617]]>
</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

When Geoserver sends this to Oracle, the string with number character has turned into number:

  feature type: topp:GIS_POLYGONS
  filter: [ PLOHKONRO = 8.870234617E9 ]
  [properties: ALL ]

I was wondering if I should use "like" request instead, but that sends also number to Oracle:

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS" version="1.0.0" maxFeatures="1000" outputFormat="GML2">
<wfs:Query xmlns:topp="http://www.openplans.org/topp&quot; typeName="topp:GIS_POLYGONS">
<ogc:Filter>
<ogc:PropertyIsLike wildCard="*" singleChar="#" escape="!">
<ogc:PropertyName xmlns:topp="http://www.openplans.org/topp&quot;&gt;
topp:PLOHKONRO</ogc:PropertyName>
<ogc:Literal>
<![CDATA[8870234617]]>
</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

Query
  feature type: topp:GIS_POLYGONS
  filter: [ PLOHKONRO is like 8.870234617E9 ]
  [properties: ALL ]

Is there something wrong with the request that WFS client generates?

-Jukka-

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

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

Ahh, ok. Well the new parser doesn't fix it directely, but the
expression improvements we made on trunk do. I ran into this problem for
ows4 with postgis as well. I had to make the sql encoding code a bit
smarter and do conversions from the "raw literal" created by the parser
to the actual type of the database column. The change was made to the
base sql encoder class so it should apply to all datastores.

So yeah... Jukka, I recommend you try 1.6.x. Hopefully the enhancements
there fix the problem.

-Justin

Chris Holmes wrote:

No, this is actually a known bug, the filter parser is very naive, it
just first tries an integer, then a double, then a string. One of the
biggest bugs in the old parser, and there was really no good way of
fixing it, I tried easy solutions on more than one occasion and none
worked, since it needed knowledge of the data.

I think the new 1.6.x parsing may fix it? Jukka, you could try out a
nightly build from trunk - http://geo.openplans.org/nightly/trunk/

Chris

Justin Deoliveira wrote:

Hi Jukka,

So if it is indeed getting encoded as a number and not a string then I
think that is a bug. I am surprised this problem has never come up
before. Just for reference which version of GeoServer are you using?

-Justin

Rahkonen Jukka wrote:

Hi Justin,

I switched logging to "ALL" and captured this SQL:
SELECT "PLOHKONRO" FROM "GIS_POLYGONS" WHERE
"PLOHKONRO" = 8.870130711E9;

Geoserver is biting this query for a long time, writes a lot into
logfile and fails. Then I tried what happens with SQL*Plus. The
does go through, and timing shows me 00:00:25.02.
When I changed the query to
SELECT "PLOHKONRO" FROM "GIS_POLYGONS" WHERE
"PLOHKONRO" = '8870130711';
timing was 00:00:00.01

If the former query is not totally wrong, the latter is however 2500
times faster. Should this be considered as a bug?

Regards,

-Jukka Rahkonen-

________________________________

Lähettäjä: Justin Deoliveira [mailto:jdeolive@anonymised.com]
Lähetetty: ke 16.5.2007 19:45
Vastaanottaja: Rahkonen Jukka
Kopio: geoserver-users@lists.sourceforge.net
Aihe: Re: [Geoserver-users] WFS turns strings with only number
characters into real numbers

Hi Jukka,

Are you sure the string is getting encoded by the number? It appears to
be the case given the string representation of the filter but if you
could turn up the logging level in geoserver you should see individual
sql statements themselves logged, and then we can know for sure.

Rahkonen Jukka wrote:

Hello,

How about this problem? In my database I have a VARCHAR column, but
the characters are always just numbers. Geoserver WFS
DescribeFeatureType reports about this:

      * <xs:element xmlns="http://www.w3.org/2001/XMLSchema&quot;
minOccurs="0" name="PLOHKONRO" nillable="true">

              * <xs:simpleType
xmlns="http://www.w3.org/2001/XMLSchema&quot;&gt;

                      * <xs:restriction
xmlns="http://www.w3.org/2001/XMLSchema&quot; base="xs:string">

                              * <xs:maxLength
xmlns="http://www.w3.org/2001/XMLSchema&quot;
value="2147483647"></xs:maxLength>

                              </xs:restriction>

                      </xs:simpleType>

              </xs:element>

Then I send the following request with PLOHKONRO filter:

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc&quot;
xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS" version="1.0.0"
maxFeatures="1000" outputFormat="GML2">
<wfs:Query xmlns:topp="http://www.openplans.org/topp&quot;
typeName="topp:GIS_POLYGONS">
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName xmlns:topp="http://www.openplans.org/topp&quot;&gt;
topp:PLOHKONRO</ogc:PropertyName>
<ogc:Literal>
<![CDATA[8870234617]]>
</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

When Geoserver sends this to Oracle, the string with number
character has turned into number:

  feature type: topp:GIS_POLYGONS
  filter: [ PLOHKONRO = 8.870234617E9 ]
  [properties: ALL ]

I was wondering if I should use "like" request instead, but that
sends also number to Oracle:

<?xml version="1.0" encoding="ISO-8859-1"?>
<wfs:GetFeature xmlns:ogc="http://www.opengis.net/ogc&quot;
xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS" version="1.0.0"
maxFeatures="1000" outputFormat="GML2">
<wfs:Query xmlns:topp="http://www.openplans.org/topp&quot;
typeName="topp:GIS_POLYGONS">
<ogc:Filter>
<ogc:PropertyIsLike wildCard="*" singleChar="#" escape="!">
<ogc:PropertyName xmlns:topp="http://www.openplans.org/topp&quot;&gt;
topp:PLOHKONRO</ogc:PropertyName>
<ogc:Literal>
<![CDATA[8870234617]]>
</ogc:Literal>
</ogc:PropertyIsLike>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

Query
  feature type: topp:GIS_POLYGONS
  filter: [ PLOHKONRO is like 8.870234617E9 ]
  [properties: ALL ]

Is there something wrong with the request that WFS client generates?
-Jukka-

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

This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com