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"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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=<
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=<
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