[postgis-users] Re: "Summarizing" a collection of geometries
Dylan Beaudette
dylan.beaudette at gmail.com
Tue Apr 22 11:45:50 PDT 2008
On Tuesday 22 April 2008, Reid Priedhorsky wrote:
> Reid Priedhorsky wrote:
> > Dear list,
> >
> > I would like to compute a "summary" of a collection of geometries
> > (points, linestrings, polygons, or any combination).
> >
> > Here is the use case. I would like to summarize the geometry collection
> > and present this summary visually so users working at a small scale can
> > see, "ah, if I zoom in here, I can see more details about this geometry
> > collection".
> >
> > The simple solution would be to compute a convex hull or bounding box,
> > but this fails if the members of the collection are far apart (users
> > could zoom into the middle and see nothing). In this case the summary
> > would need to be a multipolygon. But the trick is figuring out when to
> > split summary polygons into multipolygons.
> >
> > Has this been done? Do any of you have suggestions or references?
> >
> > It is very preferable to do this entirely in the database rather than in
> > external code. Embedded procedures are fine.
> >
> > As you can see I am not entirely sure of my terminology, so any
> > suggestions there would be welcome as well.
>
> Just to clarify, this is something I need to do now -- I don't want to
> wait until a really slick way is implemented.
>
> Here's one idea:
>
> 1. Use ST_Buffer() to compute polygon buffers around members of the
> collection. Question: ST_Buffer() docs say it can't handle
> GeometryCollections. What about e.g. MultiPoint or MultiPolygon?
>
> 2. Take the ST_Union() of the result of #1, producing a MultiPolygon.
>
> Does seem like a reasonable approach?
>
> Thanks,
>
> Reid
Have you explored other options (since you need the result now) such as GRASS?
There are several vector operations that will output a "density" estimate as
a raster.
v.neighbors:
http://grass.osgeo.org/grass63/manuals/html63_user/v.neighbors.html
v.kernel:
http://grass.osgeo.org/grass63/manuals/html63_user/v.kernel.html
These methods are also available in R, as long as the number of objects can
fit into memory.
Cheers,
Dylan
--
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341
More information about the postgis-users
mailing list