[GRASS-user] v.delaunay and v.category problem

Hi all,

I’m trying to use v.delaunay to get the lines connecting centroids in thiessen polygons because I need to compute some statistics on the length of those segments.
I’m facing a problem that maybe somebody could help me to solve.

Basically I run v.delaunay with the -l option to get lines instead of the polygons, I get the resulting vector, but there is no attribute tables associated to it.
My idea was to run v.db.addtable to create a new empty attribute table, then v.category to assign cat numbers and the v.to.db to compute and add to the attribute table the parameter I need (ie the length).
The problem is that when I run v.category nothing happens, and the attribute table remains empty.

Am I missing somethng?

Any help appreciated.

Ing. Andrea Pogliaghi
Milano - Italy

Hello,
as attributes belong to triangle froming nodes, how should output look
like? Every triangle should get all three atributes? And what about
lines? Two attributes, as every triangulation line has two nodes at
their end?

Maris.

2011/3/30, Andrea Pogliaghi <andrea.pogliaghi@gmail.com>:

Hi all,
...
Basically I run v.delaunay with the -l option to get lines instead of the
polygons, I get the resulting vector, but there is no attribute tables
associated to it.
...
Ing. Andrea Pogliaghi
Milano - Italy

Hi Maris,

On Thu, Mar 31, 2011 at 10:25 AM, Maris Nartiss <maris.gis@gmail.com> wrote:

Hello,
as attributes belong to triangle froming nodes, how should output look
like? Every triangle should get all three atributes? And what about
lines? Two attributes, as every triangulation line has two nodes at
their end?

It makes sense that no attribute is associated to v.delaunay lines output because the features (lines in my case as I’m using the -l switch) are different from the nodes (even if having an output attribute table containing, for instance, the attributes of the two nodes of each line would be useful), but that is not the point.
The issue I’m facing is that I want to create a new attribute table for these delaunay_lines with a new unique cat value for every line and compute the length of each line, as I need to know which is their min, max and avg.

Cheers,
Andrea

Maris.

2011/3/30, Andrea Pogliaghi <andrea.pogliaghi@gmail.com>:

Hi all,

Basically I run v.delaunay with the -l option to get lines instead of the
polygons, I get the resulting vector, but there is no attribute tables
associated to it.

Ing. Andrea Pogliaghi
Milano - Italy

Hello,
You have to connect Your vector map to database at first. Go to
Databases->Manage database->New table (v.db.addtable) and run
v.category afterwards.

Maris.

2011/3/31, Andrea Pogliaghi <andrea.pogliaghi@gmail.com>:

Hi Maris,

On Thu, Mar 31, 2011 at 10:25 AM, Maris Nartiss <maris.gis@gmail.com> wrote:

Hello,
as attributes belong to triangle froming nodes, how should output look
like? Every triangle should get all three atributes? And what about
lines? Two attributes, as every triangulation line has two nodes at
their end?

It makes sense that no attribute is associated to v.delaunay lines output

