[Geoserver-devel] GWC reprojecting envelopes with 10000 points per side?

Hi,
looking into build speed issues I’ve found a puzzling issue in GWC envelope
reprojection code.

Checking the profiles I’ve noticed there was a very high usage of reprojection code, which I’ve eventually
tracked down to envelope reprojections here forcing 10000 points per envelope side during envelope
reprojection (as opposed to the usual 5, used everywhere else):

https://github.com/geoserver/geoserver/blob/master/src/gwc/src/main/java/org/geoserver/gwc/layer/GeoServerTileLayer.java#L960
https://github.com/geoserver/geoserver/blob/master/src/gwc/src/main/java/org/geoserver/gwc/layer/GeoServerTileLayer.java#L987
https://github.com/geoserver/geoserver/blob/master/src/gwc/src/main/java/org/geoserver/gwc/layer/GeoServerTileLayer.java#L993

Going back to the default makes the build of the GWC module drop from 1:30 to 1:00
(I have other changes in the pipe to make it go down to 40s, to be discussed in a separate thread).

The 10000 magic number dates back to a change made by Gabriel in 2012, titled
“GEOS-4460: gwc integration to fully manage GeoServerTileLayer/Info throgh the CatalogConfiguration and external persistence”

I could not find any reason for the 10k points. Going down to the normal 5 breaks no tests, either.
Anyone knows why such a high number is there, and if there is still any reason to use it?

I’ve developed a change to use the default number of points per side, while allowing configuration via system variable, just in case, here:
https://github.com/geoserver/geoserver/pull/3237

If there are no known issues with the change, I’ll open a ticket and make it ready for merge. Maybe we could merge only on
master and see if someone pops up showing us a good reason for the change.

Cheers
Andrea

···

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.

Good catch.

Hi,
looking into build speed issues I’ve found a puzzling issue in GWC envelope
reprojection code.

Checking the profiles I’ve noticed there was a very high usage of reprojection code, which I’ve eventually
tracked down to envelope reprojections here forcing 10000 points per envelope side during envelope
reprojection (as opposed to the usual 5, used everywhere else):

https://github.com/geoserver/geoserver/blob/master/src/gwc/src/main/java/org/geoserver/gwc/layer/GeoServerTileLayer.java#L960
https://github.com/geoserver/geoserver/blob/master/src/gwc/src/main/java/org/geoserver/gwc/layer/GeoServerTileLayer.java#L987
https://github.com/geoserver/geoserver/blob/master/src/gwc/src/main/java/org/geoserver/gwc/layer/GeoServerTileLayer.java#L993

Going back to the default makes the build of the GWC module drop from 1:30 to 1:00
(I have other changes in the pipe to make it go down to 40s, to be discussed in a separate thread).

The 10000 magic number dates back to a change made by Gabriel in 2012, titled
“GEOS-4460: gwc integration to fully manage GeoServerTileLayer/Info throgh the CatalogConfiguration and external persistence”

I could not find any reason for the 10k points. Going down to the normal 5 breaks no tests, either.
Anyone knows why such a high number is there, and if there is still any reason to use it?

I’ve developed a change to use the default number of points per side, while allowing configuration via system variable, just in case, here:
https://github.com/geoserver/geoserver/pull/3237

If there are no known issues with the change, I’ll open a ticket and make it ready for merge. Maybe we could merge only on
master and see if someone pops up showing us a good reason for the change.

+1

Cheers
Andrea

==

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


<details class='elided'>
<summary title='Show trimmed content'>&#183;&#183;&#183;</summary>

GeoServer Professional Services from the experts! Visit [http://goo.gl/it488V](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://www.geo-solutions.it) [http://twitter.com/geosolutions_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.*

</details>

Hey, good catch.

It looks like the high number of points is to try to get a more accurate result when transforming the layer’s native bounds to a GWC GridSet’s CRS. I guess the default 5 points rectangle can result in too much deformation depending on the src to target transform.

In any case, I concurr 10k points could be too much, really not my area of expertise, and it is tricky to automatically handle any layer. I’m ok with your patch, since in the event someone experiences an actual issue there’s a work around.

Cheers,
Gabriel.

···

Gabriel Roldán
Software Developer | Boundless
groldan@anonymised.com
@boundlessgeo

Hi Gabriel,
thanks for the follow up!
Next weekend I’ll (hopefully) clean up the pull request and merge it then

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.