[Geoserver-users] CQL Filter question

I'm trying to use CQL filters in my networkLinks href url. I can get some of
them to work, for example these work:

&CQL_FILTER=SEVERITY+BETWEEN+3+AND+5
&CQL_FILTER=SEVERITY=3
&CQL_FILTER=SEVERITY=3 or SEVERITY=1

But I was unable to get these to work and they don't throw any exceptions:
(there's data in the db that should be returned)

&CQL_FILTER=DWITHIN(GEOM, POINT(-83.25 42.67), 5000, kilometers)
&CQL_FILTER=TOUCHES(GEOM, POINT(-83.25 42.67))

Does GeoServer support DWITHIN and TOUCHES?

--
View this message in context: http://old.nabble.com/CQL-Filter-question-tp28391495p28391495.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Dan,

I had a similar question a few days ago "[Geoserver-users] CQL Filter
question".

Gabriel pointed out that I should escape the parameter value string for my
filter and that seemed to work for me.

So in your case:
    var myFilter = escape("SEVERITY=3 or SEVERITY=1");
    myRequest = "...&clq_filter="+ myFilter;

As to the second part of your question I don't know - I'm also a new user.

Joe

--
View this message in context: http://old.nabble.com/CQL-Filter-question-tp28391495p28399768.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Thanks for the reply, but the &CQL_FILTER=SEVERITY=3 or SEVERITY=1 filter
works fine, the problem is when I try to do something like:
&CQL_FILTER=DWITHIN(GEOM, POINT(-83.25 42.67), 50000, kilometers).

Would I have to do something like: escape("DWITHIN(GEOM, POINT(-83.25
42.67), 50000, kilometers)");

UWJoe wrote:

Dan,

I had a similar question a few days ago "[Geoserver-users] CQL Filter
question".

Gabriel pointed out that I should escape the parameter value string for my
filter and that seemed to work for me.

So in your case:
    var myFilter = escape("SEVERITY=3 or SEVERITY=1");
    myRequest = "...&clq_filter="+ myFilter;

As to the second part of your question I don't know - I'm also a new user.

Joe

--
View this message in context: http://old.nabble.com/CQL-Filter-question-tp28391495p28399817.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Dan,

Sorry, I noticed I answered the wrong question soon after I posted the
reply.

We use something similar to your second request.

"....&cql_filter=DWithin(the_geom,POINT+(" + lonlat.lon + "+" + lonlat.lat+
"),"+radius+",feet)"

We do not escape the parameter

Note: There is a "+" between the lat lon
Note: no spaces.

Joe
--
View this message in context: http://old.nabble.com/CQL-Filter-question-tp28391495p28399996.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

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:

Dan,

Sorry, I noticed I answered the wrong question soon after I posted the
reply.

We use something similar to your second request.

"....&cql_filter=DWithin(the_geom,POINT+(" + lonlat.lon + "+" +
lonlat.lat+ "),"+radius+",feet)"

We do not escape the parameter

Note: There is a "+" between the lat lon
Note: no spaces.

Joe

--
View this message in context: http://old.nabble.com/CQL-Filter-question-tp28391495p28400108.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi,

There may be some real problem, but DWITHIN 50000 kilometres is not a very reasonable query and it can have some effect.

-Jukka Rahkonen-

Lähettäjä: Dan MacLeod wrote:

Thanks for the reply, but the &CQL_FILTER=SEVERITY=3 or
SEVERITY=1 filter
works fine, the problem is when I try to do something like:
&CQL_FILTER=DWITHIN(GEOM, POINT(-83.25 42.67), 50000, kilometers).

Would I have to do something like: escape("DWITHIN(GEOM, POINT(-83.25
42.67), 50000, kilometers)");

