[postgis-users] Rép: Re: Getting boundary of set of polygons

Tom McCallum termcc at googlemail.com
Mon Jan 27 09:01:40 PST 2014


I kind of gave up on that, it seemed to work better just sending straight  
through simplify (my objective was to reduce the load time).  Everytime I  
tried one of the suggestions I ended up with one tiny polygon and none of  
the others seemed to be represented.  I think the underlying geometry must  
have been different to what I thought it was.



On Mon, 27 Jan 2014 16:54:21 -0000, Hugues François  
<hugues.francois at irstea.fr> wrote:

> I hope you'll tell us your final choice ! In your last query you  need  
> to add a pair of bracket to get only geometries from dump. Syntax is :  
> (st_dump(geom)).geom.
>
> Hug
>
> Tom McCallum <termcc at googlemail.com> a écrit :
>
> Thanks for all your replies, not quite there but got some ideas.
>
>
> On Mon, 27 Jan 2014 13:51:26 -0000, Rémi Cura <remi.cura at gmail.com>  
> wrote:
>
>> You could use convex or concav envelop.
>> You can also union the geometries (eventually simplifying by neg buffer
>> then pos buffer)
>> That's if you want precise boundary.
>> If you just need bbox ...
>> Cheers,
>> Rémi-C
>>
>>
>> 2014-01-27 Hugues François <hugues.francois at irstea.fr>
>>
>>> Hello,
>>>
>>> On my side, I often use
>>> st_buildarea(st_exteriorring((st_dump(geom)).geom)). And if I want to
>>> keep
>>> a single object for the original one, I union or collect them regarding
>>> their gid.
>>>
>>> HTH
>>>
>>> Hugues.
>>>
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: postgis-users-bounces at lists.osgeo.org [mailto:
>>> postgis-users-bounces at lists.osgeo.org] On Behalf Of Tom McCallum
>>> Sent: Monday, January 27, 2014 1:51 PM
>>> To: PostGIS Users Discussion
>>> Subject: Re: [postgis-users] Getting boundary of set of polygons
>>>
>>> St_MakePolygon does not take a multilinestring.
>>> ST_BuildArea looked possible, but it gives me back lots of little areas
>>> and not a single boundary for the whole set.
>>>
>>> It looks as though ST_Dump with ST_MakePolygon may be useful but am
>>> still
>>> trying to get the right form something like
>>>
>>> ST_MakePolygon( ST_DUMP( ST_BOUNDARY( ST_COLLECT( wkb_boundary ) )
>>> .geom )
>>>
>>> But it does not like the .geom bit.
>>>
>>> Any suggestions?
>>>
>>> On Mon, 27 Jan 2014 12:35:51 -0000, Nicolas Ribot
>>> <nicolas.ribot at gmail.com>
>>> wrote:
>>>
>>> > Hi,
>>> >
>>> > You should try st_makePolygon, or st_buildArea depending on the  
>>> result
>>> > you want (keeping holes or removing them).
>>> >
>>> > Nicolas
>>> >
>>> >
>>> >
>>> > On 27 January 2014 13:32, Tom McCallum <termcc at googlemail.com> wrote:
>>> >
>>> >> Hello all,
>>> >>
>>> >> I am trying to get the boundary of a geometry(polygon) field in
>>> >> postgis (multiple polygons in this field).  I have this so far:
>>> >>
>>> >> ST_BOUNDARY(ST_COLLECT(wkb_geometry))
>>> >>
>>> >> which outputs MultilineString.  I need to convert this to a polygon.
>>> >> I have tried all sorts of things from ST_DUMP to converting to text
>>> >> and then trying ST_BdPolyFromText but got nothing to work so far.
>>> >> ST_Convexhull gives me a polygon but unfortunately its not what I
>>> >> want.
>>> >>
>>> >> Could someone let me know what I should be calling.
>>> >>
>>> >> Thanks
>>> >>
>>> >> Tom
>>> >> _______________________________________________
>>> >> postgis-users mailing list
>>> >> postgis-users at lists.osgeo.org
>>> >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at lists.osgeo.org
>>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at lists.osgeo.org
>>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users


More information about the postgis-users mailing list