[postgis-users] Area calculation oh two polygon that they are overlapping

Guido Lemoine guido.lemoine at jrc.it
Fri Jan 11 01:19:50 PST 2008


SELECT ST_Area(ST_Intersection(GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 
0))'),
GeomFromText('Polygon((1 1,1 4,4 4,4 1,1 1))'))) --> 4 (QED)

SELECT ST_Area(ST_Union(GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))'),
GeomFromText('Polygon((1 1,1 4,4 4,4 1,1 1))'))) --> 14



Paul Ramsey wrote:
> ST_Area(ST_Intersection(g1,g2)) ?
>
> On Jan 10, 2008, at 8:23 AM, olivier.amram at free.fr wrote:
>
>> Yes, but how do you calculate the area of the intersection ?
>>
>> Olivier.
>>
>> Selon Guido Lemoine <guido.lemoine at jrc.it>:
>>
>>> Your multipolygon is simply two rings of 3 by 3. Defining them
>>> as multipolygon does do nothing for intersection, so the area is 18
>>> (which is 9 + 9). You need to look up what intersection means.
>>> For me, the intersection of the 2 polygons is the common area,
>>> which is 4.
>>>
>>> GL
>>>
>>> olivier.amram at free.fr wrote:
>>>> Hi,
>>>>
>>>> I'd like to compute the total area of polygon that intersects with 
>>>> another
>>>> polygon
>>>>
>>>> Polygon(0 0,0 3,3 3,3 0,0 0)
>>>> Polygon(1 1,4 1,4 4,1 4,1 1)
>>>>
>>>> The total area is 14 but I don't find a solution to compute this 
>>>> value.
>>>>
>>>> e.g. SELECT Area(GeomFromText('MultiPolygon( ((0 0,0 3,3 3,3 0,0 
>>>> 0)),((1
>>> 1,1 4,4
>>>> 4,4 1,1 1)))')) --> 18
>>>>
>>>> Have you any idea ?
>>>>
>>>> Thank,
>>>>
>>>> Olivier.
>>>>
>>>> _______________________________________________
>>>> postgis-users mailing list
>>>> postgis-users at postgis.refractions.net
>>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>>>
>>>>
>>>
>>> -- 
>>> ----------------------------------------------------------------
>>> Guido Lemoine
>>> Joint Research Centre, European Commission
>>> Institute for the Protection and Security of the Citizen (IPSC)
>>> Support to External Security
>>> Via E. Fermi, 2749 TP 267 Ispra 21027 (VA), Italy
>>> Tel. +39 0332 786239 (direct line) Fax. +39 0332 785154
>>> WWW: http://ses.jrc.it
>>> ----------------------------------------------------------------
>>> Disclaimer:
>>> Views expressed are those of the individual and do not represent
>>> the views of the European Commission
>>>
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at postgis.refractions.net
>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>>
>>
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>

-- 
----------------------------------------------------------------
Guido Lemoine
Joint Research Centre, European Commission
Institute for the Protection and Security of the Citizen (IPSC)
Support to External Security
Via E. Fermi, 2749 TP 267 Ispra 21027 (VA), Italy
Tel. +39 0332 786239 (direct line) Fax. +39 0332 785154
WWW: http://ses.jrc.it
----------------------------------------------------------------
Disclaimer:
Views expressed are those of the individual and do not represent 
the views of the European Commission





More information about the postgis-users mailing list