<HTML dir=ltr><HEAD>
<META content="text/html; charset=unicode" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18372"></HEAD>
<BODY bgColor=#ffffff text=#000000>
<DIV dir=ltr id=idOWAReplyText48743>
<DIV dir=ltr><FONT color=#000000 size=3 face="Times New Roman">Hello,</FONT></DIV>
<DIV dir=ltr><FONT color=#000000 size=3 face="Times New Roman">one of the libraries used by gvSIG (JTS) has a function called signedArea(). From their doc:</FONT></DIV>
<DIV dir=ltr><FONT color=#000000 size=3 face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV dir=ltr>"<FONT color=#000000 size=3 face="Times New Roman">public static double signedArea(Coordinate[] ring)</FONT></DIV>
<DIV dir=ltr><FONT color=#000000 size=3 face="Times New Roman">Returns the signed area for a ring.</FONT></DIV>
<DIV dir=ltr><FONT color=#000000 size=3 face="Times New Roman">The area is positive if the ring is oriented clockwise."</FONT></DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>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.</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>I understand&nbsp;Wolfgang is using polygons which were not previously edited with gvSIG, so maybe they are originally counter-clockwise?</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>I'm not sure this is a bug. You can get the area with "abs(area())" and the orientation with "area() &gt; 0". Maybe the orientation is useful in some context...</DIV>
<DIV dir=ltr><FONT color=#000000 size=3 face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT color=#000000 size=3 face="Times New Roman"></FONT>&nbsp;</DIV>
<DIV dir=ltr>Regards,</DIV>
<DIV dir=ltr>&nbsp;</DIV></DIV>
<DIV dir=ltr id=idSignature33231>
<DIV><FONT size=2 face="Courier New"><FONT size=3 face="Times New Roman">Juan Lucas Domínguez Rubio<BR></FONT>---</FONT></DIV>
<DIV><FONT size=2 face="Courier New"><FONT size=2 face="Courier New"><FONT size=2 face="Courier New">Prodevelop SL, Valencia (España)</FONT></DIV>
<DIV>
<DIV><FONT size=2 face="Courier New">Tlf.: 96.351.06.12 -- Fax: 96.351.09.68<BR></FONT><A href="http://www.prodevelop.es/"><FONT size=2 face="Courier New">http://www.prodevelop.es</FONT></A><BR><FONT size=2 face="Courier New">---</FONT></DIV></FONT></DIV></FONT></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>De:</B> gvsig_internacional-bounces@listserv.gva.es en nombre de Wolfgang Qual<BR><B>Enviado el:</B> vie 27/11/2009 14:53<BR><B>Para:</B> Users and Developers mailing list<BR><B>Asunto:</B> [Gvsig_english] gvSIG 1.9::strange result when calculating area<BR></FONT><BR></DIV>
<DIV>Hi list,<BR>I just used the area()-Function to calculate the area of a polygon them and was surprised, as<BR>all values were negative. The absolute value was correct, "only" the minus is very strange.<BR>The layers I tested were from our official database. I am confused by this, as determinating the area using the <BR>measure tool results in the correct value (without "-"). Moreover, if I use the "split"-tool and recalculate the area,<BR>the area of the splitted geometries is positive (the rest remains negative). Very strange.<BR><BR>Any ideas are appreciated very much.<BR>Best,<BR>Wolfgang<BR><BR>
<DIV class=moz-signature>-- <BR>
<TABLE border=0 cellSpacing=0 cellPadding=3 width=350 bgColor=white>
<TBODY>
<TR>
<TD bgColor=#330066 colSpan=2><IMG border=0 alt="" src="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" width=170 height=35></TD></TR>
<TR>
<TD bgColor=#330066 vAlign=bottom width=3 align=left><BR></TD>
<TD vAlign=top><FONT size=2 face=Arial,Helvetica,Geneva,Swiss,SunSans-Regular><B>Wolfgang Qual<BR><BR></B></FONT><FONT size=1 face=Arial,Helvetica,Geneva,Swiss,SunSans-Regular><BIG><B>Referat für Gesundheit und Umwelt</B></BIG><BR>Umweltschutz<BR>Umweltvorsorge<BR>RGU-UW 11<BR><BR>Bayerstraße 28a<BR>80335 München<BR><BR>Telefon +49 - 89 - 233 - 4 77 17<BR>Telefax +49 - 89 - 233 - 4 77 05<BR><BR><A class=moz-txt-link-freetext href="http://www.muenchen.de/umweltatlas">http://www.muenchen.de/umweltatlas</A><BR><A class=moz-txt-link-abbreviated href="mailto:uw11.rgu@muenchen.de">uw11.rgu@muenchen.de</A><BR></FONT></TD></TR>
<TR>
<TD vAlign=top colSpan=2><SMALL><FONT face="Helvetica, Arial, sans-serif">Bitte beachten Sie die Hinweise zur elektronischen<BR>Kommunikation mit der Landeshauptstadt München:<BR><A class=moz-txt-link-freetext href="http://www.muenchen.de/ekomm">http://www.muenchen.de/ekomm</A></FONT></SMALL></TD></TR></TBODY></TABLE></DIV></DIV></BODY></HTML>