[postgis-users] st_area yields negative value for multi-part polygon

Paul Ramsey pramsey at opengeo.org
Fri Aug 17 13:11:29 PDT 2012


It's not a valid polygon,

SELECT st_isvalidreason(ST_GeomFromText('POLYGON((-1 -1, 2 2, 0 1, -1
-1),(3 3, 5 5, 3 5, 3 3))'));
       st_isvalidreason
------------------------------
 Hole lies outside shell[3 3]
(1 row)

So the answer is going to be unpredictable.

P.

On Fri, Aug 17, 2012 at 12:58 PM, george young <georgeryoung at gmail.com> wrote:
> 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 at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list