[postgis-tickets] [PostGIS] #3960: Unify centroid functions
PostGIS
trac at osgeo.org
Wed Dec 27 06:58:34 PST 2017
#3960: Unify centroid functions
---------------------+---------------------------
Reporter: komzpa | Owner: pramsey
Type: task | Status: new
Priority: medium | Milestone: PostGIS 2.5.0
Component: postgis | Version: trunk
Keywords: |
---------------------+---------------------------
Code currently contains at least three centroid implementations:
ST_Centroid backing function, calls GEOS, has CIRCULAR* support, no weight
support:
https://github.com/postgis/postgis/blob/b8400aeff39419e6e57f61589a66d3bc4f4a6cc5/postgis/lwgeom_geos.c#L1346
lwgeom_centroid, KMeans backing, calls GEOS, has no CIRCULAR* support
visible:
https://github.com/postgis/postgis/blob/8d538e952743acf3e9311e4f576d2afd00ae1fc1/liblwgeom/lwgeom_geos.c#L940
median init_guess, only points, no GEOS, supports weights:
https://github.com/postgis/postgis/blob/svn-
trunk/liblwgeom/lwgeom_median.c#L124
It looks like all three can be merged and pulled closer together,
providing a weighted centroid for multipoints and support for CIRCULAR* in
kmeans.
Are there any other places?
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3960>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list