UWJoe wrote:
>
> Dan,
>
> I had a similar question a few days ago "[Geoserver-users]
CQL Filter
> question".
>
> Gabriel pointed out that I should escape the parameter
value string for my
> filter and that seemed to work for me.
>
> So in your case:
> var myFilter = escape("SEVERITY=3 or SEVERITY=1");
> myRequest = "...&clq_filter="+ myFilter;
>
>
> As to the second part of your question I don't know - I'm
also a new user.
>
> Joe
>
>
>

--
View this message in context:
http://old.nabble.com/CQL-Filter-question-tp28391495p28399817.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

--------------------------------------------------------------
----------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

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?

--
View this message in context: http://old.nabble.com/CQL-Filter-question-tp28391495p28400666.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

I agree, during my testing, I started with 5 kilometers. When I couldn't get
any geometries to display I started increasing the kilometers for testing
purposes.

thanks

Rahkonen Jukka wrote:

Hi,

There may be some real problem, but DWITHIN 50000 kilometres is not a very
reasonable query and it can have some effect.

-Jukka Rahkonen-

Lähettäjä: Dan MacLeod wrote:

Thanks for the reply, but the &CQL_FILTER=SEVERITY=3 or
SEVERITY=1 filter
works fine, the problem is when I try to do something like:
&CQL_FILTER=DWITHIN(GEOM, POINT(-83.25 42.67), 50000, kilometers).

Would I have to do something like: escape("DWITHIN(GEOM, POINT(-83.25
42.67), 50000, kilometers)");

UWJoe wrote:
>
> Dan,
>
> I had a similar question a few days ago "[Geoserver-users]
CQL Filter
> question".
>
> Gabriel pointed out that I should escape the parameter
value string for my
> filter and that seemed to work for me.
>
> So in your case:
> var myFilter = escape("SEVERITY=3 or SEVERITY=1");
> myRequest = "...&clq_filter="+ myFilter;
>
>
> As to the second part of your question I don't know - I'm
also a new user.
>
> Joe
>
>
>

--
View this message in context:
http://old.nabble.com/CQL-Filter-question-tp28391495p28399817.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

--------------------------------------------------------------
----------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://old.nabble.com/CQL-Filter-question-tp28391495p28400726.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

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:

--
View this message in context: http://old.nabble.com/CQL-Filter-question-tp28391495p28400799.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Dan MacLeod ha scritto:

I agree, during my testing, I started with 5 kilometers. When I couldn't get
any geometries to display I started increasing the kilometers for testing
purposes.

I have to remind for the n-th time that GeoServer at this stage does not
support unit of measure in distance filters (besides maybe the case of
the Oracle data store, and hopefully sometimes in the future PostGIS 1.5).

Whatever number you provide will be used against the native unit of measure. In this case, degrees (which does not make much sense)

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

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:
   

That's exactly what I needed to know, thank you very much for your reply

David Winslow-5 wrote:

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:
   
------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://old.nabble.com/CQL-Filter-question-tp28391495p28402327.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Andrea Aime wrote:

I have to remind for the n-th time that GeoServer at this stage does not
support unit of measure in distance filters (besides maybe the case of
the Oracle data store, and hopefully sometimes in the future PostGIS 1.5).

Having unit of measure in the filter yielded an Oracle error for me.

-Jukka Rahkonen-

Guys the units are not respected in the underlining library; I usually have to convert to the data units (sometimes that is degree for example). Try converting and let me know if it works out for you.

Jody

On 29/04/2010, at 11:13 PM, Rahkonen Jukka wrote:

Hi,

There may be some real problem, but DWITHIN 50000 kilometres is not a very reasonable query and it can have some effect.

-Jukka Rahkonen-

Lähettäjä: Dan MacLeod wrote:

Thanks for the reply, but the &CQL_FILTER=SEVERITY=3 or
SEVERITY=1 filter
works fine, the problem is when I try to do something like:
&CQL_FILTER=DWITHIN(GEOM, POINT(-83.25 42.67), 50000, kilometers).

Would I have to do something like: escape("DWITHIN(GEOM, POINT(-83.25
42.67), 50000, kilometers)");

UWJoe wrote:

Dan,

