PJ,

I guess your dealing with Lithuania data. Your problem is twofold:

- You have lat and lon in the wrong order
- You should use UTM zone 35N, which is the one for Lithuania

Hence, do the following:

select st_area(st_transform(geometryFromText('POLYGON((21.06079 56.05364
,22.12646 56.43213 ,24.55444 56.27386 ,24.88403 56.41998
,25.10376 56.17002 ,26.63086 55.6528 ,26.25732 54.965 ,25.75195 54.78168
,25.62012 54.31652 ,25.74097 54.14957 ,25.53223 54.18173 ,25.47729 54.28447
,24.37866 53.90434 ,23.47778 53.96255 ,23.20313 54.25881 ,22.77466 54.35496
,22.82959 54.78802 ,22.65381 54.95239 ,21.32446 55.26034 ,21.0498 56.0475
,21.06079 56.05364 ))', 4326), 32635));

--> 64039242950.5568 (sqm)

GL

Paulius J wrote:
Thank you for your quick reply Nicolas,

Now I get the results which are more likely to be the truth, but they differ
from reality quiet a lot.
Maybe it can be a problem that I got these coordinates from Google Maps? If
I am correct, the polygon which I posted as example should be about 64 000
square kilometers.

Paulius J


Nicolas Ribot wrote:
On 11/03/2008, Paulius J <[EMAIL PROTECTED]> wrote:
 Hello,

 I have such a problem. Here is my polygon and it looks that everthing is
 allright:
 POLYGON((56.05364 21.06079,56.43213 22.12646,56.27386 24.55444,56.41998
 24.88403,56.17002 25.10376,55.6528 26.63086,54.965 26.25732,54.78168
 25.75195,54.31652 25.62012,54.14957 25.74097,54.18173 25.53223,54.28447
 25.47729,53.90434 24.37866,53.96255 23.47778,54.25881 23.20313,54.35496
 22.77466,54.78802 22.82959,54.95239 22.65381,55.26034 21.32446,56.0475
 21.0498,56.05364 21.06079))

 But when i want to find the area of it using Area i get the result:
 9.04832470074997
 I do not know how to get the area size in square meters or something
similar
 to this? Maybe i should use some other function, but according the
postgis
 manual I use Area or ST_Area and have such problem...

 P.S. i am using SRID = 4326 for the Geometry column.

ST_area computes the area in geometry's units. Here square degrees.
Repreject your data in a metric reference system (like UTM for
instance) with st_transform(), then compute the area.

Something like:

select st_area(st_transform(geometryFromText('POLYGON((56.05364
21.06079,56.43213 22.12646,56.27386 24.55444,56.41998
24.88403,56.17002 25.10376,55.6528 26.63086,54.965 26.25732,54.78168
25.75195,54.31652 25.62012,54.14957 25.74097,54.18173 25.53223,54.28447
25.47729,53.90434 24.37866,53.96255 23.47778,54.25881 23.20313,54.35496
22.77466,54.78802 22.82959,54.95239 22.65381,55.26034 21.32446,56.0475
21.0498,56.05364 21.06079))', 4326), 32640));

Nico
_______________________________________________
postgis-users mailing list
[email protected]
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
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to