[Gvsig_english] Point2Point Comparison

Juan Lucas Dominguez Rubio jldominguez at prodevelop.es
Mon Dec 7 09:36:16 CET 2009


Hello, Simon. Starting from the DBF file you sent some days ago, you can do this:
 
- Add the DBF file as a table in gvSIG
- Create an event theme (point layer) using for example the EPSG:4202 columns and save it as a shapefile
- Create a view in EPSG:4283 and add the previous shapefile (on-the-fly reprojection using the gsb file)
- Create two new columns of type DOUBLE (for example "new_lon" and "new_lat")
- With the field calculator, set those columns to the reprojected values using the functions x() and y()
- Now you can compare the resulting values with the EPSG:4283 columns your DBF file had from the start and were not used before
 
The formulas for distance and bearing can be found easily. This nice website mentions two different formulas and says one of them is not very good for very small distances:
 
http://www.movable-type.co.uk/scripts/latlong.html
 
All those formulas are supported by the field calculator. Perhaps you cannot do all that in one step and need to create several new columns (type DOUBLE) to obtain a final result.
 
Of course this can be done also with projected coordinates (in meters) and you'll simply need to compute the euclidean distance.
 
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 Simon Cropper (Botanicus Australia Pty Ltd)
Enviado el: mié 02/12/2009 9:48
Para: Users and Developers mailing list
Asunto: Re: [Gvsig_english] Point2Point Comparison



Jorge,

Any idea how I might calculate the euclidean distance using the field
calculator?

The calculator can only interact with one file at a time, how would you
manage two tables?

Cheers Simon

Simon Cropper
Botanicus Australia Pty Ltd
PO Box 160, Sunshine, Victoria 3020.
P: 9311 5822. M: 041 830 3437.
mailto: scropper at botanicusaustralia.com.au
<mailto:scropper at botanicusaustralia.com.au>
web: www.botanicusaustralia.com.au <http://www.botanicusaustralia.com.au <http://www.botanicusaustralia.com.au/> >



Jorge Gaspar Sanz Salinas wrote:
> On 01/12/09 23:01, Simon Cropper (Botanicus Australia Pty Ltd) wrote:
>  
>> Hi Guys,
>>
>> Is anyone aware of a utility where you can compare two point layers and
>> get back a table of distances and bearing between each point. I know
>> Sextante can have a file look at itself, so it is possible to merge a
>> file and run this routine but I find that this creates a cumbersome
>> matrix that needs to be disassembled.
>>
>> A file with the following fields would be desirable ID_FILE1, ID_FILE2,
>> DISTANCE and BEARING, with one record representing one comparison.
>>    
>
> Simon,
>
> If you have common IDs for the layers, you can do that with a little bit
> of work on the field calculator, extrancting coordinates and calculating
> the euclidean distance (if it's sensible)
>
> For a more automated way: Sextante development or some scripting.
>
> Nice use case, indeed.
>
> Cheers
> Jorge
> _______________________________________________
> Gvsig_internacional mailing list
> Gvsig_internacional at listserv.gva.es
> http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>
>
>  
_______________________________________________
Gvsig_internacional mailing list
Gvsig_internacional at listserv.gva.es
http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.gva.es/pipermail/gvsig_internacional/attachments/20091207/3ff0e855/attachment.htm 


More information about the Gvsig_internacional mailing list