I had a similar question a few days ago "[Geoserver-users]

CQL Filter

question".

Gabriel pointed out that I should escape the parameter

value string for my

filter and that seemed to work for me.

So in your case:
   var myFilter = escape("SEVERITY=3 or SEVERITY=1");
   myRequest = "...&clq_filter="+ myFilter;

As to the second part of your question I don't know - I'm

also a new user.

Joe

--
View this message in context:
http://old.nabble.com/CQL-Filter-question-tp28391495p28399817.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

--------------------------------------------------------------
----------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hello all,

I've setup several data stores and layers in one workspace and have now decided that it would be better to have them in a different workspace.
I'm using geoserver 2.0-Snapshot.
I tried creating a new workspace through geoserver, then copying the contents of one workspace into the new workspace. Doesn't seem to have worked.
I restarted the service and the 'new' layers in the new workspace appeared, but it looks like they aren't really working properly and the copied layers are really still referencing the original workspace.
Do I need to 're-add' the data store and all the layers to the new workspace? Am I missing something obvious?

Thanks

--
Ryan Williams, GISP
GIS Analyst / Programmer
PAQ Interactive Inc.
107 S State St., Suite 300
Monticello, IL 61856-1968
Office: (217) 762-7955
Mobile: (217) 722-2794
rwilliams@anonymised.com

Hi Ryan,

When you say you "copied the contents of the one workspace into another" how exactly did you do so? Did you physically change the configuration files on disk? If so then what you are seeing is expected since there are not internal identifiers that geoserver uses for references. Unless these references are updated in each store that you copied over they will still point at the old workspace.

You should be able to change the workspace of a store directly from the UI. This would be the recommended way. But if you do have a need to do it manually it is very possible, just for each datastore.xml you want to move you have to update the workspace link.

-Justin

On 4/30/10 1:48 PM, Ryan Williams wrote:

Hello all,

I've setup several data stores and layers in one workspace and have now
decided that it would be better to have them in a different workspace.
I'm using geoserver 2.0-Snapshot.
I tried creating a new workspace through geoserver, then copying the
contents of one workspace into the new workspace. Doesn't seem to have
worked.
I restarted the service and the 'new' layers in the new workspace
appeared, but it looks like they aren't really working properly and the
copied layers are really still referencing the original workspace.
Do I need to 're-add' the data store and all the layers to the new
workspace? Am I missing something obvious?

Thanks

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Hi Justin,
I created a new workspace using the UI, then went to the folder on the disk that was created for that new workspace and pasted the contents of one workspace into that new workspace.
Yes, the references did indeed point back to the original workspace. I did notice the xml in there but didn’t try editing it.
I ended up using the UI to create new datastores referenced to the new workspace; but will probably look at the datastore.xml just to understand it better.

Thanks for your help,
Ryan

···
-- 
Ryan Williams, GISP
GIS Analyst / Programmer
PAQ Interactive Inc.
107 S State St., Suite 300
Monticello, IL 61856-1968
Office: (217) 762-7955
Mobile: (217) 722-2794
[rwilliams@anonymised.com](mailto:rwilliams@anonymised.com)

Hello list,

When I’m creating a new workspace using the Geoserver UI, does the Namespace URI need to be unique to that workspace?
I’m not really clear on what that URI is used for. Probably something very obvious that I just haven’t learned yet.

Thanks,
Ryan

···
-- 
Ryan Williams, GISP
GIS Analyst / Programmer
PAQ Interactive Inc.
107 S State St., Suite 300
Monticello, IL 61856-1968
Office: (217) 762-7955
Mobile: (217) 722-2794
[rwilliams@anonymised.com](mailto:rwilliams@anonymised.com)

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

