The + character is a url-encoded whitespace character. If you are generating these CQL filters in code, I would recommend that you find a url-encoding function for your environment. This will ensure that GeoServer sees the same CQL filter that you're generating, even if it contains some other URL-unfriendly characters like / or +. A few examples:
Python:
import urllib
url = "http://foo/geoserver/ows?" + urllib.urlencode({
"SERVICE": "WMS",
"REQUEST": "GetMap",
...
"CQL_FILTER": "DWITHIN(GEOM, POINT (-83.25 42.67), 5000, kilometers)"
})
PHP:
$url = "http://foo/geoserver/ows?service=WMS&request=GetMap&CQL_FILTER="\.urlencode\("DWITHIN(GEOM, POINT (-83.25 42.67), 500, kilometers)");
Java:
import static java.io.URLEncoder.urlencode
String url = "http://foo/geoserver/ows?service=WMS&request=GetMap&CQL_FILTER=" + urlencode("DWITHIN(GEOM, POINT (-83.25 42.67), 5000, kilometers)", "UTF-8");
JavaScript:
var url = "http://foo/geoserver/ows?service=WMS&request=GetMap&CQL_FILTER=" + escape("DWITHIN(GEOM, POINT (-83.25, 42.67), 5000, kilometers)");
Hope this helps.
--
David Winslow
OpenGeo - http://opengeo.org/
On 04/29/2010 09:49 AM, Dan MacLeod wrote:
I can't figure out when I would have to add the "+" sign in my filter. How do
you know when to add the "+" sign?
thanks
Dan,
I just copied a line of code from a js file that a colleague but together
and it works.
Also note: POINT+(
Your request might look like:
"...&CQL_FILTER=DWITHIN(GEOM,POINT+(-83.25+42.67),50000,kilometers)"
I agree with Jukka - 50,000 kilometers (31,068 miles) is more than the
circumference of the earth (40,075.02 KM).
Are you sure you don't want 50000m or 31miles?
CQL references are sparse. This site gave some guidance but nothing about
the "+".
http://docs.codehaus.org/display/GEOTDOC/01+CQL+Examples
Joe
Thanks, I'll give it a try. I've been looking for CQL references but I can't
find any that use the '+' sign between params. How did you find out that you
had to use '+' signs between params?
UWJoe wrote: