[Gvsig_english] Field calculator::possibility to calculate x/y coordinates?

Antonio Falciano afalciano at yahoo.it
Fri Sep 21 00:00:57 CEST 2007


Ops, a simplest way to calculate centroids is to use the Java Topology 
Suite (JTS) library:
http://www.vividsolutions.com/jts/javadoc/com/vividsolutions/jts/algorithm/CentroidArea.html

Best,
Antonio

Antonio Falciano ha scritto:
> Hi Wolfgang,
> I'm agree with you. I think that we all prefer a simple button to make
> these operations.
> A good approach/algorithm could be:
> http://local.wasp.uwa.edu.au/%7Epbourke/geometry/polyarea/
> but we need a way to obtain the coords of the single vertices...
> I think to the OGC Simple Feature Specifications in WKT format...
> extract coords by this string and apply the right formulas!
> In pseudo code, it seems too easy... :)
> 
> Regards,
> Antonio
> 
> 
> Wolfgang Qual ha scritto:
>> Hi Antonio, list,
>> thanks for this idea, Antonio! However, I would prefer to have a 
>> script, function, button etc. within gvSIG for Shapefiles. At the 
>> moment, we do not even have a PostGIS-database in our office. Could 
>> imagine that it would be a very nice example for the 
>> create-an-extension-capabilities in gvSIG. Ideas are welcome!
>>
>> Best,
>> Wolfgang
>>
>>
>> Am Dienstag 11 September 2007 pH:07:10 vormittags schrieb Antonio 
>> Falciano:
>>> Wolfgang Qual wrote:
>>> [...]
>>>
>>>> Therefore, my question should be a different one: is there a 
>>>> possibility
>>>> to identify the centres of gravity for a polygon theme?
>>> Hi Wolfgang,
>>> you can do it simply using PostGIS. You have to:
>>> 1. export your polygon theme to PostGIS;
>>> 2. create a view in which you calculate centroids coords;
>>> 3. add view in gvSIG as layer or table from PostGIS.
>>>
>>> Regards,
>>> Antonio Falciano
>>>
>>> _______________________________________________
>>> Gvsig_internacional mailing list
>>> Gvsig_internacional at runas.cap.gva.es
>>> http://runas.cap.gva.es/mailman/listinfo/gvsig_internacional
>>
>>
> 
> _______________________________________________
> Gvsig_internacional mailing list
> Gvsig_internacional at runas.cap.gva.es
> http://runas.cap.gva.es/mailman/listinfo/gvsig_internacional
> 
> 


More information about the Gvsig_internacional mailing list