because the features (lines in my case as I'm using the -l switch) are
different from the nodes (even if having an output attribute table
containing, for instance, the attributes of the two nodes of each line would
be useful), but that is not the point.
The issue I'm facing is that I want to create a new attribute table for
these delaunay_lines with a new unique cat value for every line and compute
the length of each line, as I need to know which is their min, max and avg.

Cheers,
Andrea

Maris.

2011/3/30, Andrea Pogliaghi <andrea.pogliaghi@gmail.com>:
> Hi all,
> ...
> Basically I run v.delaunay with the -l option to get lines instead of
> the
> polygons, I get the resulting vector, but there is no attribute tables
> associated to it.
> ...
> Ing. Andrea Pogliaghi
> Milano - Italy
>

On Thu, Mar 31, 2011 at 2:54 PM, Maris Nartiss <maris.gis@gmail.com> wrote:

Hello,
You have to connect Your vector map to database at first. Go to
Databases->Manage database->New table (v.db.addtable) and run
v.category afterwards.

That is exactly what I did. In fact in my first message I wrote

“My idea was to run v.db.addtable to create a new empty attribute table, then v.category to assign cat numbers and the v.to.db to compute and add to the attribute table the parameter I need (ie the length).
The problem is that when I run v.category nothing happens, and the attribute table remains empty.”

cheers
andrea

Maris.

2011/3/31, Andrea Pogliaghi <andrea.pogliaghi@gmail.com>:

Hi Maris,

On Thu, Mar 31, 2011 at 10:25 AM, Maris Nartiss <maris.gis@gmail.com> wrote:

Hello,
as attributes belong to triangle froming nodes, how should output look
like? Every triangle should get all three atributes? And what about
lines? Two attributes, as every triangulation line has two nodes at
their end?

It makes sense that no attribute is associated to v.delaunay lines output
because the features (lines in my case as I’m using the -l switch) are
different from the nodes (even if having an output attribute table
containing, for instance, the attributes of the two nodes of each line would
be useful), but that is not the point.
The issue I’m facing is that I want to create a new attribute table for
these delaunay_lines with a new unique cat value for every line and compute
the length of each line, as I need to know which is their min, max and avg.

Cheers,
Andrea

Maris.

2011/3/30, Andrea Pogliaghi <andrea.pogliaghi@gmail.com>:

Hi all,

Basically I run v.delaunay with the -l option to get lines instead of
the
polygons, I get the resulting vector, but there is no attribute tables
associated to it.

Ing. Andrea Pogliaghi
Milano - Italy

just to make it clearer… if I do the above steps with v.delaunay, then I create the table with v.db.addtable and then I run v.category, it works fine.
If I do the same steps with v.delaunay with the -l flag (and I have to, since I need the lines), then it doesn’t.

cheers
Andrea

On Thu, Mar 31, 2011 at 4:37 PM, Andrea Pogliaghi <andrea.pogliaghi@gmail.com> wrote:

On Thu, Mar 31, 2011 at 2:54 PM, Maris Nartiss <maris.gis@gmail.com> wrote:

Hello,

You have to connect Your vector map to database at first. Go to
Databases->Manage database->New table (v.db.addtable) and run
v.category afterwards.

That is exactly what I did. In fact in my first message I wrote

“My idea was to run v.db.addtable to create a new empty attribute table, then v.category to assign cat numbers and the v.to.db to compute and add to the attribute table the parameter I need (ie the length).
The problem is that when I run v.category nothing happens, and the attribute table remains empty.”

cheers
andrea

Maris.

2011/3/31, Andrea Pogliaghi <andrea.pogliaghi@gmail.com>:

Hi Maris,

On Thu, Mar 31, 2011 at 10:25 AM, Maris Nartiss <maris.gis@gmail.com> wrote:

Hello,
as attributes belong to triangle froming nodes, how should output look
like? Every triangle should get all three atributes? And what about
lines? Two attributes, as every triangulation line has two nodes at
their end?

It makes sense that no attribute is associated to v.delaunay lines output
because the features (lines in my case as I’m using the -l switch) are
different from the nodes (even if having an output attribute table
containing, for instance, the attributes of the two nodes of each line would
be useful), but that is not the point.
The issue I’m facing is that I want to create a new attribute table for
these delaunay_lines with a new unique cat value for every line and compute
the length of each line, as I need to know which is their min, max and avg.

Cheers,
Andrea

Maris.

2011/3/30, Andrea Pogliaghi <andrea.pogliaghi@gmail.com>:

Hi all,

Basically I run v.delaunay with the -l option to get lines instead of
the
polygons, I get the resulting vector, but there is no attribute tables
associated to it.

Ing. Andrea Pogliaghi
Milano - Italy

Please double check Your actions. Just tested here on 6.4-svn version:

v.delaunay -l input=D10k output=delone
v.db.addtable map=delone layer=1 {columns=cat integer}
v.category input=delone output=delone_cat option=add
type=point,line,boundary,centroid,area layer=1 cat=1 step=1
v.what -a map=delone_cat
east_north=624612.5216318436,6400722.6681744065
distance=214.46548410981273

No database record
East: 624612.52163184
North: 6400722.66817441
Map: delone_cat
Mapset: rm_this2
Type: Line
Id: 859
Garums: 639.105487
Layer: 1
Category: 859
Driver: dbf
Database: /home/maris/grass_data/Vidzeme_Balt93/rm_this2/dbf/
Table: delone_cat
Key column: cat

Maris.

2011/3/31, Andrea Pogliaghi <andrea.pogliaghi@gmail.com>:

just to make it clearer.... if I do the above steps with v.delaunay, then I
create the table with v.db.addtable and then I run v.category, it works
fine.
If I do the same steps with v.delaunay with the -l flag (and I have to,
since I need the lines), then it doesn't.

cheers
Andrea

On Thu, Mar 31, 2011 at 4:37 PM, Andrea Pogliaghi <
andrea.pogliaghi@gmail.com> wrote:

On Thu, Mar 31, 2011 at 2:54 PM, Maris Nartiss <maris.gis@gmail.com>wrote:

Hello,

You have to connect Your vector map to database at first. Go to
Databases->Manage database->New table (v.db.addtable) and run
v.category afterwards.

That is exactly what I did. In fact in my first message I wrote

"My idea was to run v.db.addtable to create a new empty attribute table,
then v.category to assign cat numbers and the v.to.db to compute and add
to
the attribute table the parameter I need (ie the length).
The problem is that when I run v.category nothing happens, and the
attribute table remains empty."

cheers
andrea

Maris.

2011/3/31, Andrea Pogliaghi <andrea.pogliaghi@gmail.com>:
> Hi Maris,
>
> On Thu, Mar 31, 2011 at 10:25 AM, Maris Nartiss <maris.gis@gmail.com>
wrote:
>
>> Hello,
>> as attributes belong to triangle froming nodes, how should output look
>> like? Every triangle should get all three atributes? And what about
>> lines? Two attributes, as every triangulation line has two nodes at
>> their end?
>>
>> It makes sense that no attribute is associated to v.delaunay lines
output
> because the features (lines in my case as I'm using the -l switch) are
> different from the nodes (even if having an output attribute table
> containing, for instance, the attributes of the two nodes of each line
would
> be useful), but that is not the point.
> The issue I'm facing is that I want to create a new attribute table for
> these delaunay_lines with a new unique cat value for every line and
compute
> the length of each line, as I need to know which is their min, max and
avg.
>
> Cheers,
> Andrea
>
>
>
>>
>> Maris.
>>
>> 2011/3/30, Andrea Pogliaghi <andrea.pogliaghi@gmail.com>:
>> > Hi all,
>> > ...
>> > Basically I run v.delaunay with the -l option to get lines instead
>> > of
>> > the
>> > polygons, I get the resulting vector, but there is no attribute
tables
>> > associated to it.
>> > ...
>> > Ing. Andrea Pogliaghi
>> > Milano - Italy
>> >
>>
>