> Indeed that's likely what's going on. There is no support whatsoever for unit
> interpretation in GeoServer distance filters.
> Adding it is possible, but quite a bit of work too
>
Hmm. so creating that DWITHIN filter requires knowledge of what the 
layer unit is by the application. It seems odd that coordinate is 
converted but not the distance. Can I assume that distanceUnit is simply
ignored by GS?

  I if put in "degree" as the distance unit, it still work fine.

HOWEVER

I tried to serialize for the GET instead with this string.
http://maps.gns.cri.nz/geoserver/wfs?service=WFS&version=1.1.0&srsName=EPSG%3A900913&request=GetFeature&featurePrefix=gns&typeName=MARINE.DSDP_ODP_VIEW&outputFormat=json&cql_filter=DWITHIN(SHAPE,POINT(18671222.484796%20-4944119.0809142),335260,degrees)&format_options=callback%3AOpenLayers.Protocol.Script.getCallback(1)
 
<http://maps.gns.cri.nz/geoserver/wfs?service=WFS&version=1.1.0&srsName=EPSG%3A900913&request=GetFeature&featurePrefix=gns&typeName=MARINE.DSDP_ODP_VIEW&outputFormat=json&cql_filter=DWITHIN%28SHAPE,POINT%2818671222.484796%20-4944119.0809142%29,335260,meters%29&format_options=callback%3AOpenLayers.Protocol.Script.getCallback%281%29>

This fails:
<ows:ExceptionText>
Could not parse CQL filter list. Encountered &quot;degree&quot; at line 
1, column 62. Was expecting one of: &quot;feet&quot; ... 
&quot;meters&quot; ... &quot;statute miles&quot; ... &quot;nautical 
miles&quot; ... &quot;kilometers&quot; ... . Parsing : 
DWITHIN(SHAPE,POINT(18671222.484796 -4944119.0809142),335260,degree). 
Current Token : &quot;,&quot;
</ows:ExceptionText>

  - because "degrees" (or for that matter anything like it) is not one 
the list of units supported according to the error message. Odd that 
this fails, but the POST version doesnt. If degrees isnt allowed then 
what distance to use for a EPSG:4326 coverage?

Changing to
http://maps.gns.cri.nz/geoserver/wfs?service=WFS&version=1.1.0&srsName=EPSG%3A900913&request=GetFeature&featurePrefix=gns&typeName=MARINE.DSDP_ODP_VIEW&outputFormat=json&cql_filter=DWITHIN(SHAPE,POINT(18671222.484796%20-4944119.0809142),335260,meters)&format_options=callback%3AOpenLayers.Protocol.Script.getCallback(1)
 
<http://maps.gns.cri.nz/geoserver/wfs?service=WFS&version=1.1.0&srsName=EPSG%3A900913&request=GetFeature&featurePrefix=gns&typeName=MARINE.DSDP_ODP_VIEW&outputFormat=json&cql_filter=DWITHIN%28SHAPE,POINT%2818671222.484796%20-4944119.0809142%29,335260,meters%29&format_options=callback%3AOpenLayers.Protocol.Script.getCallback%281%29>

however returns an empty feature set. No matter how big distance unit 
is, I get nothing unless I remove the cql_filter completely. Is there 
another way to serialise a filter for GET that works better?


-- 
Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St, 
Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232

Notice: This email and any attachments are confidential. If received in error 
please destroy and immediately notify us. Do not copy or disclose the contents.

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to