[postgis-users] bow-tie polygons and the like

Chris Hermansen chris.hermansen at timberline.ca
Tue Apr 1 10:15:59 PDT 2008


Hi Nicolas, all;

Nicolas, I understand your comment.  But after looking at the data some
more in OpenJump, that appears to not be my problem.

If I load the PostGIS theme into OpenJump and run the QA on it, I see
that it is the polygon that contains the bow-tie shaped figure that is
the problem.

I can represent this schematically as:

+-----------------+
|                 |
|              |><|
|                 |
+-----------------+

(again, I hope this works out visually.  I have done the figure in
fixed-width text).

OpenJump's QA tool shows that there is an error in the enclosing polygon
at the "bow-tie point", and that the enclosing polygon is a bad feature.

The triangle polygons themselves are not shown as bad features.  There
are points shown at all corners of the triangles, ie there is no real
"bow-tie" type self intersection.

The enclosing polygon contains all the edges shown in the above figure,
including those of the triangles.  Each triangle is a separate polygon.

I've traced the order of the edges of the enclosing polygon and it
appears that it is the ordering of these edges that is creating the
crossing / bow-tie in the enclosing polygon.  That is, the enclosing
polygon's points define the edges as follows:

pt 0: se corner of east triangle
pt 1: bow-tie point
pt 2: nw corner of west triangle
pt 3: sw corner of west triangle
pt 4: bow-tie point
pt 5: ne corner of east triangle
... and off to the remainder of the enclosing polygon points

So it appears to me that the edges of the western triangle are actually
traversed in the wrong order in the enclosing polygon.  As well, clearly
there is a self-intersection in the enclosing polygon.

I conclude from this that the order of traversal of the western triangle
edges could be reversed and preserve the clockwise traversal of the
enclosing polygon's edges.  However I think the fact that the bow-tie
point is traversed twice in the same polygon is a real problem that must
be repaired (manually in this case, I guess).

Does anyone have any comments on this?  Thanks in advance!

Nicolas Ribot wrote:
>>  Good people;
>>
>>  I have this odd problem that I hope others may clarify for me.
>>
>>  I have a big ArcInfo polygon coverage produced by a sequence of spatial
>> unions.  One of the component polygon coverages was brutalized somewhere
>> along the way and it has some polygons with triangular and bow-tie
>> inclusions.
>>
>>  Nevertheless, the coverage is clean and sober as far as ArcInfo is
>> concerned.
>>
>>  If you all can picture in your minds a bow-tie polygon |><| where the
>> rightmost | of the bowtie is actually the edge of an enclosing polygon, kind
>> of like:
>>
>>        |
>>  |><|
>>        |
>>
>>  (I sure hope that works out visually...)
>>
>>  OK, when I use ogr2ogr to import this coverage into postgis 1.3.1 /
>> geos-3.0.0rc4, I see the following:
>>
>>
>>
>> the containing polygon fails at st_isValid()
>> the st_area() of the containing polygon appears to include the area of the
>> bow-tie polygon, ie it is larger than the area copied over from the ArcInfo
>> coverage by about the same amount as the area of the bow-tie polygon When I
>> look at this little mess with OpenJump, sure enough the QA routines find the
>> bow-tie and complain.
>>
>>  The long and the short of this is that PostGIS returns slightly more area
>> than ArcInfo does for the same big ugly polygon coverage, because of the
>> apparent loss of these bow ties.
>>
>>  What I'm not sure about is what exactly is wrong here.  Is the bow-tie
>> shape itself illegal?  Or is it the fact that both sides of the bow-tie
>> belong to the same polygon?  Or something else I'm missing?
>>
>>  Thanks for any light anyone can shed on this.
>>
>>
>>     
>
> Hi,
> I will only give a partial answer:
> yes, a bowtie polygon is invalid for PostGIS (as stated in the OGC
> SFSQL documentation, polygon's boundary cannot cross itself).
> If you want to represent this with valid polygons, you will need 2
> triangles touching at one point.
>
> HTH
> nicolas
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>   


-- 
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