Dear all,

I want to display the area of a polygon, for example :
POLYGON((45.179 1.94,45.179 1.95,45.182 1.95,45.182 1.94,45.179 1.94))

I cannot get the area either in m^2  or deg^2.
Am I missing something ?
Below are some tests I went through.

1) Area measured with QGIS :
Ellispsoïdal
square degrees : 0.00003 deg²
square meters : 369063.9 m²

Cartesian
square degrees : 0.00003 deg²
square meters : 371759.7 m²

2) Area displayed with mapserver
2.1) based on attribute [shape]
LABEL
   TEXT (" surf=" + tostring(area([shape]), "%.1f")  )
   ...
END

The area value depends on zoom level : the more I zoom in, the higher the
area value.
It turns out that the area is expressed in pixel^2

2.2) based on hard coded polygon
LABEL
   TEXT ("surf=" + tostring(area(fromText('POLYGON ((45.179 1.94,45.179
1.95,45.182 1.95,45.182 1.94,45.179 1.94))')), "%.10f")  )
...
END
The area value is exactly what I would expect (deg^2) : 0.00003

3) Conversion from deg^2 to m^2
The relationship is :
* Surf_m ~ Surf_deg * (R * pi/180)^2
* R ~ 6378137 (the earth radius in meters)

which yields to :
Surf_m ~ 371760.8 m^2
The information in this e-mail is confidential. The contents may not be 
disclosed or used by anyone other than the addressee. Access to this e-mail by 
anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and 
delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of 
this e-mail as it has been sent over public networks. If you have any concerns 
over the content of this message or its Accuracy or Integrity, please contact 
Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus 
scanning software but you should take whatever measures you deem to be 
appropriate to ensure that this message and any attachments are virus free.
_______________________________________________
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to