[GRASS-user] Problems with adjacency

Sebastian_2009 jonathan.ball at realtimeworlds.com
Thu Nov 12 11:44:02 EST 2009


I'm new to GRASS and I am trying to replicate the following script (from the
documentation for v.to.db) to identify adjacency in polygons:

# add boundary categories into geometry at layer 2:
v.category soils out=mysoils layer=2 type=boundary option=add
# add table with left/right column to layer 2:
v.db.addtable mysoils layer=2 col="left integer,right integer"
# upload categories of left/right polygons:
v.to.db mysoils option=sides col=left,right layer=2
# display the result:
v.db.select mysoils layer=2

I have a version of the script in Python that I run in the GRASS command
Line on windows (from the GRASS 6.4.0SVN windows installation).

When my script gets to the 'v.to.db' command it pauses and a shell prompt is
put on the screen with no further information.  I have no idea what it
expects or why the shell prompt appears.  If I type 'exit' I get the
following message:
"ERROR: Database connection not defined for layer. Use v.db.connect first"

If I insert a v.db.connect statement into the code I get the shell prompt
again (also with no further comment) but this time where the v.db.addtable
command is.  I assume that it is trying (and failing) to tell me that the
table already exists).

If I repeat the entire exercise with a new category (say 'mysoils2') plus
the v.db.connect statement I STILL get the blank shell prompt but this time
typing 'exit' gives me an error for every boundary which says 'Error in
db_execute_immediate(), Column 'left' not found.

Can anybody help me please?

Thanks
-- 
View this message in context: http://n2.nabble.com/Problems-with-adjacency-tp3994065p3994065.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list