_______________________________________________
Geoserver-users mailing list
[Geoserver-users@lists.sourceforge.net](mailto:Geoserver-users@lists.sourceforge.net)
[https://lists.sourceforge.net/lists/listinfo/geoserver-users](https://lists.sourceforge.net/lists/listinfo/geoserver-users)
  

No virus found in this incoming message.
Checked by AVG - [www.avg.com](http://www.avg.com) 
Version: 8.5.437 / Virus Database: 271.1.1/2853 - Release Date: 05/04/10 06:27:00

  
-- 
Ryan Williams, GISP
GIS Analyst / Programmer
PAQ Interactive Inc.
107 S State St., Suite 300
Monticello, IL 61856-1968
Office: (217) 762-7955
Mobile: (217) 722-2794
[rwilliams@anonymised.com](mailto:rwilliams@anonymised.com)

Hi Ryan,

I am not sure if it is enforced but yes the namespace should probably be unique. I guess you could the same namespace for two workspaces and it would work but i fear that somewhere a catalog lookup would fail.

The namespace uri is a wfs construct. For each feature type configured in GeoServer you get a GML application schema. App schemas are grouped into namespaces. They are just like any other xmlschema namespace.

That said that is my very narrow view of what a namespace is. Ben or Rob would probably give you a much deeper answer :slight_smile:

-Justin

On 5/5/10 9:52 AM, Ryan Williams wrote:

Hello list,

When I'm creating a new workspace using the Geoserver UI, does the
Namespace URI need to be unique to that workspace?
I'm not really clear on what that URI is used for. Probably something
very obvious that I just haven't learned yet.

Thanks,
Ryan

On 5/4/2010 11:43 AM, Ryan Williams wrote:

Hi Justin,
I created a new workspace using the UI, then went to the folder on the
disk that was created for that new workspace and pasted the contents
of one workspace into that new workspace.
Yes, the references did indeed point back to the original workspace. I
did notice the xml in there but didn't try editing it.
I ended up using the UI to create new datastores referenced to the new
workspace; but will probably look at the datastore.xml just to
understand it better.

Thanks for your help,
Ryan

On 5/4/2010 10:33 AM, Justin Deoliveira wrote:

Hi Ryan,

When you say you "copied the contents of the one workspace into another"
how exactly did you do so? Did you physically change the configuration
files on disk? If so then what you are seeing is expected since there
are not internal identifiers that geoserver uses for references. Unless
these references are updated in each store that you copied over they
will still point at the old workspace.

You should be able to change the workspace of a store directly from the
UI. This would be the recommended way. But if you do have a need to do
it manually it is very possible, just for each datastore.xml you want to
move you have to update the workspace link.

-Justin

On 4/30/10 1:48 PM, Ryan Williams wrote:

Hello all,

I've setup several data stores and layers in one workspace and have now
decided that it would be better to have them in a different workspace.
I'm using geoserver 2.0-Snapshot.
I tried creating a new workspace through geoserver, then copying the
contents of one workspace into the new workspace. Doesn't seem to have
worked.
I restarted the service and the 'new' layers in the new workspace
appeared, but it looks like they aren't really working properly and the
copied layers are really still referencing the original workspace.
Do I need to 're-add' the data store and all the layers to the new
workspace? Am I missing something obvious?

Thanks

No virus found in this incoming message.
Checked by AVG -www.avg.com
Version: 8.5.437 / Virus Database: 271.1.1/2853 - Release Date: 05/04/10 06:27:00

--
Ryan Williams, GISP
GIS Analyst / Programmer
PAQ Interactive Inc.
107 S State St., Suite 300
Monticello, IL 61856-1968
Office: (217) 762-7955
Mobile: (217) 722-2794
rwilliams@anonymised.com

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

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

No virus found in this incoming message.
Checked by AVG -www.avg.com
Version: 8.5.437 / Virus Database: 271.1.1/2853 - Release Date: 05/04/10 06:27:00

--
Ryan Williams, GISP
GIS Analyst / Programmer
PAQ Interactive Inc.
107 S State St., Suite 300
Monticello, IL 61856-1968
Office: (217) 762-7955
Mobile: (217) 722-2794
rwilliams@anonymised.com

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

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.