RE: [Geoserver-devel] Spatial filter for KVP GetFeature request

At a first look, it seems as the tipical HTTP GET method's request encoding
issue.

When accessing content thru GET method, you need to "HTTP encode" the
values. I mean,
you shouldn't encode the whole query string, but every parameter value
separately, so
the server gets a well formed request.

May be in you example it would be enough just replacing the ":" symbols by
"%3A".
But it would be better if from your client you URL encode every request
parameter value.
If your client is javascript based, you can do it by applying the
escape(str) js function
(i.e:
var escapedFilter =
escape("<Filter><BBOX><PropertyName>GEOMETRY</PropertyName>" +
  
"<Box%20srsName="EPSG:8311"><gml:coordinates>137,-30%20157,-25</gml:coordina
tes>" +
        "</Box></BBOX></Filter>";

var url =
"http://kimba:8081/geoserver/wfs?request=GetFeature&typename=qldrstn&filter=
" + escapedFilter;
)

if your client is java based, just use java.net.URLEncoder class to encode
param values.

hope this helps,

gabriel

-----Mensaje original-----
De: Bronwyn Cook [mailto:bronwyn@anonymised.com]
Enviado el: viernes, 19 de diciembre de 2003 5:19
Para: geoserver-devel@lists.sourceforge.net
Asunto: [Geoserver-devel] Spatial filter for KVP GetFeature request

Hello,

I have been trying to get Geoserver 1.0.1 to work with a spatial filter and
keep on getting the following error message:

193268 [FINER] org.vfny.geoserver.requests.RequestKvpReader - clean request
is
request=GetFeature&typename=qldrstn&filter=<Filter><BBOX><PropertyName>GEOME
TRY<
/PropertyName><Box srsName="EPSG:8311"><gml:coordinates>137,-30
157,-25</gml:coo
rdinates></Box></BBOX></Filter>
193278 [FINER] org.vfny.geoserver.requests.DispatcherKvpReader - dispatcher
got
request GetFeature
193278 [FINER] org.vfny.geoserver.servlets.Dispatcher - req_type is 3
LOGGING - Got GetFeature Request
193278 [FINER] org.vfny.geoserver.requests.RequestKvpReader - clean request
is
request=GetFeature&typename=qldrstn&filter=<Filter><BBOX><PropertyName>GEOME
TRY<
/PropertyName><Box srsName="EPSG:8311"><gml:coordinates>137,-30
157,-25</gml:coo
rdinates></Box></BBOX></Filter>
193278 [FINER] org.geotools.filter.LogicSAXParser - made new logic factory
193278 [FINER] SubHandlerFactory - ENTRY
193278 [FINER] SubHandlerFactory - RETURN
193278 [FINER] GMLFilterDocument - ENTRY
org.geotools.gml.GMLFilterGeometry@anonymised.com
ec4
193278 [FINER] GMLFilterDocument - RETURN
193288 [FINER] GMLFilterDocument - ENTRY Filter Filter
org.xml.sax.helpers.Att
ributesImpl@anonymised.com
193288 [FINER] org.geotools.filter.FilterFilter - found start element:
Filter
193288 [FINER] GMLFilterDocument - RETURN
193288 [FINER] GMLFilterDocument - ENTRY BBOX BBOX
org.xml.sax.helpers.Attribu
tesImpl@anonymised.com
193288 [FINER] org.geotools.filter.FilterFilter - found start element: BBOX
193288 [FINER] AbstractFilter - ENTRY 4
193288 [FINER] org.geotools.filter.FilterFilter - found a simple filter
start
193298 [FINER] GMLFilterDocument - RETURN
193298 [FINER] GMLFilterDocument - ENTRY PropertyName PropertyName
org.xml.sax
.helpers.AttributesImpl@anonymised.com
193298 [FINER] org.geotools.filter.FilterFilter - found start element:
Property
Name
193298 [FINER] AbstractFilter - ENTRY 101
193298 [FINER] org.geotools.filter.ExpressionSAXParser - incoming type:
Propert
yName
193298 [FINER] org.geotools.filter.ExpressionSAXParser - declared type:
null
193298 [FINER] org.geotools.filter.ExpressionSAXParser - current state:
null
193308 [FINER] org.geotools.filter.ExpressionSAXParser - is attribute
expressio
n
193308 [FINER] GMLFilterDocument - RETURN
193308 [FINER] GMLFilterDocument - ENTRY [C@anonymised.com 28 8
193308 [FINER] org.geotools.filter.ExpressionSAXParser - incoming message:
GEOM
ETRY
193308 [FINER] org.geotools.filter.ExpressionSAXParser - should read chars:
tru
e
193318 [FINER] org.geotools.filter.ExpressionSAXParser - ...
193318 [FINER] org.geotools.filter.ExpressionSAXParser - setting attribute
expr
ession: GEOMETRY
193318 [FINER] ExpressionAttribute - ENTRY GEOMETRY
193318 [FINER] org.geotools.filter.ExpressionSAXParser - ...
193318 [FINER] org.geotools.filter.ExpressionSAXParser - ...
193318 [FINER] GMLFilterDocument - RETURN
193318 [FINER] GMLFilterDocument - ENTRY PropertyName PropertyName
193318 [FINER] org.geotools.filter.FilterFilter - found start element:
Property
Name
193328 [FINER] AbstractFilter - ENTRY 101
193328 [FINER] org.geotools.filter.FilterFilter - found an expression
filter en
d
193328 [FINER] org.geotools.filter.ExpressionSAXParser - declared type:
Propert
yName
193328 [FINER] org.geotools.filter.ExpressionSAXParser - end message:
PropertyN
ame
193328 [FINER] org.geotools.filter.ExpressionSAXParser - current state:
complet
e
193338 [FINER] org.geotools.filter.FilterFilter - expression factory is
ready
193338 [FINER] org.geotools.filter.ExpressionSAXParser - about to create
expres
sion: GEOMETRY
193338 [FINER] org.geotools.filter.FilterSAXParser - current state (end):
right
Value
193338 [FINER] GMLFilterDocument - RETURN
193338 [FINER] GMLFilterDocument - ENTRY Box Box
org.xml.sax.helpers.Attribute
sImpl@anonymised.com
193338 [FINER] org.geotools.filter.FilterFilter - found start element: Box
193338 [FINER] AbstractFilter - ENTRY -1
193348 [FINER] GMLFilterDocument - RETURN
193348 [FINER] GMLFilterDocument - ENTRY null null gml:coordinates
org.xml.sax.
helpers.AttributesImpl@anonymised.com
193348 [FINE] org.vfny.geoserver.responses.WfsException - >
[org.vfny.geoserver
.requests.XmlRequestReader]:
  XML getFeature request SAX parsing error: java.lang.NullPointerException
193348 [FINE] org.vfny.geoserver.responses.WfsException - return wfs
exception
is <?xml version="1.0" ?>
<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://kimba:8081/geoserver/da
ta/capabilities/wfs/1.0.0/OGC-exception.xsd">
   <ServiceException locator="org.vfny.geoserver.requests.XmlRequestReader">
      XML getFeature request SAX parsing error:
java.lang.NullPointerException
   </ServiceException>
</ServiceExceptionReport>

The URL I was trying to call was:

http://kimba:8081/geoserver/wfs?request=GetFeature&typename=qldrstn&filter=&lt;
Filter><BBOX><PropertyName>GEOMETRY</PropertyName><Box%20srsName="EPSG:8311"

<gml:coordinates>137,-30%20157,-25</gml:coordinates></Box></BBOX></Filter>

I am able to perform other non-spatial filters with no problems (the example
below works fine)
http://kimba:8081/geoserver/wfs?request=GetFeature&typename=qldrstn&filter=&lt;
Filter><PropertyIsEqualTo><PropertyName>QLDRSTN_ID</PropertyName><Literal>6<
/Literal></PropertyIsEqualTo></Filter>

What am I doing wrong?

Thanks
Bronwyn

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Actually it looks like geoserver is reading the values correctly, as the
cleaned string looks right. I think the problem is that you don't define
the gml namespace, which the geotools filter parser looks for (and is also
required by the spec, they just leave off them off of most of the
examples so they aren't really long).

So it should be:

request=GetFeature&typename=qldrstn&filter=<Filter
xmlns:gml="http://www.opengis.net/gml&quot;&gt;&lt;BBOX&gt;&lt;PropertyName&gt;GEOMETRY&lt;/PropertyName&gt;&lt;Box
srsName="EPSG:8311"><gml:coordinates>137,-30 157,-25</gml:coordinates></Box></BBOX></Filter>

To be technically correct the filter namespace should be declared as well,
but our code doesn't require that, just that gml is defined.

This problem comes from mixing xml with kvps, we recommend using Xml
requests as much as possible. But if you add the gml namespace your
request should work.

Chris

On Fri, 19 Dec 2003, ROLDAN, Gabriel raul wrote:

At a first look, it seems as the tipical HTTP GET method's request encoding
issue.

When accessing content thru GET method, you need to "HTTP encode" the
values. I mean,
you shouldn't encode the whole query string, but every parameter value
separately, so
the server gets a well formed request.

May be in you example it would be enough just replacing the ":" symbols by
"%3A".
But it would be better if from your client you URL encode every request
parameter value.
If your client is javascript based, you can do it by applying the
escape(str) js function
(i.e:
var escapedFilter =
escape("<Filter><BBOX><PropertyName>GEOMETRY</PropertyName>" +
  
"<Box%20srsName="EPSG:8311"><gml:coordinates>137,-30%20157,-25</gml:coordina
tes>" +
        "</Box></BBOX></Filter>";

var url =
"http://kimba:8081/geoserver/wfs?request=GetFeature&typename=qldrstn&filter=
" + escapedFilter;
)

if your client is java based, just use java.net.URLEncoder class to encode
param values.

hope this helps,

gabriel

-----Mensaje original-----
De: Bronwyn Cook [mailto:bronwyn@anonymised.com]
Enviado el: viernes, 19 de diciembre de 2003 5:19
Para: geoserver-devel@lists.sourceforge.net
Asunto: [Geoserver-devel] Spatial filter for KVP GetFeature request

Hello,

I have been trying to get Geoserver 1.0.1 to work with a spatial filter and
keep on getting the following error message:

193268 [FINER] org.vfny.geoserver.requests.RequestKvpReader - clean request
is
request=GetFeature&typename=qldrstn&filter=<Filter><BBOX><PropertyName>GEOME
TRY<
/PropertyName><Box srsName="EPSG:8311"><gml:coordinates>137,-30
157,-25</gml:coo
rdinates></Box></BBOX></Filter>
193278 [FINER] org.vfny.geoserver.requests.DispatcherKvpReader - dispatcher
got
request GetFeature
193278 [FINER] org.vfny.geoserver.servlets.Dispatcher - req_type is 3
LOGGING - Got GetFeature Request
193278 [FINER] org.vfny.geoserver.requests.RequestKvpReader - clean request
is
request=GetFeature&typename=qldrstn&filter=<Filter><BBOX><PropertyName>GEOME
TRY<
/PropertyName><Box srsName="EPSG:8311"><gml:coordinates>137,-30
157,-25</gml:coo
rdinates></Box></BBOX></Filter>
193278 [FINER] org.geotools.filter.LogicSAXParser - made new logic factory
193278 [FINER] SubHandlerFactory - ENTRY
193278 [FINER] SubHandlerFactory - RETURN
193278 [FINER] GMLFilterDocument - ENTRY
org.geotools.gml.GMLFilterGeometry@anonymised.com
ec4
193278 [FINER] GMLFilterDocument - RETURN
193288 [FINER] GMLFilterDocument - ENTRY Filter Filter
org.xml.sax.helpers.Att
ributesImpl@anonymised.com
193288 [FINER] org.geotools.filter.FilterFilter - found start element:
Filter
193288 [FINER] GMLFilterDocument - RETURN
193288 [FINER] GMLFilterDocument - ENTRY BBOX BBOX
org.xml.sax.helpers.Attribu
tesImpl@anonymised.com
193288 [FINER] org.geotools.filter.FilterFilter - found start element: BBOX
193288 [FINER] AbstractFilter - ENTRY 4
193288 [FINER] org.geotools.filter.FilterFilter - found a simple filter
start
193298 [FINER] GMLFilterDocument - RETURN
193298 [FINER] GMLFilterDocument - ENTRY PropertyName PropertyName
org.xml.sax
.helpers.AttributesImpl@anonymised.com
193298 [FINER] org.geotools.filter.FilterFilter - found start element:
Property
Name
193298 [FINER] AbstractFilter - ENTRY 101
193298 [FINER] org.geotools.filter.ExpressionSAXParser - incoming type:
Propert
yName
193298 [FINER] org.geotools.filter.ExpressionSAXParser - declared type:
null
193298 [FINER] org.geotools.filter.ExpressionSAXParser - current state:
null
193308 [FINER] org.geotools.filter.ExpressionSAXParser - is attribute
expressio
n
193308 [FINER] GMLFilterDocument - RETURN
193308 [FINER] GMLFilterDocument - ENTRY [C@anonymised.com 28 8
193308 [FINER] org.geotools.filter.ExpressionSAXParser - incoming message:
GEOM
ETRY
193308 [FINER] org.geotools.filter.ExpressionSAXParser - should read chars:
tru
e
193318 [FINER] org.geotools.filter.ExpressionSAXParser - ...
193318 [FINER] org.geotools.filter.ExpressionSAXParser - setting attribute
expr
ession: GEOMETRY
193318 [FINER] ExpressionAttribute - ENTRY GEOMETRY
193318 [FINER] org.geotools.filter.ExpressionSAXParser - ...
193318 [FINER] org.geotools.filter.ExpressionSAXParser - ...
193318 [FINER] GMLFilterDocument - RETURN
193318 [FINER] GMLFilterDocument - ENTRY PropertyName PropertyName
193318 [FINER] org.geotools.filter.FilterFilter - found start element:
Property
Name
193328 [FINER] AbstractFilter - ENTRY 101
193328 [FINER] org.geotools.filter.FilterFilter - found an expression
filter en
d
193328 [FINER] org.geotools.filter.ExpressionSAXParser - declared type:
Propert
yName
193328 [FINER] org.geotools.filter.ExpressionSAXParser - end message:
PropertyN
ame
193328 [FINER] org.geotools.filter.ExpressionSAXParser - current state:
complet
e
193338 [FINER] org.geotools.filter.FilterFilter - expression factory is
ready
193338 [FINER] org.geotools.filter.ExpressionSAXParser - about to create
expres
sion: GEOMETRY
193338 [FINER] org.geotools.filter.FilterSAXParser - current state (end):
right
Value
193338 [FINER] GMLFilterDocument - RETURN
193338 [FINER] GMLFilterDocument - ENTRY Box Box
org.xml.sax.helpers.Attribute
sImpl@anonymised.com
193338 [FINER] org.geotools.filter.FilterFilter - found start element: Box
193338 [FINER] AbstractFilter - ENTRY -1
193348 [FINER] GMLFilterDocument - RETURN
193348 [FINER] GMLFilterDocument - ENTRY null null gml:coordinates
org.xml.sax.
helpers.AttributesImpl@anonymised.com
193348 [FINE] org.vfny.geoserver.responses.WfsException - >
[org.vfny.geoserver
.requests.XmlRequestReader]:
  XML getFeature request SAX parsing error: java.lang.NullPointerException
193348 [FINE] org.vfny.geoserver.responses.WfsException - return wfs
exception
is <?xml version="1.0" ?>
<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://kimba:8081/geoserver/da
ta/capabilities/wfs/1.0.0/OGC-exception.xsd">
   <ServiceException locator="org.vfny.geoserver.requests.XmlRequestReader">
      XML getFeature request SAX parsing error:
java.lang.NullPointerException
   </ServiceException>
</ServiceExceptionReport>

The URL I was trying to call was:

http://kimba:8081/geoserver/wfs?request=GetFeature&typename=qldrstn&filter=&lt;
Filter><BBOX><PropertyName>GEOMETRY</PropertyName><Box%20srsName="EPSG:8311"
><gml:coordinates>137,-30%20157,-25</gml:coordinates></Box></BBOX></Filter>

I am able to perform other non-spatial filters with no problems (the example
below works fine)
http://kimba:8081/geoserver/wfs?request=GetFeature&typename=qldrstn&filter=&lt;
Filter><PropertyIsEqualTo><PropertyName>QLDRSTN_ID</PropertyName><Literal>6<
/Literal></PropertyIsEqualTo></Filter>

What am I doing wrong?

Thanks
Bronwyn

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--

Thanks for the quick response.

I tried the KVP request as prescribed below but still no luck (still get the
NullPointerException). I have a feeling that this problem is to do with how
I am specifying the BBOX filter, as other non-spatial queries I have tried
(eg. PropertyIsEqualTo) have worked fine.

I took your recommendation and tried sending the request via XML (POST)
however I still got the NullPointerException. Once again though, I could
send GetFeature requests that have non-spatial filtering via the XML POST
method with no problems. The (bad) XML I sent was:

<?xml version='1.0' encoding='UTF-8'?>
<GetFeature outputFormat='GML2' handle='myQuery' maxFeatures='100'>
<Query handle='myQuery2' typeName='qldrstn'>
  <Filter xmlns:gml="http://www.opengis.net/gml&quot;&gt;
   <BBOX>
    <PropertyName>GEOMETRY</PropertyName>
    <Box srsName="http://www.opengis.net/gml/srs/epsg.xml#8311&quot;&gt;
     <gml:coordinates>137,-30 157,-25</gml:coordinates>
    </Box>
   </BBOX>
  </Filter>
</Query>
</GetFeature>

Could you please let me know if you can see anything wrong with this
request? Do you have an example spatial request that you know works that I
could try?

Thanks
Bronwyn

-----Original Message-----
From: geoserver-devel-admin@lists.sourceforge.net
[mailto:geoserver-devel-admin@lists.sourceforge.net]On Behalf Of Chris
Holmes
Sent: Saturday, 20 December 2003 2:33 AM
To: ROLDAN, Gabriel raul
Cc: 'Bronwyn Cook'; geoserver-devel@lists.sourceforge.net
Subject: RE: [Geoserver-devel] Spatial filter for KVP GetFeature request

Actually it looks like geoserver is reading the values correctly, as the
cleaned string looks right. I think the problem is that you don't define
the gml namespace, which the geotools filter parser looks for (and is also
required by the spec, they just leave off them off of most of the
examples so they aren't really long).

So it should be:

request=GetFeature&typename=qldrstn&filter=<Filter
xmlns:gml="http://www.opengis.net/gml&quot;&gt;&lt;BBOX&gt;&lt;PropertyName&gt;GEOMETRY&lt;/Propert
yName><Box
srsName="EPSG:8311"><gml:coordinates>137,-30
157,-25</gml:coordinates></Box></BBOX></Filter>

To be technically correct the filter namespace should be declared as well,
but our code doesn't require that, just that gml is defined.

This problem comes from mixing xml with kvps, we recommend using Xml
requests as much as possible. But if you add the gml namespace your
request should work.

Chris

On Fri, 19 Dec 2003, ROLDAN, Gabriel raul wrote:

At a first look, it seems as the tipical HTTP GET method's request

encoding

issue.

When accessing content thru GET method, you need to "HTTP encode" the
values. I mean,
you shouldn't encode the whole query string, but every parameter value
separately, so
the server gets a well formed request.

May be in you example it would be enough just replacing the ":" symbols by
"%3A".
But it would be better if from your client you URL encode every request
parameter value.
If your client is javascript based, you can do it by applying the
escape(str) js function
(i.e:
var escapedFilter =
escape("<Filter><BBOX><PropertyName>GEOMETRY</PropertyName>" +

"<Box%20srsName="EPSG:8311"><gml:coordinates>137,-30%20157,-25</gml:coordina

tes>" +
        "</Box></BBOX></Filter>";

var url =

"http://kimba:8081/geoserver/wfs?request=GetFeature&typename=qldrstn&filter=

" + escapedFilter;
)

if your client is java based, just use java.net.URLEncoder class to encode
param values.

hope this helps,

gabriel

-----Mensaje original-----
De: Bronwyn Cook [mailto:bronwyn@anonymised.com]
Enviado el: viernes, 19 de diciembre de 2003 5:19
Para: geoserver-devel@lists.sourceforge.net
Asunto: [Geoserver-devel] Spatial filter for KVP GetFeature request

Hello,

I have been trying to get Geoserver 1.0.1 to work with a spatial filter

and

keep on getting the following error message:

193268 [FINER] org.vfny.geoserver.requests.RequestKvpReader - clean

request

is

request=GetFeature&typename=qldrstn&filter=<Filter><BBOX><PropertyName>GEOME

TRY<
/PropertyName><Box srsName="EPSG:8311"><gml:coordinates>137,-30
157,-25</gml:coo
rdinates></Box></BBOX></Filter>
193278 [FINER] org.vfny.geoserver.requests.DispatcherKvpReader -

dispatcher

got
request GetFeature
193278 [FINER] org.vfny.geoserver.servlets.Dispatcher - req_type is 3
LOGGING - Got GetFeature Request
193278 [FINER] org.vfny.geoserver.requests.RequestKvpReader - clean

request

is

request=GetFeature&typename=qldrstn&filter=<Filter><BBOX><PropertyName>GEOME

TRY<
/PropertyName><Box srsName="EPSG:8311"><gml:coordinates>137,-30
157,-25</gml:coo
rdinates></Box></BBOX></Filter>
193278 [FINER] org.geotools.filter.LogicSAXParser - made new logic

factory

193278 [FINER] SubHandlerFactory - ENTRY
193278 [FINER] SubHandlerFactory - RETURN
193278 [FINER] GMLFilterDocument - ENTRY
org.geotools.gml.GMLFilterGeometry@anonymised.com
ec4
193278 [FINER] GMLFilterDocument - RETURN
193288 [FINER] GMLFilterDocument - ENTRY Filter Filter
org.xml.sax.helpers.Att
ributesImpl@anonymised.com
193288 [FINER] org.geotools.filter.FilterFilter - found start element:
Filter
193288 [FINER] GMLFilterDocument - RETURN
193288 [FINER] GMLFilterDocument - ENTRY BBOX BBOX
org.xml.sax.helpers.Attribu
tesImpl@anonymised.com
193288 [FINER] org.geotools.filter.FilterFilter - found start element:

BBOX

193288 [FINER] AbstractFilter - ENTRY 4
193288 [FINER] org.geotools.filter.FilterFilter - found a simple filter
start
193298 [FINER] GMLFilterDocument - RETURN
193298 [FINER] GMLFilterDocument - ENTRY PropertyName PropertyName
org.xml.sax
.helpers.AttributesImpl@anonymised.com
193298 [FINER] org.geotools.filter.FilterFilter - found start element:
Property
Name
193298 [FINER] AbstractFilter - ENTRY 101
193298 [FINER] org.geotools.filter.ExpressionSAXParser - incoming type:
Propert
yName
193298 [FINER] org.geotools.filter.ExpressionSAXParser - declared type:
null
193298 [FINER] org.geotools.filter.ExpressionSAXParser - current state:
null
193308 [FINER] org.geotools.filter.ExpressionSAXParser - is attribute
expressio
n
193308 [FINER] GMLFilterDocument - RETURN
193308 [FINER] GMLFilterDocument - ENTRY [C@anonymised.com 28 8
193308 [FINER] org.geotools.filter.ExpressionSAXParser - incoming

message:

GEOM
ETRY
193308 [FINER] org.geotools.filter.ExpressionSAXParser - should read

chars:

tru
e
193318 [FINER] org.geotools.filter.ExpressionSAXParser - ...
193318 [FINER] org.geotools.filter.ExpressionSAXParser - setting

attribute

expr
ession: GEOMETRY
193318 [FINER] ExpressionAttribute - ENTRY GEOMETRY
193318 [FINER] org.geotools.filter.ExpressionSAXParser - ...
193318 [FINER] org.geotools.filter.ExpressionSAXParser - ...
193318 [FINER] GMLFilterDocument - RETURN
193318 [FINER] GMLFilterDocument - ENTRY PropertyName PropertyName
193318 [FINER] org.geotools.filter.FilterFilter - found start element:
Property
Name
193328 [FINER] AbstractFilter - ENTRY 101
193328 [FINER] org.geotools.filter.FilterFilter - found an expression
filter en
d
193328 [FINER] org.geotools.filter.ExpressionSAXParser - declared type:
Propert
yName
193328 [FINER] org.geotools.filter.ExpressionSAXParser - end message:
PropertyN
ame
193328 [FINER] org.geotools.filter.ExpressionSAXParser - current state:
complet
e
193338 [FINER] org.geotools.filter.FilterFilter - expression factory is
ready
193338 [FINER] org.geotools.filter.ExpressionSAXParser - about to create
expres
sion: GEOMETRY
193338 [FINER] org.geotools.filter.FilterSAXParser - current state (end):
right
Value
193338 [FINER] GMLFilterDocument - RETURN
193338 [FINER] GMLFilterDocument - ENTRY Box Box
org.xml.sax.helpers.Attribute
sImpl@anonymised.com
193338 [FINER] org.geotools.filter.FilterFilter - found start element:

Box

193338 [FINER] AbstractFilter - ENTRY -1
193348 [FINER] GMLFilterDocument - RETURN
193348 [FINER] GMLFilterDocument - ENTRY null null gml:coordinates
org.xml.sax.
helpers.AttributesImpl@anonymised.com
193348 [FINE] org.vfny.geoserver.responses.WfsException - >
[org.vfny.geoserver
.requests.XmlRequestReader]:
  XML getFeature request SAX parsing error: java.lang.NullPointerException
193348 [FINE] org.vfny.geoserver.responses.WfsException - return wfs
exception
is <?xml version="1.0" ?>
<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://kimba:8081/geoserver/da
ta/capabilities/wfs/1.0.0/OGC-exception.xsd">
   <ServiceException

locator="org.vfny.geoserver.requests.XmlRequestReader">

      XML getFeature request SAX parsing error:
java.lang.NullPointerException
   </ServiceException>
</ServiceExceptionReport>

The URL I was trying to call was:

http://kimba:8081/geoserver/wfs?request=GetFeature&typename=qldrstn&filter=&lt;

Filter><BBOX><PropertyName>GEOMETRY</PropertyName><Box%20srsName="EPSG:8311"

<gml:coordinates>137,-30%20157,-25</gml:coordinates></Box></BBOX></Filter>

I am able to perform other non-spatial filters with no problems (the

example

below works fine)

http://kimba:8081/geoserver/wfs?request=GetFeature&typename=qldrstn&filter=&lt;

Filter><PropertyIsEqualTo><PropertyName>QLDRSTN_ID</PropertyName><Literal>6<

/Literal></PropertyIsEqualTo></Filter>

What am I doing wrong?

Thanks
Bronwyn

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Oh, it looks like you need a gml prefix for box as well. Sorry I didn't
catch this earlier, I think the request should be:

<?xml version='1.0' encoding='UTF-8'?>
<GetFeature outputFormat='GML2' handle='myQuery' maxFeatures='100'>
  <Query handle='myQuery2' typeName='qldrstn'>
   <Filter xmlns:gml="http://www.opengis.net/gml&quot;&gt;
    <BBOX>
     <PropertyName>GEOMETRY</PropertyName>
     <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#8311&quot;&gt;
      <gml:coordinates>137,-30 157,-25</gml:coordinates>
     </gml:Box>
    </BBOX>
   </Filter>
  </Query>
</GetFeature>

If that doesn't work I can send you some valid queries that I know work,
but I'm pretty positive that should fix the problem.

Chris

On Mon, 22 Dec 2003, Bronwyn Cook wrote:

Thanks for the quick response.

I tried the KVP request as prescribed below but still no luck (still get the
NullPointerException). I have a feeling that this problem is to do with how
I am specifying the BBOX filter, as other non-spatial queries I have tried
(eg. PropertyIsEqualTo) have worked fine.

I took your recommendation and tried sending the request via XML (POST)
however I still got the NullPointerException. Once again though, I could
send GetFeature requests that have non-spatial filtering via the XML POST
method with no problems. The (bad) XML I sent was:

<?xml version='1.0' encoding='UTF-8'?>
<GetFeature outputFormat='GML2' handle='myQuery' maxFeatures='100'>
<Query handle='myQuery2' typeName='qldrstn'>
  <Filter xmlns:gml="http://www.opengis.net/gml&quot;&gt;
   <BBOX>
    <PropertyName>GEOMETRY</PropertyName>
    <Box srsName="http://www.opengis.net/gml/srs/epsg.xml#8311&quot;&gt;
     <gml:coordinates>137,-30 157,-25</gml:coordinates>
    </Box>
   </BBOX>
  </Filter>
</Query>
</GetFeature>

Could you please let me know if you can see anything wrong with this
request? Do you have an example spatial request that you know works that I
could try?

Thanks
Bronwyn

-----Original Message-----
From: geoserver-devel-admin@lists.sourceforge.net
[mailto:geoserver-devel-admin@lists.sourceforge.net]On Behalf Of Chris
Holmes
Sent: Saturday, 20 December 2003 2:33 AM
To: ROLDAN, Gabriel raul
Cc: 'Bronwyn Cook'; geoserver-devel@lists.sourceforge.net
Subject: RE: [Geoserver-devel] Spatial filter for KVP GetFeature request

Actually it looks like geoserver is reading the values correctly, as the
cleaned string looks right. I think the problem is that you don't define
the gml namespace, which the geotools filter parser looks for (and is also
required by the spec, they just leave off them off of most of the
examples so they aren't really long).

So it should be:

request=GetFeature&typename=qldrstn&filter=<Filter
xmlns:gml="http://www.opengis.net/gml&quot;&gt;&lt;BBOX&gt;&lt;PropertyName&gt;GEOMETRY&lt;/Propert
yName><Box
srsName="EPSG:8311"><gml:coordinates>137,-30
157,-25</gml:coordinates></Box></BBOX></Filter>

To be technically correct the filter namespace should be declared as well,
but our code doesn't require that, just that gml is defined.

This problem comes from mixing xml with kvps, we recommend using Xml
requests as much as possible. But if you add the gml namespace your
request should work.

Chris

On Fri, 19 Dec 2003, ROLDAN, Gabriel raul wrote:

> At a first look, it seems as the tipical HTTP GET method's request
encoding
> issue.
>
> When accessing content thru GET method, you need to "HTTP encode" the
> values. I mean,
> you shouldn't encode the whole query string, but every parameter value
> separately, so
> the server gets a well formed request.
>
> May be in you example it would be enough just replacing the ":" symbols by
> "%3A".
> But it would be better if from your client you URL encode every request
> parameter value.
> If your client is javascript based, you can do it by applying the
> escape(str) js function
> (i.e:
> var escapedFilter =
> escape("<Filter><BBOX><PropertyName>GEOMETRY</PropertyName>" +
>
>
"<Box%20srsName="EPSG:8311"><gml:coordinates>137,-30%20157,-25</gml:coordina
> tes>" +
> "</Box></BBOX></Filter>";
>
> var url =
>
"http://kimba:8081/geoserver/wfs?request=GetFeature&typename=qldrstn&filter=
> " + escapedFilter;
> )
>
> if your client is java based, just use java.net.URLEncoder class to encode
> param values.
>
> hope this helps,
>
>
> gabriel
>
> -----Mensaje original-----
> De: Bronwyn Cook [mailto:bronwyn@anonymised.com]
> Enviado el: viernes, 19 de diciembre de 2003 5:19
> Para: geoserver-devel@lists.sourceforge.net
> Asunto: [Geoserver-devel] Spatial filter for KVP GetFeature request
>
>
> Hello,
>
> I have been trying to get Geoserver 1.0.1 to work with a spatial filter
and
> keep on getting the following error message:
>
> 193268 [FINER] org.vfny.geoserver.requests.RequestKvpReader - clean
request
> is
>
request=GetFeature&typename=qldrstn&filter=<Filter><BBOX><PropertyName>GEOME
> TRY<
> /PropertyName><Box srsName="EPSG:8311"><gml:coordinates>137,-30
> 157,-25</gml:coo
> rdinates></Box></BBOX></Filter>
> 193278 [FINER] org.vfny.geoserver.requests.DispatcherKvpReader -
dispatcher
> got
> request GetFeature
> 193278 [FINER] org.vfny.geoserver.servlets.Dispatcher - req_type is 3
> LOGGING - Got GetFeature Request
> 193278 [FINER] org.vfny.geoserver.requests.RequestKvpReader - clean
request
> is
>
request=GetFeature&typename=qldrstn&filter=<Filter><BBOX><PropertyName>GEOME
> TRY<
> /PropertyName><Box srsName="EPSG:8311"><gml:coordinates>137,-30
> 157,-25</gml:coo
> rdinates></Box></BBOX></Filter>
> 193278 [FINER] org.geotools.filter.LogicSAXParser - made new logic
factory
> 193278 [FINER] SubHandlerFactory - ENTRY
> 193278 [FINER] SubHandlerFactory - RETURN
> 193278 [FINER] GMLFilterDocument - ENTRY
> org.geotools.gml.GMLFilterGeometry@anonymised.com
> ec4
> 193278 [FINER] GMLFilterDocument - RETURN
> 193288 [FINER] GMLFilterDocument - ENTRY Filter Filter
> org.xml.sax.helpers.Att
> ributesImpl@anonymised.com
> 193288 [FINER] org.geotools.filter.FilterFilter - found start element:
> Filter
> 193288 [FINER] GMLFilterDocument - RETURN
> 193288 [FINER] GMLFilterDocument - ENTRY BBOX BBOX
> org.xml.sax.helpers.Attribu
> tesImpl@anonymised.com
> 193288 [FINER] org.geotools.filter.FilterFilter - found start element:
BBOX
> 193288 [FINER] AbstractFilter - ENTRY 4
> 193288 [FINER] org.geotools.filter.FilterFilter - found a simple filter
> start
> 193298 [FINER] GMLFilterDocument - RETURN
> 193298 [FINER] GMLFilterDocument - ENTRY PropertyName PropertyName
> org.xml.sax
> .helpers.AttributesImpl@anonymised.com
> 193298 [FINER] org.geotools.filter.FilterFilter - found start element:
> Property
> Name
> 193298 [FINER] AbstractFilter - ENTRY 101
> 193298 [FINER] org.geotools.filter.ExpressionSAXParser - incoming type:
> Propert
> yName
> 193298 [FINER] org.geotools.filter.ExpressionSAXParser - declared type:
> null
> 193298 [FINER] org.geotools.filter.ExpressionSAXParser - current state:
> null
> 193308 [FINER] org.geotools.filter.ExpressionSAXParser - is attribute
> expressio
> n
> 193308 [FINER] GMLFilterDocument - RETURN
> 193308 [FINER] GMLFilterDocument - ENTRY [C@anonymised.com 28 8
> 193308 [FINER] org.geotools.filter.ExpressionSAXParser - incoming
message:
> GEOM
> ETRY
> 193308 [FINER] org.geotools.filter.ExpressionSAXParser - should read
chars:
> tru
> e
> 193318 [FINER] org.geotools.filter.ExpressionSAXParser - ...
> 193318 [FINER] org.geotools.filter.ExpressionSAXParser - setting
attribute
> expr
> ession: GEOMETRY
> 193318 [FINER] ExpressionAttribute - ENTRY GEOMETRY
> 193318 [FINER] org.geotools.filter.ExpressionSAXParser - ...
> 193318 [FINER] org.geotools.filter.ExpressionSAXParser - ...
> 193318 [FINER] GMLFilterDocument - RETURN
> 193318 [FINER] GMLFilterDocument - ENTRY PropertyName PropertyName
> 193318 [FINER] org.geotools.filter.FilterFilter - found start element:
> Property
> Name
> 193328 [FINER] AbstractFilter - ENTRY 101
> 193328 [FINER] org.geotools.filter.FilterFilter - found an expression
> filter en
> d
> 193328 [FINER] org.geotools.filter.ExpressionSAXParser - declared type:
> Propert
> yName
> 193328 [FINER] org.geotools.filter.ExpressionSAXParser - end message:
> PropertyN
> ame
> 193328 [FINER] org.geotools.filter.ExpressionSAXParser - current state:
> complet
> e
> 193338 [FINER] org.geotools.filter.FilterFilter - expression factory is
> ready
> 193338 [FINER] org.geotools.filter.ExpressionSAXParser - about to create
> expres
> sion: GEOMETRY
> 193338 [FINER] org.geotools.filter.FilterSAXParser - current state (end):
> right
> Value
> 193338 [FINER] GMLFilterDocument - RETURN
> 193338 [FINER] GMLFilterDocument - ENTRY Box Box
> org.xml.sax.helpers.Attribute
> sImpl@anonymised.com
> 193338 [FINER] org.geotools.filter.FilterFilter - found start element:
Box
> 193338 [FINER] AbstractFilter - ENTRY -1
> 193348 [FINER] GMLFilterDocument - RETURN
> 193348 [FINER] GMLFilterDocument - ENTRY null null gml:coordinates
> org.xml.sax.
> helpers.AttributesImpl@anonymised.com
> 193348 [FINE] org.vfny.geoserver.responses.WfsException - >
> [org.vfny.geoserver
> .requests.XmlRequestReader]:
> XML getFeature request SAX parsing error: java.lang.NullPointerException
> 193348 [FINE] org.vfny.geoserver.responses.WfsException - return wfs
> exception
> is <?xml version="1.0" ?>
> <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://kimba:8081/geoserver/da
> ta/capabilities/wfs/1.0.0/OGC-exception.xsd">
> <ServiceException
locator="org.vfny.geoserver.requests.XmlRequestReader">
> XML getFeature request SAX parsing error:
> java.lang.NullPointerException
> </ServiceException>
> </ServiceExceptionReport>
>
> The URL I was trying to call was:
>
>
http://kimba:8081/geoserver/wfs?request=GetFeature&typename=qldrstn&filter=&lt;
>
Filter><BBOX><PropertyName>GEOMETRY</PropertyName><Box%20srsName="EPSG:8311"
>
><gml:coordinates>137,-30%20157,-25</gml:coordinates></Box></BBOX></Filter>
>
> I am able to perform other non-spatial filters with no problems (the
example
> below works fine)
>
http://kimba:8081/geoserver/wfs?request=GetFeature&typename=qldrstn&filter=&lt;
>
Filter><PropertyIsEqualTo><PropertyName>QLDRSTN_ID</PropertyName><Literal>6<
> /Literal></PropertyIsEqualTo></Filter>
>
> What am I doing wrong?
>
> Thanks
> Bronwyn
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
> Free Linux Tutorials. Learn everything from the bash shell to sys admin.
> Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> Geoserver-devel mailing list
> Geoserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
> Free Linux Tutorials. Learn everything from the bash shell to sys admin.
> Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> Geoserver-devel mailing list
> Geoserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>

--

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--

Wow! Thanks for the super-quick reply. The lack of the gml namespace on
the Box param was the problem. It now works fine.

By the way, I've noticed when specifying Oracle connections that the table
name must be in uppercase letters. This is because the
DatabaseMetaData.getPrimaryKeys(...) Java method expects a capitalised table
name. If the table name is not capitalised you end up getting 'SQL Error
occured when generating unique key' errors as the code tries to generate a
unique column on the table (since DatabaseMetaData.getPrimaryKeys(...)
returns nothing (no primary keys)).

Thanks
Bronwyn

-----Original Message-----
From: Chris Holmes [mailto:cholmes@anonymised.com]
Sent: Monday, 22 December 2003 12:49 PM
To: Bronwyn Cook
Cc: Geoserver List
Subject: RE: [Geoserver-devel] Spatial filter for KVP GetFeature request

Oh, it looks like you need a gml prefix for box as well. Sorry I didn't
catch this earlier, I think the request should be:

<?xml version='1.0' encoding='UTF-8'?>
<GetFeature outputFormat='GML2' handle='myQuery' maxFeatures='100'>
  <Query handle='myQuery2' typeName='qldrstn'>
   <Filter xmlns:gml="http://www.opengis.net/gml&quot;&gt;
    <BBOX>
     <PropertyName>GEOMETRY</PropertyName>
     <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#8311&quot;&gt;
      <gml:coordinates>137,-30 157,-25</gml:coordinates>
     </gml:Box>
    </BBOX>
   </Filter>
  </Query>
</GetFeature>

If that doesn't work I can send you some valid queries that I know work,
but I'm pretty positive that should fix the problem.

Chris

On Mon, 22 Dec 2003, Bronwyn Cook wrote:

Thanks for the quick response.

I tried the KVP request as prescribed below but still no luck (still get

the

NullPointerException). I have a feeling that this problem is to do with

how

I am specifying the BBOX filter, as other non-spatial queries I have tried
(eg. PropertyIsEqualTo) have worked fine.

I took your recommendation and tried sending the request via XML (POST)
however I still got the NullPointerException. Once again though, I could
send GetFeature requests that have non-spatial filtering via the XML POST
method with no problems. The (bad) XML I sent was:

<?xml version='1.0' encoding='UTF-8'?>
<GetFeature outputFormat='GML2' handle='myQuery' maxFeatures='100'>
<Query handle='myQuery2' typeName='qldrstn'>
  <Filter xmlns:gml="http://www.opengis.net/gml&quot;&gt;
   <BBOX>
    <PropertyName>GEOMETRY</PropertyName>
    <Box srsName="http://www.opengis.net/gml/srs/epsg.xml#8311&quot;&gt;
     <gml:coordinates>137,-30 157,-25</gml:coordinates>
    </Box>
   </BBOX>
  </Filter>
</Query>
</GetFeature>

Could you please let me know if you can see anything wrong with this
request? Do you have an example spatial request that you know works that

I

could try?

Thanks
Bronwyn

-----Original Message-----
From: geoserver-devel-admin@lists.sourceforge.net
[mailto:geoserver-devel-admin@lists.sourceforge.net]On Behalf Of Chris
Holmes
Sent: Saturday, 20 December 2003 2:33 AM
To: ROLDAN, Gabriel raul
Cc: 'Bronwyn Cook'; geoserver-devel@lists.sourceforge.net
Subject: RE: [Geoserver-devel] Spatial filter for KVP GetFeature request

Actually it looks like geoserver is reading the values correctly, as the
cleaned string looks right. I think the problem is that you don't define
the gml namespace, which the geotools filter parser looks for (and is also
required by the spec, they just leave off them off of most of the
examples so they aren't really long).

So it should be:

request=GetFeature&typename=qldrstn&filter=<Filter

xmlns:gml="http://www.opengis.net/gml&quot;&gt;&lt;BBOX&gt;&lt;PropertyName&gt;GEOMETRY&lt;/Propert

yName><Box
srsName="EPSG:8311"><gml:coordinates>137,-30
157,-25</gml:coordinates></Box></BBOX></Filter>

To be technically correct the filter namespace should be declared as well,
but our code doesn't require that, just that gml is defined.

This problem comes from mixing xml with kvps, we recommend using Xml
requests as much as possible. But if you add the gml namespace your
request should work.

Chris

On Fri, 19 Dec 2003, ROLDAN, Gabriel raul wrote:

> At a first look, it seems as the tipical HTTP GET method's request
encoding
> issue.
>
> When accessing content thru GET method, you need to "HTTP encode" the
> values. I mean,
> you shouldn't encode the whole query string, but every parameter value
> separately, so
> the server gets a well formed request.
>
> May be in you example it would be enough just replacing the ":" symbols

by

> "%3A".
> But it would be better if from your client you URL encode every request
> parameter value.
> If your client is javascript based, you can do it by applying the
> escape(str) js function
> (i.e:
> var escapedFilter =
> escape("<Filter><BBOX><PropertyName>GEOMETRY</PropertyName>" +
>
>

"<Box%20srsName="EPSG:8311"><gml:coordinates>137,-30%20157,-25</gml:coordina

> tes>" +
> "</Box></BBOX></Filter>";
>
> var url =
>

"http://kimba:8081/geoserver/wfs?request=GetFeature&typename=qldrstn&filter=

> " + escapedFilter;
> )
>
> if your client is java based, just use java.net.URLEncoder class to

encode

> param values.
>
> hope this helps,
>
>
> gabriel
>
> -----Mensaje original-----
> De: Bronwyn Cook [mailto:bronwyn@anonymised.com]
> Enviado el: viernes, 19 de diciembre de 2003 5:19
> Para: geoserver-devel@lists.sourceforge.net
> Asunto: [Geoserver-devel] Spatial filter for KVP GetFeature request
>
>
> Hello,
>
> I have been trying to get Geoserver 1.0.1 to work with a spatial filter
and
> keep on getting the following error message:
>
> 193268 [FINER] org.vfny.geoserver.requests.RequestKvpReader - clean
request
> is
>

request=GetFeature&typename=qldrstn&filter=<Filter><BBOX><PropertyName>GEOME

> TRY<
> /PropertyName><Box srsName="EPSG:8311"><gml:coordinates>137,-30
> 157,-25</gml:coo
> rdinates></Box></BBOX></Filter>
> 193278 [FINER] org.vfny.geoserver.requests.DispatcherKvpReader -
dispatcher
> got
> request GetFeature
> 193278 [FINER] org.vfny.geoserver.servlets.Dispatcher - req_type is 3
> LOGGING - Got GetFeature Request
> 193278 [FINER] org.vfny.geoserver.requests.RequestKvpReader - clean
request
> is
>

request=GetFeature&typename=qldrstn&filter=<Filter><BBOX><PropertyName>GEOME

> TRY<
> /PropertyName><Box srsName="EPSG:8311"><gml:coordinates>137,-30
> 157,-25</gml:coo
> rdinates></Box></BBOX></Filter>
> 193278 [FINER] org.geotools.filter.LogicSAXParser - made new logic
factory
> 193278 [FINER] SubHandlerFactory - ENTRY
> 193278 [FINER] SubHandlerFactory - RETURN
> 193278 [FINER] GMLFilterDocument - ENTRY
> org.geotools.gml.GMLFilterGeometry@anonymised.com
> ec4
> 193278 [FINER] GMLFilterDocument - RETURN
> 193288 [FINER] GMLFilterDocument - ENTRY Filter Filter
> org.xml.sax.helpers.Att
> ributesImpl@anonymised.com
> 193288 [FINER] org.geotools.filter.FilterFilter - found start element:
> Filter
> 193288 [FINER] GMLFilterDocument - RETURN
> 193288 [FINER] GMLFilterDocument - ENTRY BBOX BBOX
> org.xml.sax.helpers.Attribu
> tesImpl@anonymised.com
> 193288 [FINER] org.geotools.filter.FilterFilter - found start element:
BBOX
> 193288 [FINER] AbstractFilter - ENTRY 4
> 193288 [FINER] org.geotools.filter.FilterFilter - found a simple filter
> start
> 193298 [FINER] GMLFilterDocument - RETURN
> 193298 [FINER] GMLFilterDocument - ENTRY PropertyName PropertyName
> org.xml.sax
> .helpers.AttributesImpl@anonymised.com
> 193298 [FINER] org.geotools.filter.FilterFilter - found start element:
> Property
> Name
> 193298 [FINER] AbstractFilter - ENTRY 101
> 193298 [FINER] org.geotools.filter.ExpressionSAXParser - incoming type:
> Propert
> yName
> 193298 [FINER] org.geotools.filter.ExpressionSAXParser - declared type:
> null
> 193298 [FINER] org.geotools.filter.ExpressionSAXParser - current state:
> null
> 193308 [FINER] org.geotools.filter.ExpressionSAXParser - is attribute
> expressio
> n
> 193308 [FINER] GMLFilterDocument - RETURN
> 193308 [FINER] GMLFilterDocument - ENTRY [C@anonymised.com 28 8
> 193308 [FINER] org.geotools.filter.ExpressionSAXParser - incoming
message:
> GEOM
> ETRY
> 193308 [FINER] org.geotools.filter.ExpressionSAXParser - should read
chars:
> tru
> e
> 193318 [FINER] org.geotools.filter.ExpressionSAXParser - ...
> 193318 [FINER] org.geotools.filter.ExpressionSAXParser - setting
attribute
> expr
> ession: GEOMETRY
> 193318 [FINER] ExpressionAttribute - ENTRY GEOMETRY
> 193318 [FINER] org.geotools.filter.ExpressionSAXParser - ...
> 193318 [FINER] org.geotools.filter.ExpressionSAXParser - ...
> 193318 [FINER] GMLFilterDocument - RETURN
> 193318 [FINER] GMLFilterDocument - ENTRY PropertyName PropertyName
> 193318 [FINER] org.geotools.filter.FilterFilter - found start element:
> Property
> Name
> 193328 [FINER] AbstractFilter - ENTRY 101
> 193328 [FINER] org.geotools.filter.FilterFilter - found an expression
> filter en
> d
> 193328 [FINER] org.geotools.filter.ExpressionSAXParser - declared type:
> Propert
> yName
> 193328 [FINER] org.geotools.filter.ExpressionSAXParser - end message:
> PropertyN
> ame
> 193328 [FINER] org.geotools.filter.ExpressionSAXParser - current state:
> complet
> e
> 193338 [FINER] org.geotools.filter.FilterFilter - expression factory is
> ready
> 193338 [FINER] org.geotools.filter.ExpressionSAXParser - about to

create

> expres
> sion: GEOMETRY
> 193338 [FINER] org.geotools.filter.FilterSAXParser - current state

(end):

> right
> Value
> 193338 [FINER] GMLFilterDocument - RETURN
> 193338 [FINER] GMLFilterDocument - ENTRY Box Box
> org.xml.sax.helpers.Attribute
> sImpl@anonymised.com
> 193338 [FINER] org.geotools.filter.FilterFilter - found start element:
Box
> 193338 [FINER] AbstractFilter - ENTRY -1
> 193348 [FINER] GMLFilterDocument - RETURN
> 193348 [FINER] GMLFilterDocument - ENTRY null null gml:coordinates
> org.xml.sax.
> helpers.AttributesImpl@anonymised.com
> 193348 [FINE] org.vfny.geoserver.responses.WfsException - >
> [org.vfny.geoserver
> .requests.XmlRequestReader]:
> XML getFeature request SAX parsing error:

java.lang.NullPointerException

> 193348 [FINE] org.vfny.geoserver.responses.WfsException - return wfs
> exception
> is <?xml version="1.0" ?>
> <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://kimba:8081/geoserver/da
> ta/capabilities/wfs/1.0.0/OGC-exception.xsd">
> <ServiceException
locator="org.vfny.geoserver.requests.XmlRequestReader">
> XML getFeature request SAX parsing error:
> java.lang.NullPointerException
> </ServiceException>
> </ServiceExceptionReport>
>
> The URL I was trying to call was:
>
>

http://kimba:8081/geoserver/wfs?request=GetFeature&typename=qldrstn&filter=&lt;

>

Filter><BBOX><PropertyName>GEOMETRY</PropertyName><Box%20srsName="EPSG:8311"

>

<gml:coordinates>137,-30%20157,-25</gml:coordinates></Box></BBOX></Filter>
>
> I am able to perform other non-spatial filters with no problems (the
example
> below works fine)
>

http://kimba:8081/geoserver/wfs?request=GetFeature&typename=qldrstn&filter=&lt;

>

Filter><PropertyIsEqualTo><PropertyName>QLDRSTN_ID</PropertyName><Literal>6<

> /Literal></PropertyIsEqualTo></Filter>
>
> What am I doing wrong?
>
> Thanks
> Bronwyn
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills. Sign up for

IBM's

> Free Linux Tutorials. Learn everything from the bash shell to sys

admin.

> Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> Geoserver-devel mailing list
> Geoserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills. Sign up for

IBM's

> Free Linux Tutorials. Learn everything from the bash shell to sys

admin.

> Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> Geoserver-devel mailing list
> Geoserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>

--

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--

All tablenames for Oracle must be in uppercase. That is just the way Oracle works Im afraid. SQLPlus lets you mix case but JDBC doesn't, I think this is a feature of SQLPlus.

Sean

Bronwyn Cook wrote:

Wow! Thanks for the super-quick reply. The lack of the gml namespace on
the Box param was the problem. It now works fine.

By the way, I've noticed when specifying Oracle connections that the table
name must be in uppercase letters. This is because the
DatabaseMetaData.getPrimaryKeys(...) Java method expects a capitalised table
name. If the table name is not capitalised you end up getting 'SQL Error
occured when generating unique key' errors as the code tries to generate a
unique column on the table (since DatabaseMetaData.getPrimaryKeys(...)
returns nothing (no primary keys)).

Thanks
Bronwyn