[Gvsig_english] gvSIG 1.9::strange result when calculating area
Juan Lucas Dominguez Rubio
jldominguez at prodevelop.es
Fri Nov 27 16:35:00 CET 2009
Hello,
one of the libraries used by gvSIG (JTS) has a function called signedArea(). From their doc:
"public static double signedArea(Coordinate[] ring)
Returns the signed area for a ring.
The area is positive if the ring is oriented clockwise."
It's not easy to check if this is the cause, because gvSIG changes the orientation when you add a counter-clockwise polygon in editing mode.
I understand Wolfgang is using polygons which were not previously edited with gvSIG, so maybe they are originally counter-clockwise?
I'm not sure this is a bug. You can get the area with "abs(area())" and the orientation with "area() > 0". Maybe the orientation is useful in some context...
Regards,
Juan Lucas Domínguez Rubio
---
Prodevelop SL, Valencia (España)
Tlf.: 96.351.06.12 -- Fax: 96.351.09.68
http://www.prodevelop.es <http://www.prodevelop.es/>
---
________________________________
De: gvsig_internacional-bounces at listserv.gva.es en nombre de Wolfgang Qual
Enviado el: vie 27/11/2009 14:53
Para: Users and Developers mailing list
Asunto: [Gvsig_english] gvSIG 1.9::strange result when calculating area
Hi list,
I just used the area()-Function to calculate the area of a polygon them and was surprised, as
all values were negative. The absolute value was correct, "only" the minus is very strange.
The layers I tested were from our official database. I am confused by this, as determinating the area using the
measure tool results in the correct value (without "-"). Moreover, if I use the "split"-tool and recalculate the area,
the area of the splitted geometries is positive (the rest remains negative). Very strange.
Any ideas are appreciated very much.
Best,
Wolfgang
--
<https://correo.prodevelop.es/exchange/jldominguez/Borradores/RE:%20[Gvsig_english]%20gvSIG%201.9::strange%20result%20when%20calculating%20area.EML/1_multipart/logo_b.gif>
Wolfgang Qual
Referat für Gesundheit und Umwelt
Umweltschutz
Umweltvorsorge
RGU-UW 11
Bayerstraße 28a
80335 München
Telefon +49 - 89 - 233 - 4 77 17
Telefax +49 - 89 - 233 - 4 77 05
http://www.muenchen.de/umweltatlas
uw11.rgu at muenchen.de
Bitte beachten Sie die Hinweise zur elektronischen
Kommunikation mit der Landeshauptstadt München:
http://www.muenchen.de/ekomm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.gva.es/pipermail/gvsig_internacional/attachments/20091127/4a131b83/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo_b.gif
Type: image/gif
Size: 590 bytes
Desc: logo_b.gif
Url : http://listserv.gva.es/pipermail/gvsig_internacional/attachments/20091127/4a131b83/attachment.gif
More information about the Gvsig_internacional
mailing list