标签
PostgreSQL , PostGIS , geos
背景
http://lin-ear-th-inking.blogspot.com/2019/02/betterfaster-stpointonsurface-for.html
使用GEOS新的代码,提升PostGIS重计算的函数性能。 The improved ST_PointOnSurface runs 13 times faster than the old code.
And now for the final chapter in the saga of improving For those who missed the first two episodes, the series began with for the venerable JTS Geometry.interiorPoint() for polygons algorithm.
Episode 2 travelled deep into the wilds of C++ with a .
The series finale shows how this results in greatly improved performance of PostGIS .
The dataset is a convenient test case, since it has lots of large polygons (shown here with interior points computed).
The query is about as simple as it gets:Here's the query timings comparison, using the improved GEOS code and the previous implementation:
As expected, there is a dramatic improvement in performance.
The improved ST_PointOnSurface runs 13 times faster than the old code.
And it's now as fast as ST_Centroid.
It's also more robust and tolerant of invalid input (although this test doesn't show it).
This should show up in PostGIS in the fall release (PostGIS 3 / GEOS 3.8).
On to the next improvement... (and also gotta update the and the !)
by Dr JTS (noreply@blogger.com) at March 01, 2019 07:02 PM