[Geoserver-devel] Vector tiles: why using accurate scale instead of OGC scale?

Hi,
profiling the vector tiles generating code I’ve found that significant time is spent in a mere scale computation, because
it’s a true, on the ground scale, which requires ellipsoidal distance computation (internally it also does referencing factory
lookups, which limits scalability):

https://github.com/geoserver/geoserver/blob/master/src/extension/vectortiles/src/main/java/org/geotools/renderer/lite/VectorMapRenderUtils.java#L125

This is unlike the normal map rendering, which uses the simplified OGC scale.
Was there any specific reason for that? I’d rather have the code fast and consistent with WMS, would not you?

Diff for reference:

diff --git a/src/extension/vectortiles/src/main/java/org/geotools/renderer/lite/VectorMapRenderUtils.java b/src/extension/vectortiles/src/main/java/org/geotools/renderer/lite/VectorMapRenderUtils.java
index 16fb269191…593223853a 100644
— a/src/extension/vectortiles/src/main/java/org/geotools/renderer/lite/VectorMapRenderUtils.java
+++ b/src/extension/vectortiles/src/main/java/org/geotools/renderer/lite/VectorMapRenderUtils.java
@@ -119,18 +119,10 @@ public class VectorMapRenderUtils {

public static double getMapScale(
WMSMapContent mapContent, final ReferencedEnvelope renderingArea) {

  • final double mapScale;
  • try {
  • mapScale =
  • RendererUtilities.calculateScale(
  • return RendererUtilities.calculateOGCScale(
    renderingArea,
    mapContent.getMapWidth(),
  • mapContent.getMapHeight(),
    null);
  • } catch (TransformException | FactoryException e) {
  • throw Throwables.propagate(e);
  • }
  • return mapScale;
    }

public static int getComputedBuffer(

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.