[Gvsig_english] querying a shapefile

Simon Cropper (Botanicus Australia Pty Ltd) scropper at botanicusaustralia.com.au
Tue Jan 12 01:05:16 CET 2010


Nik,

This is the mailserver for gvSIG not QGIS.

That said, QGIS has the ability to establish distances between polygons. 
Look in the [Main Menu] [Vector] [Analysis Tools] [Distance matrix]...

gvSIG + Sextante also has the ability to make a matrix -- city name 
along column and row with intersecting cell containing minimum distance.

The latest version of Sextante (the one a lot of people are having 
trouble setting up at the moment) has a tool called "distance and angle" 
this may also help.

Recently I had a need to establish the distance between polygons/points 
with the output being Unique ID1, Unique ID2, Distance, Bearing, etc... 
That is, one row per comparison.

I received help from Nacho Uve who can be contacted on the Sextante 
Mailserver. He is developing a routine called CartTools. The Beta 
version of this program worked really well -- the only problem was that 
when comparing two polygons that were the same (zero distance) the 
bearing and angle output were returned as 90° and 0° respectively when 
it should actually return an error or warning (i.e. these values are not 
applicable and should not be returned).

In this format it is simply a matter of applying the 'x' and 'y' 
attribute for each city and you have your answer.

Nacho has submitted his routine to the Sextante source code repository 
http://forge.osor.eu/plugins/scmsvn/viewcvs.php/soft/sextante_lib/vectorTools/src/es/unex/sextante/vectorTools/distanceAndAngle/DistanceAndAngleAlgorithm.java?root=sextante&view=markup 
<http://forge.osor.eu/plugins/scmsvn/viewcvs.php/soft/sextante_lib/vectorTools/src/es/unex/sextante/vectorTools/distanceAndAngle/DistanceAndAngleAlgorithm.java?root=sextante&view=markup>. 
If you can compile java you will have no problem.

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>


On 12/01/2010 5:11 AM, Nik Go wrote:
> Hello. Happy new year to all.
>
> I have a shapefile of cities, is it possible to do the following in QGIS
>
>     * determine and visually display all cities with attribute "x" or "y"
>     * find out if the "x" cities share a border with other "x" cities
>           o if they do, I want to add an attribute to the database
>             indicating it as a neighbor of another "x" city
>     * find out if the "y" cities share a border with other "y" cities
>           o if they do, I want to add an attribute to the database
>             indicating it as a neighbor of another "y" city
>
> Thank you and regards.
>
> Nik
>
>
> _______________________________________________
> 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