[postgis-devel] Geometry clustering functions
Daniel Baston
dbaston at gmail.com
Thu Jan 15 14:44:27 PST 2015
ST_Cluster* is probably more clear.
I had been thinking of separate functions with fairly different
implementations - ST_ClusterIntersecting being flexible in the types of
geometries that it would take and using GEOS to run the intersection test.
For the case of ST_ClusterWithinDistance, I thought it might make sense to
restrict arguments to points, and keep the implementation within lwgeom,
maybe bringing in a kdtree (I currently do this work on tens of millions of
points, and I'm concerned about memory footprint, maybe prematurely).
If these implementation differences make sense, my inclination would be to
to expose these differences to the user through different function names.
I guess an alternative would be to call the appropriate backend function
based on the types of arguments received.
Thanks,
Dan
On Thu, Jan 15, 2015 at 5:22 PM, Paul Ramsey <pramsey at cleverelephant.ca>
wrote:
> Do we want to go the “Accum” naming route, or introduce a “cluster” work?
>
> ST_ClusterWithinDistance
>
> Also, since the intersecting cluster is just the withindistance with a
> tolerance of zero, would having just one function be good or bad?
>
> P.
>
> --
> Paul Ramsey
> http://cleverelephant.ca
> http://postgis.net
>
> On January 15, 2015 at 2:07:24 PM, Daniel Baston (dbaston at gmail.com)
> wrote:
>
> Glad to hear there is some interest! I posted some ideas to
> http://trac.osgeo.org/postgis/wiki/DevClusteringFunctions
>
> Thanks,
> Dan
>
> On Thu, Jan 15, 2015 at 12:28 PM, Paul Ramsey <pramsey at cleverelephant.ca>
> wrote:
>
>> Daniel,
>> This is interesting stuff, could you post some example function
>> signature and input/output pictures on the wiki so we can do a little
>> design review. I thing it’s very exciting and am very positive about it.
>>
>> P
>>
>> --
>> Paul Ramsey
>> http://cleverelephant.ca
>> http://postgis.net
>>
>> On January 15, 2015 at 4:14:44 AM, Daniel Baston (dbaston at gmail.com)
>> wrote:
>>
>> Hello,
>>
>> I'm working on a couple of C-language functions to solve some clustering
>> problems I frequently face in PostGIS. I'm wondering if there may be any
>> level of interest in including such functions in the project? I would be
>> happy to flesh these out to include the error-handling and unit-testing
>> that would be required.
>>
>> Function #1 takes a GeometryCollection and returns the same geometries,
>> re-aggregated into groups of interconnected geometries (solving a question
>> I posted about at http://gis.stackexchange.com/q/94203 )
>>
>> (Internally this builds an STRtree using GEOS and uses a union-find
>> structure to identify connected components....as an aside, I am wondering
>> if there is some way to take advantage of a database spatial index that may
>> already exist)
>>
>> Function #2 (not written) would solve a related problem - we want to
>> take a set of points and return a set of MultiPoints, where each point in a
>> MultiPoint is within distance X of some other point in the MultiPoint.
>>
>> Thanks,
>> Dan
>> _______________________________________________
>> postgis-devel mailing list
>> postgis-devel at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
>>
>>
>> _______________________________________________
>> postgis-devel mailing list
>> postgis-devel at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
>>
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
>
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20150115/9f357b31/attachment.html>
More information about the postgis-devel
mailing list