On Tue, Sep 11, 2018 at 3:18 PM Olyster <gagnon_oliv...@outlook.com> wrote:

> Hi,
>
> I'm currently developing a feature. I'm modifying gt-jdbc-version.jar.
>
> I need to calculate the scale so I need the bbox (which I already have) and
> the width queryString parameter.
>
> Is it available from classes in gt-jdbc ? If not, from which class/jar
> should I propagate it ?
>

GeoServer makes the following variables available via the Env function, it
was meant for
SLD usage, but you can query them using EnvFunction pretty much from
everywhere, including
the JDBC stores:

https://github.com/geoserver/geoserver/blob/6e9e25c0c7cdda9ada9f33f8255130d3afc76801/src/wms/src/main/java/org/geoserver/wms/RenderingVariables.java#L22

However, mind, if you are trying to support generalization, the renderer is
already passing down a query hint
to all JDBC stores that support it, providing the target resolution.
PostGIS for example uses to run a in-database
simplification of data before returning it to GeoTools, see this bit and
search for other parts of the class with the "simplification" keyword:
https://github.com/geotools/geotools/blob/1c6ec822352d00a4e6566a7e669ee501384932ae/modules/plugin/jdbc/jdbc-postgis/src/main/java/org/geotools/data/postgis/PostGISDialect.java#L1487

It is in general more useful because you get the simplifcation distance in
the data native CRS, instead of the requested one (which can be
different, in case of reprojection)

Hope this helps

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.*
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


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

Reply via email to