On Wed, Feb 6, 2019 at 12:06 PM Mauro Bartolomeoli <
[email protected]> wrote:

> Hi, I would like to add some optional behaviours for the
> advanced projection handling module, in particular:
>
>  * ability to disable the dateline crossing heuristic in
> WrappingProjectionHandler (sometimes it creates weird polygons, because of
> wrong assumptions, but it cannot be actually disabled without disabling
> wrapping completely)
>

I'd rather try to fix the heuristics, but yes, as an heuristic, it's never
going to be 100% correct. A flag to disable it might be interesting,
although, it's going to get hairy to decide when and how to do so.
A simple setup might be to have it global, like the wrapping now,
controlled by a StreamingRenderer hint like the
exiting CONTINUOUS_MAP_WRAPPING (see below)


>  * ability to densify points before reprojection; the densification
> distance should be configurable too (both for metric and degrees source
> CRSs); this would allow "deforming" projections to have more precise
> reprojections, with a (hopefully) small performance loss. Every projection
> handler should be able to decide if densification makes sense or not for
> that projection. I would use JTS Densifier for the job.
>

This was being discussed only  a few days ago, see the "Misaligned layers
after reprojecting with on-the-fly geometry simplification" thread.
The crux of the issue is that the amount of densification required to get a
smooth looking output is dynamic, and depends on a variety of factors:

   - the current area involved in the reprojection (close or far away from
   the central meridians?)
   - the zoom level (curved lines only normally need to appear when looking
   at wide areas)
   - the overall reprojection involved, e.g., if I have a straight line
   defined in polar stereographic coordinates, and want to display in UTM, the
   polar stereo will bend the line in one way to make it go WGS84, and the UTM
   in a different way

Thankfully we already have machinery to evaluate the amount of non linear
deformation involved in a certain reprojection in a certain area, we use to
to figure out if we can use an equivalent AffineTransform, or a regular
grid of AffineTransforms over the area, when reprojecting rasters, here:
https://github.com/geotools/geotools/blob/master/modules/library/referencing/src/main/java/org/geotools/referencing/operation/transform/WarpBuilder.java
I have the beginning of some changes to that class that would allow to
determine in how many subsets to split the drawing area in order to
consider each subset linear:
https://github.com/aaime/geotools/commits/dynamic_densify
In other words, if the tool tells you you have to split the rendering area
in a 10x10 grid, and the rendering area is 1024x768, then you could add a
point every 768/10 pixels in the data, and the result would look smooth
enough (and if it's 1x1, then you'd have not to densify at all).
You'd still have to determine what that means in terms of source CRS
distances, but that should not be too hard I hope.

Using the JTS Densifier may cause performance issues, JTS has the bad habit
of turning our optimized LiteCoordinateSequence into
CoordinateArraySequence, which allocates a bazillion objects to just
represent a line... however, one could first ask if the densification is
needed by looking at the bbox of the geometry, if it's smaller than the
densification distance, then you can skip it, leaving the overhead only to
those bits that actually need to be densified.


> The first concern, is where to store those options if we want them to be
> configurable from the UI (In an initial prototype I am using system
> properties, but I would like something more user friendly). Maybe we can
> add a new parameter to the ProjectionHandlerFactory: a map of hints /
> options that projection handlers can use to configure themselves. This
> would allow introducing new options in the future without extending the
> interface again.
>

It would, but pay attention not to break backwards compatibility, the
easiest thing is to add a new method and deprecate the old one, the old one
would refer to the new by using an empty map, or if you put wrapping in
int, turning the wrapping parameter into a hint

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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to