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

Paul Ramsey pramsey at refractions.net
Fri Jan 11 08:14:03 PST 2008


Don't forget:

SELECT ST_IsValid('MultiPolygon( ((0 0,0 3,3 3,3 0,0 0)),((11,1 4,4  
4,4 1,1 1)))')  --> FALSE

P.

On Jan 11, 2008, at 1:19 AM, Guido Lemoine wrote:

> 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
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20080111/6d7a402a/attachment.html>


More information about the postgis-users mailing list