[postgis-users] Re: "Summarizing" a collection of geometries

Kevin Neufeld kneufeld at refractions.net
Fri Apr 25 21:58:48 PDT 2008


Hi Reid,

ST_Buffer(geometry, double) will expand a geometry by some specified 
distance, creating a new larger geometry.  I don't think this is the 
effect you are after - creating simplified geometries that are quicker 
to load at a larger zoom scales.

I would recommend that you break your MultiPolygons into individual 
Polygons.  If this is just for viewing purposes, at a large scale, you 
may find that polygons with small areas are insignificant and could be 
converted into point geometries.  Further, I would run your Geometries 
through ST_Simplify, which will reduce the number of vertices by some 
specified tolerance using the Douglas-Peuker algorithm.  Keep in mind 
that ST_Simply does not enforce geometry validity, so you may have to 
check for that afterwards. (ST_SimplifyPreserveTopology() has been know 
to return invalid geometries as well).  Alternatively, depending on what 
you want for summarized geometries, you could take a convexhull of your 
individuals Polygons as a "rough" approximation to their location.

In this way, a user can zoom to an area with a number of Points, and as 
they zoom in the Points would change to simplified Polygons of various 
tolerances, then eventually to your original complete Polygons.

-- Kevin

>
> Hi Kevin,
>
> Thanks for the note.
>
> The use case is basically indicating to users where they might like to
> zoom in if they want to see more details. So, the summary doesn't need
> to accurately represent the summarized geometries, just show roughly 
> where they are.
>
> They will be seeing the summaries from scales of about 1 meter/128
> pixels up to 1 meter/8 pixels. Above this scale we show the actual 
> geometry.
>
> The summaries will be fetched as vectors, not rasters.
>
> Did this scheme seem reasonable?
>
>> 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.
>
> Thanks,
>
> Reid
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list