Okay so it looks like access to a double[] array is what is important here,
and dimension and measures can be used as a guide to the contents. The size
can even be used if you end up in the case you describe where the array is
longer then the data contained within it.

I assume you only want this array if it is readily available. Easy enough
to add that method to PackedCoordinateSequence.DOUBLE. But for
CoordianteArraySequence
or PackedCoordinateSequence.FLOAT there is no advantage to be had.
--
Jody Garnett


On Thu, 2 Aug 2018 at 00:33, Andrea Aime <[email protected]>
wrote:

> On Wed, Aug 1, 2018 at 8:25 PM Jody Garnett <[email protected]>
> wrote:
>
>> Can you tell me more above it the direct access to the coordinate array?
>>
>
> Ok. Basically we have bits of code that love to work against arrays of
> ordinates, direct access to the ordinate array avoids
> having to build a new copy of the internal array in the consumer code
> (e.g., reprojection is significantly faster when working directly
> against an array of ordinates, than when reprojecting point by point).
> Check the getXYArray and getOrdinateArray(dimension) here:
>
> https://github.com/geotools/geotools/blob/9fbd02a320fa19d563972808d226a0a0445a5b13/modules/library/main/src/main/java/org/geotools/geometry/jts/LiteCoordinateSequence.java#L278
>
> and their usage in these two places:
>
> https://github.com/geotools/geotools/blob/9fbd02a320fa19d563972808d226a0a0445a5b13/modules/library/main/src/main/java/org/geotools/geometry/jts/Decimator.java#L463
>
> https://github.com/geotools/geotools/blob/9fbd02a320fa19d563972808d226a0a0445a5b13/modules/library/main/src/main/java/org/geotools/geometry/jts/LineIterator2.java#L76
>
> and then also direct access on the write side here:
>
> https://github.com/geotools/geotools/blob/9fbd02a320fa19d563972808d226a0a0445a5b13/modules/library/main/src/main/java/org/geotools/geometry/jts/Decimator.java#L540
>
> Now, ideally on the last bit of code it would be nice to avoid having that
> second array allocation for the packed, final size version of the array,
> and instead just tell the sequence to keep its array, but consider only
> the first N elements. Back when this was coded (over 10 years ago) we did
> not have yet
> PNGJ and Marlin, so I'm guessing doing that did not give much benefit, but
> today it might, given the different weight of the various map serving steps.
> Something to try out on a rainy day, or if/when we participate again in a
> performance contest [1], along with Laurent's suggestion to
> pool the arrays instead of re-allocating them over and over for each new
> geometry read (that would require a StreamingRenderer specific
> coordinate sequence factory that has a "dispose" method which will give
> back the ordinate arrays to the pool).
>
> Cheers
> Andrea
>
> [1] Reminder, while we haven't had a FOSS4G performance shootout in a long
> while, the performance is still being checked regularly,
> e.g.
> http://www.agrotic.org/blog/wp-content/uploads/2016/12/02_performance_qgis_server.pdf
> and
> https://github.com/camptocamp/ms_perfs
> https://github.com/camptocamp/docker-geoserver/
>
> ==
>
> 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.*
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to