[Gvsig_english] gvSIG 1.9::strange result when calculating area

Wolfgang Qual wolfgang.qual at gmx.net
Fri Nov 27 21:35:57 CET 2009


Hello Juan Lucas and all the others,
you're right. If I select a polygon of those layers in edit mode,
vertexes and vertexnumbers are shown - and they are counter-clockwise
(as far as I remeber, as I am not in the office now, haha). When I split
that polygon with the new tool, the orientation of the vertexes is
clockwise. The hint to use abs in order to get the "real" area is great.
However, there should not be any negative area (or does it make sense?).
Thank you very much for this answer. Another interesting topic to
discuss about it.
@Ben: I do not think that triangles are a problem. Maybe you can check
the vertex-number-orientation?

Best,
Wolfgang


Am Freitag, den 27.11.2009, 16:35 +0100 schrieb Juan Lucas Dominguez
Rubio:
> 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
> ---
> 
> 
> ______________________________________________________________________
> 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
> 
> -- 
> 
> 
> 
> 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
> _______________________________________________
> Gvsig_internacional mailing list
> Gvsig_internacional at listserv.gva.es
> http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional




More information about the Gvsig_internacional mailing list