[Geoserver-users] CQL filter WITHIN: format of POLYGON representation

Hello!

I am new to using Geoserver and it’s CQL filterand have one question.

When using spatial filters like this on examples: DISJOINT(the_geom, POLYGON((-90 40, -90 45, -60 45, -60 40, -90 40))) is it possible to use different representation of POLYGON part, not in WKT.

My OpenLayers3 map return coordinates of polygons like this : 576672.21, 6540257.09, 577359.71, 6542209.21, 577989.29, 6542495.86, 579026.17, 6541711.21, 580419.39, 6543269.1, 580664.17, 6544099.43, 580614.18, 6544955.09, 580758.17, 6545791.38, 580813.78, 6547493.59, 580882.3, 6547787.52, 580811.63, 6548021.38, 580393.4, 6548714.35, 579647.81, 6549517.7, 579875.04, 6549978.3, 580612.03, 6550602.42, 581146.45, 6551166.54, 582119.77, 6550856.96, 582810.92, 6550037.72, 582907.41, 6549233.2, 583739.4, 6548619.18, 584351.43, 6550480.94, 584724.81, 6551373.5, 585079.15, 6551780.8, 585214.53, 6552210.45, 584823.45, 6552596.57, 583550.39, 6553106.82, 582713.1, 6553609.79, 582769.21, 6554368.62, 583547.58, 6555687.69 and so on.

Is it possible to use them like this?

Tried this, but with no success.
http://loom-gis.geo.ut.ee:8080/geoserver/ermas/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=ermas:testdata_geopnt&outputFormat=text/javascript&format_options=callback:loadFeatures&maxFeatures=300&srsname=EPSG:3301&EPSG:3301&cql_filter=within%28geometry,POLYGON%28%28556500,%206445500,%20637750,%206470250%29%29%29

And what would be geoserver behavior if my polygon contains around 700 points like that I mentioned.

Thanks for any help!

On Thu, Nov 6, 2014 at 5:42 PM, Olga Troškina <olga.troskina@anonymised.com>
wrote:

Hello!
I am new to using Geoserver and it's CQL filterand have one question.
When using spatial filters like this on examples: DISJOINT(the_geom,
POLYGON((-90 40, -90 45, -60 45, -60 40, -90 40))) is it possible to use
different representation of POLYGON part, not in WKT.

No, WKT is the only supported syntax for any geometry literal in CQL

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

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

Hi,
Look at http://openlayers.org/en/v3.0.0/apidoc/ol.format.WKT.html#writeGeometry to get the WKT for your feature.
In OL2 you could just write feature.geometry.toString() and you would get the WKT. Not sure if that works now.

/Olle

···

On Thu, Nov 6, 2014 at 5:51 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:



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

On Thu, Nov 6, 2014 at 5:42 PM, Olga Troškina <olga.troskina@anonymised.com> wrote:

Hello!

I am new to using Geoserver and it’s CQL filterand have one question.

When using spatial filters like this on examples: DISJOINT(the_geom, POLYGON((-90 40, -90 45, -60 45, -60 40, -90 40))) is it possible to use different representation of POLYGON part, not in WKT.

No, WKT is the only supported syntax for any geometry literal in CQL

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


Hi again,
Forgot to answer one of your questions.

I bet GeoServer wouldn’t have any problem with 700 points.
But I bet the browser would. Given that your coordinates have 9-10 chars and you have 700 points that would render about 140000 characters, right?
Browsers doesn’t allow unlimited length on URL:s. See http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers
I normally use the 2048 limit as stated in that link.
I have a case where an application creates several hundreds of id:s to filter. Given that they aren’t connected to eachother I can separate these in separate layers in OL.
But that does not work with a polygon…

Try to use the WFS format to create a GetFeature XML document that you can POST to GeoServer instead of using GET.
http://openlayers.org/en/v3.0.0/apidoc/ol.format.WFS.html#writeGetFeature

Perhaps this question should go on the OpenLayers mailing list.
Or http://stackoverflow.com/questions/tagged/openlayers-3
Or http://gis.stackexchange.com/questions/tagged/openlayers-3

Regards,
Olle Markljung

···

On Thu, Nov 6, 2014 at 6:03 PM, Olle Markljung <markljung@anonymised.com4…> wrote:

Hi,
Look at http://openlayers.org/en/v3.0.0/apidoc/ol.format.WKT.html#writeGeometry to get the WKT for your feature.
In OL2 you could just write feature.geometry.toString() and you would get the WKT. Not sure if that works now.

/Olle

On Thu, Nov 6, 2014 at 5:51 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:



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

On Thu, Nov 6, 2014 at 5:42 PM, Olga Troškina <olga.troskina@anonymised.com> wrote:

Hello!

I am new to using Geoserver and it’s CQL filterand have one question.

When using spatial filters like this on examples: DISJOINT(the_geom, POLYGON((-90 40, -90 45, -60 45, -60 40, -90 40))) is it possible to use different representation of POLYGON part, not in WKT.

No, WKT is the only supported syntax for any geometry literal in CQL

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.