[postgis-users] Problem with st_polygonize()

Chris Hermansen chris.hermansen at timberline.ca
Wed Oct 24 11:00:03 PDT 2007


More on this st_polygonize() "problem".

I've tried to polygonize the linework in OpenJUMP and the same,
apparently weird, thing happens there, too.  That is, in the polygons
generated by polygonize, some of the interior lines and some of the
exterior lines have been dropped, and so there are less polygons than
one would expect from looking at the linework.

I've checked the linework and there don't appear to be any invalid
components.

Anyone have any ideas?

Chris Hermansen wrote:
> Good people;
>
> In my continuing attempts to merge two partially overlapping polygon
> networks, I've run into a problem with st_polygonize() that seems to me
> to be a bug.
>
> I have the forestry equivalent of buildings on parcels.  I'm following
> the Wiki example of overlaying two different and not completely
> overlapping polygon networks provided by Kevin Neufeld.
>
> With some modifications to the method Kevin shows, I'm at the point
> where I have some linework that I want to re-polygonize using the
> following SQL adapted from Kevin's example:
>
> CREATE TEMP TABLE newPolys (
>     gid serial PRIMARY KEY,
>     geom geometry);
> INSERT INTO newPolys (geom)
>     SELECT geom AS geom
>     FROM st_dump((
>         SELECT st_polygonize(geom) AS geom
>         FROM nodedLinework));
>
> This statement runs to completion very quickly.  The only difficulty I
> have is that a bunch of the lines in nodedLinework are dropped and so
> there aren't enough polygons.
>
> If I isolate the call to st_polygonize(), it generates a
> GEOMETRYCOLLECTION with a deficit of polygons.  So whatever problem is
> occurring seems to be happening right there.
>
> This is not a big dataset; by my count I expect 20 - 25 polygons and I
> get 15.
>
> Any suggestions?
>
>   


-- 
Regards,

Chris Hermansen · mailto:clh at timberline.ca
tel:+1.604.714.2878 · fax:+1.604.733.0631
Timberline Natural Resource Group · http://www.timberline.ca
401 · 958 West 8th Avenue · Vancouver BC · Canada · V5Z 1E5

C'est ma façon de parler.




More information about the postgis-users mailing list