V.Distance Command Problem
|Reported by:||scorpionlegend92||Owned by:|
|Keywords:||v.distance, attribute of nearest feature||Cc:|
In v.distance, if I select "attribute of nearest feature given by to_column option" command and insert column name of nearest feature in "to" menu, v.distance command does not work.
Column name that I use is "name" that is present in the attribute table. I uploaded the data in grass from .shp file for which it created a .dbf also at back-end in the GIS database software folder in my documents.
Following error appears:
v.distance -a --overwrite from=PERN86@PERMANENT to=PERN86@PERMANENT to_type=point,line output=same4 upload=cat,dist,to_attr column=to_cat, loc_dist,name to_column=name table=same4 DBMI-DBF driver error: Column 'loc_dist' already exists (duplicate name) Cannot create table. Error in db_execute_immediate() ERROR: Unable to create table: 'create table same4 (from_cat integer, to_cat integer, loc_dist double precision, loc_dist double precision )' (Fri Oct 05 11:00:45 2012) Command finished (2 sec)
If I select only "category of the nearest feature", and "minimum distance to nearest feature", then v.distance command work properly and create a .dbf file that contain the desired distance information. In such case, following output appears without any error.
v.distance -a --overwrite from=PERN86@PERMANENT to=PERN86@PERMANENT to_type=point output=same5 upload=cat,dist column=to_cat, loc_dist to_column=name table=same5 1792 categories with more than 1 feature in vector map <PERN86@PERMANENT> 7225 distances calculated 7225 records inserted Building topology for vector map <same5>... Registering primitives... 7225 primitives registered 14450 vertices registered Building areas... 0 areas built 0 isles built Attaching islands... Attaching centroids... Number of nodes: 84 Number of primitives: 7225 Number of points: 0 Number of lines: 7225 Number of boundaries: 0 Number of centroids: 0 Number of areas: 0 Number of isles: 0 v.distance complete. (Fri Oct 05 11:01:18 2012) Command finished (2 sec)
Please check and resolve why does this command create error and does not work when I select attribute in upload, string.