[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] st_area yields negative value for multi-part polygon
From:       pcreso () pcreso ! com
Date:       2012-08-17 22:00:59
Message-ID: 1345240859.25036.YahooMailClassic () web122005 ! mail ! ne1 ! yahoo ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi George,

That is not a multi-part polygon (multipolygon). It is a polygon with a hole, & the \
hole lies outside the polygon boundary so it is going to give weird results. I'm \
guessing that what you actually mean to do is not:

psql -d test -c "SELECT st_area(ST_GeomFromText('POLYGON((-1 -1, 2 2, 0 1, -1 -1),(3 \
3, 5 5, 3 5, 3 3))'));"  st_area 
---------
    -0.5


but 

psql -d test -c "SELECT st_area(ST_GeomFromText('MULTIPOLYGON(((-1 -1, 2 2, 0 1, -1 \
-1)),((3 3, 5 5, 3 5, 3 3)))'));"  st_area 
---------
     3.5


HTH,

  Brent Wood


--- On Sat, 8/18/12, george young <georgeryoung@gmail.com> wrote:

From: george young <georgeryoung@gmail.com>
Subject: [postgis-users] st_area yields negative value for multi-part polygon
To: postgis-users@postgis.refractions.net
Date: Saturday, August 18, 2012, 7:58 AM

PostgreSQL 9.1.4 on x86_64-unknown-linux-gnu, compiled by gcc (GCC)
4.4.4 20100630 (Red Hat 4.4.4-10), 64-bit
postgis-2.0.1, libgeos_c.so.1.7.5

gis=# SELECT st_area(ST_GeomFromText('POLYGON((-1 -1, 2 2, 0 1, -1
-1),(3 3, 5 5, 3 5, 3 3))'));
 st_area
---------
    -0.5

what does this mean?  What is negative area?
In general, what are the semantics of polygons with more than one
sequence of vertexes?
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[Attachment #5 (text/html)]

<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: \
inherit;"><br>Hi George,<br><br>That is not a multi-part polygon (multipolygon). It \
is a polygon with a hole, &amp; the hole lies outside the polygon boundary so it is \
going to give weird results. I'm guessing that what you actually mean to do is \
not:<br><br>psql -d test -c "SELECT st_area(ST_GeomFromText('POLYGON((-1 -1, 2 2, 0 \
1, -1 -1),(3 3, 5 5, 3 5, 3 3))'));"<br>&nbsp;st_area \
<br>---------<br>&nbsp;&nbsp;&nbsp; -0.5<br><br><br>but <br><br>psql -d test -c \
"SELECT st_area(ST_GeomFromText('MULTIPOLYGON(((-1 -1, 2 2, 0 1, -1 -1)),((3 3, 5 5, \
3 5, 3 3)))'));"<br>&nbsp;st_area <br>---------<br>&nbsp;&nbsp;&nbsp;&nbsp; \
3.5<br><br><br>HTH,<br><br>&nbsp; Brent Wood<br><br><br>--- On <b>Sat, 8/18/12, \
george young <i>&lt;georgeryoung@gmail.com&gt;</i></b> wrote:<br><blockquote \
style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: \
5px;"><br>From:  george young &lt;georgeryoung@gmail.com&gt;<br>Subject: \
[postgis-users] st_area yields negative value for multi-part polygon<br>To: \
postgis-users@postgis.refractions.net<br>Date: Saturday, August 18, 2012, 7:58 \
AM<br><br><div class="plainMail">PostgreSQL 9.1.4 on x86_64-unknown-linux-gnu, \
compiled by gcc (GCC)<br>4.4.4 20100630 (Red Hat 4.4.4-10), \
64-bit<br>postgis-2.0.1,&nbsp;libgeos_c.so.1.7.5<br><br>gis=# SELECT \
st_area(ST_GeomFromText('POLYGON((-1 -1, 2 2, 0 1, -1<br>-1),(3 3, 5 5, 3 5, 3 \
3))'));<br>&nbsp;st_area<br>---------<br>&nbsp; &nbsp; -0.5<br><br>what does this \
mean?&nbsp; What is negative area?<br>In general, what are the semantics of polygons \
with more than one<br>sequence of \
vertexes?<br>_______________________________________________<br>postgis-users mailing \
list<br><a ymailto="mailto:postgis-users@postgis.refractions.net" \
href="/mc/compose?to=postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br><a
  href="http://postgis.refractions.net/mailman/listinfo/postgis-users" \
target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br></div></blockquote></td></tr></table>




_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic