[Geoserver-devel] Issue with CQL intersect performance

I have a layer of mining processes in geoserver
I need to implement a functionality where the user can filter mining
processes from a shape file.
This shape file contains 15 polygons and each polygon contains approximately
30k coordinates.
I'm using a post request and sending the 30k coordinates in a CQL, like the
one below.
cql = "INTERSECTS(the_geom, POLYGON((-40.9266886103044 -16.262666496441046,
-40.90549282420962 -16.263061436643454, -40.905472448859044
-16.263441492330248, -40.90229656699312 -16.267723288825366,
-40.90024952920471 -16.278586398087867... + 30k coordinates)
But the return is very slow. Because I have 15 polygons that perform this
CQL, with their respective coordinates.
Is there any better way to do this?
Sorry about my english lol
Thanks in advance

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-Dev-f3819232.html

Hi,
you may want to have a look at:
https://docs.geoserver.org/stable/en/user/extensions/querylayer/index.html

A few comments:

  • is the first layer in a database?
  • sending a CQL filter with 15 polygons with more than 30K coordinates each will be slow to POST and for GeoServer to parse … you need to avoid this POST
  • in terms of execution, some simplification of the polygons should be made

Hope it helps,
Nuno Oliveira

On Mon, 2019-08-05 at 15:58 -0700, guilhermecanton wrote:

I have a layer of mining processes in geoserver
I need to implement a functionality where the user can filter mining
processes from a shape file.
This shape file contains 15 polygons and each polygon contains approximately
30k coordinates.
I'm using a post request and sending the 30k coordinates in a CQL, like the
one below.
cql = "INTERSECTS(the_geom, POLYGON((-40.9266886103044 -16.262666496441046,
-40.90549282420962 -16.263061436643454, -40.905472448859044
-16.263441492330248, -40.90229656699312 -16.267723288825366,
-40.90024952920471 -16.278586398087867... + 30k coordinates)
But the return is very slow. Because I have 15 polygons that perform this
CQL, with their respective coordinates.
Is there any better way to do this?
Sorry about my english lol
Thanks in advance

--
Sent from: [http://osgeo-org.1560.x6.nabble.com/GeoServer-Dev-f3819232.html](http://osgeo-org.1560.x6.nabble.com/GeoServer-Dev-f3819232.html)

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

-- 
Regards,
Nuno Oliveira
==
GeoServer Professional Services from the
experts! 
Visit http://goo.gl/it488V for more information.
==

Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy
phone: +39 0584 962313
fax:      +39 0584 1660272

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

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

Con riferimento alla normativa sul trattamento dei dati 
personali (Reg. UE 2016/679 - Regolamento generale sulla 
protezione dei dati “GDPR”), si precisa che ogni 
circostanza inerente alla presente email (il suo contenuto, 
gli eventuali allegati, etc.) è un dato la cui conoscenza 
è riservata al/i solo/i destinatario/i indicati dallo 
scrivente. Se il messaggio Le è giunto per errore, è 
tenuta/o a cancellarlo, ogni altra operazione è illecita. 
Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to 
which it is addressed and may contain information that 
is privileged, confidential or otherwise protected from 
disclosure. We remind that - as provided by European 
Regulation 2016/679 “GDPR” - copying, dissemination or 
use of this e-mail or the information herein by anyone 
other than the intended recipient is prohibited. If you 
have received this email by mistake, please notify 
us immediately by telephone or e-mail.

1 - is the first layer in a database?
Yes, it's unique.
The form that contains the coordinates, I have only one geojson with the
coordinates.

2 - sending a CQL filter with 15 polygons with more than 30K coordinates
each will be slow to POST and for GeoServer to parse ... you need to avoid
this POST
How i can do it without post request?

Thanks!

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-Dev-f3819232.html

Possibly by storing the coordinates on the backend and refer to the by id. But still, filtering
with intersection against a polygon with 30k coordinates will be slow, no matter what.
You can have a look at where the time is spent using a profiler, have a look at “Mission Control”,
it’s a free profiler included in the JDK (from version 8 onwards), it will tell you where most of
the time is spent and may lead you to some obvious optimization (or not! :smiley: )

Cheers
Andrea

···

Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.