On Sat, Jan 4, 2014 at 11:26 PM, Andrea Aime
<[email protected]>wrote:
> Given that when ST_Simplify was tried by Mapnik, it was actually tried by
> a PostGIS developer,
> maybe they improved ST_Simplify performance in the process? Not sure, I
> also plan to
> check the code of ST_Simplify and see if/how it differs from the JTS
> implementation.
>
Hmm... looking at the PostGIS code, ST_Simplify got indeed optimized back
in 2009 by Paul,
making it a lwgeom operation:
https://github.com/postgis/postgis/commit/4afb908dbad25cab2c656173a130e61e223739e7
The implementation also uses a few tricks to speed up things and use less
memory,
like using a custom stack with just the minimum state instead of using real
recursion.
By contrast, JTS implementation forces us to use Coordinate[], which
defeats the LiteCoordinateSequence
optimizations (which basically allows us to reduce the memory used by
coordinates, pack them in memory
in a sequential set of memory cells, and reduce the garbage collector
work), and indeed uses
plain recursion:
https://github.com/postgis/postgis/blob/047c30fc636e0fcdef536d3324d69bad084a7ec8/liblwgeom/ptarray.c#L1480
Neither of them seems to to be using squared distances (we don't care about
the actual distance, just
looking for the farthest point)
It would be interesting to try this out in pure java and see if it helps
any when working against shapefiles,
although in the case of postgis, like Thomas observes, we also have the
advantage of being able
to send over less points, something we would not get with shapefiles.
Cheers
Andrea
--
*== GeoSolutions will be closed for seasonal holidays from 23/12/2013 to
06/01/2014 ==*
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel