[GRASS-user] vector database connection

Moritz Lennert mlennert at club.worldonline.be
Tue Jun 7 03:44:44 EDT 2011


On 06/06/11 23:26, Bulent Arikan wrote:
> Dear List,
>
> I prepared a vector map using "v.distance", showing the minimum distance
> from a series of vector points (i.e., cities) to a coastline (another
> vector map of area type). Naturally, the minimum distances are shown as
> lines in this new vector map. When I want to see the attribute table, I
> get  the following warning "Database connection for vector map is not
> defined in DB file. Define new connection in manage layers tab".
> However, I am not sure how to define such connection since there is not
> a (.dbf) for this new vector map in the folder.

Try v.db.addtable.

But AFAIK the lines do not have categories, either, so you will have to 
first assigne category numbers before using v.db.addtable.

See the example "Univariate statistics on results", especially the part 
from

# we need to give the lines category numbers, create a table, and create
#  a column in that table to hold the distance data.

for an example of how to do all this.

> Eventually, I want to get an elevation profile using these minimum
> distance lines. I think the most appropriate module for this is
> "r.profile" (which means that I have to rasterize the vector lines) but
> if you have other suggestions I will be grateful.

This is probably the easiest. You could also try a combination of 
v.segment (to create shorter lines) + v.drape (to assign altitude values 
to the line nodes) + v.category + 'v.to.db option=start', but this would 
involve many more steps...

Moritz


More information about the grass-user mailing list