[GRASS-user] [GRASSLIST:1148] Attribute editing

I am trying to learn GRASS using spearfish data.

On using "d.what.vect -e map=roads" and after clicking on map, it
display information, but, I am not able to edit category number in that.
Manual says that -e option will open form in edit mode. Where I am
wrong?

Also I am not able to query using following:

echo "select * from roads" | db.select

It throws following error:

DBMI-DBF driver error:
Table 'roads' doesn't exist.
Error in db_open_select_cursor()

Thanks in advance.

--
H.S.Rai

--
http://www.fastmail.fm - A no graphics, no pop-ups email service

Hardeep Singh Rai wrote:

I am trying to learn GRASS using spearfish data.

On using "d.what.vect -e map=roads" and after clicking on map, it
display information, but, I am not able to edit category number in
that. Manual says that -e option will open form in edit mode. Where I
am wrong?

Also I am not able to query using following:

echo "select * from roads" | db.select

It throws following error:

DBMI-DBF driver error:
Table 'roads' doesn't exist.
Error in db_open_select_cursor()

you can not change maps that are in the PERMANENT mapset.

make a local copy first,

g.copy vect=roads,roads_local

and check if a DB connection exists for the map:

G61 > v.db.connect -p roads
Vector map <roads> is connected by:
layer <1> table <roads> in database </home/hamish/grassdata/spearfish60/PERMANENT/dbf/> through driver <dbf> with key <cat>

Hamish

Hi Rai,

  1. You have to check the edit box in the Display manager (DM).
    Then you can simple enter the attribute from Key board.
    User permissions of Linux also my come in the way. See that you have
    permission to write on the file.
  2. You second DB related proble is not clear Pl.
    You can goto the dataset and open the *.dbf files in open office too
    for any modification. This is acceptable to GRASS.
    Cheers
    Ravi Kumar

Hardeep Singh Rai hardeep@eml.cc wrote:

I am trying to learn GRASS using spearfish data.

On using “d.what.vect -e map=roads” and after clicking on map, it
display information, but, I am not able to edit category number in that.
Manual says that -e option will open form in edit mode. Where I am
wrong?

Also I am not able to query using following:

echo “select * from roads” | db.select

It throws following error:

DBMI-DBF driver error:
Table ‘roads’ doesn’t exist.
Error in db_open_select_cursor()

Thanks in advance.


H.S.Rai


http://www.fastmail.fm - A no graphics, no pop-ups email service


How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates.

On Thu, 06 Jul 2006 05:01:06 -0700
"Hardeep Singh Rai" <hardeep@eml.cc> wrote:

I am trying to learn GRASS using spearfish data.

On using "d.what.vect -e map=roads" and after clicking on map, it
display information, but, I am not able to edit category number in
that.

You can't edit a category number. You can only edit attributes (besides
the key column, usually and by default called "cat"). Category is a
unique vector feature ID - if you could edit it, you would loose
connection between the vactor feature and it's attributes in table.
Read: http://grass.itc.it/grass61/manuals/html61_user/vectorintro.html

Maciek

--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich!
http://katalog.panoramainternetu.pl/

On 7/7/06, Maciek Sieczka <werchowyna@epf.pl> wrote:

You can't edit a category number. You can only edit attributes (besides
the key column, usually and by default called "cat"). Category is a
unique vector feature ID - if you could edit it, you would loose
connection between the vactor feature and it's attributes in table.
Read: http://grass.itc.it/grass61/manuals/html61_user/vectorintro.html

You can edit categories with v.category can't you?

Although it seems that only systematic changes, such as adding a value
to all categories, or generating a new category index.

Does anyone know if all vector objects MUST have a unique category?
I have a shape file of US counties, and want to link it to a table of
county information which have the FIPS code as a key. However, because
counties are not all singular vector objects some have more than one
category.

I could link the county information directly to the category numbers.
But this would end having lots of duplicate entries where the FIPS
code of entries is the same but with different category numbers.

Ideally I'd like to be able to use the FIPS code as the category
number - but if category number must unique then I have to go with
duplicate entries.

Thanks,

--
-Joel

"Wish not to seem, but to be, the best."
                -- Aeschylus

Joel Pitt napisa?(a):

On 7/7/06, Maciek Sieczka <werchowyna@epf.pl> wrote:

You can't edit a category number. You can only edit attributes (besides
the key column, usually and by default called "cat"). Category is a
unique vector feature ID - if you could edit it, you would loose
connection between the vactor feature and it's attributes in table.
Read: http://grass.itc.it/grass61/manuals/html61_user/vectorintro.html

You can edit categories with v.category can't you?

Yes, but that's a different thing than Hardeep asked, I think.

Although it seems that only systematic changes, such as adding a value
to all categories, or generating a new category index.

Does anyone know if all vector objects MUST have a unique category?

No.

I have a shape file of US counties, and want to link it to a table of
county information which have the FIPS code as a key. However, because
counties are not all singular vector objects some have more than one
category.

Do you mean that one county happens to be represented by more than 1
areas (polygons)?

I could link the county information directly to the category numbers.
But this would end having lots of duplicate entries where the FIPS
code of entries is the same but with different category numbers.

You can have one category for many objects. Then each object will have
all the attributes in a table that are assigned to that category.

Ideally I'd like to be able to use the FIPS code

What's FIPS?

as the category
number - but if category number must unique then I have to go with
duplicate entries.

Maciek

I find this error message from v.in.ascii a bit cryptic.

grass command:
v.in.ascii input=/usr/localsrc/utm/PERMANENT/site.dat output=sites5
format=point fs=| skip=0 x=1 y=2 z=0 cat=0

error message:
Maximum input row length: 24
Maximum number of columns: 2
Minimum number of columns: 0

GRASS_INFO_ERROR(15897,1): x column number > minimum last column number
GRASS_INFO_ERROR(15897,1): (incorrect field separator?)

The file site. dat is one line as follows
W115 58 2.4|N36 27 20.9

The default separator is "pipe", so I'm sure the delimiter is fine. Any idea what I'm doing wrong here?

Vector objects do NOT need to have a unique cat. Look at roads in the
Spearfish demo set. You can use layers to give each object a unique cat for
one layer and group them by cats in another layer.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Joel Pitt <joel.pitt@gmail.com>
Reply-To: <joel.pitt@gmail.com>
Date: Thu, 13 Jul 2006 11:23:33 +1200
To: Maciek Sieczka <werchowyna@epf.pl>
Cc: <grassuser@grass.itc.it>
Subject: Re: [GRASS-user] [GRASSLIST:1148] Attribute editing

On 7/7/06, Maciek Sieczka <werchowyna@epf.pl> wrote:

You can't edit a category number. You can only edit attributes (besides
the key column, usually and by default called "cat"). Category is a
unique vector feature ID - if you could edit it, you would loose
connection between the vactor feature and it's attributes in table.
Read: http://grass.itc.it/grass61/manuals/html61_user/vectorintro.html

You can edit categories with v.category can't you?

Although it seems that only systematic changes, such as adding a value
to all categories, or generating a new category index.

Does anyone know if all vector objects MUST have a unique category?
I have a shape file of US counties, and want to link it to a table of
county information which have the FIPS code as a key. However, because
counties are not all singular vector objects some have more than one
category.

I could link the county information directly to the category numbers.
But this would end having lots of duplicate entries where the FIPS
code of entries is the same but with different category numbers.

Ideally I'd like to be able to use the FIPS code as the category
number - but if category number must unique then I have to go with
duplicate entries.

Thanks,

--
-Joel

"Wish not to seem, but to be, the best."
                -- Aeschylus

On Thu, Jul 13, 2006 at 01:30:43AM -0700, gary wrote:

I find this error message from v.in.ascii a bit cryptic.

grass command:
v.in.ascii input=/usr/localsrc/utm/PERMANENT/site.dat output=sites5
format=point fs=| skip=0 x=1 y=2 z=0 cat=0

error message:
Maximum input row length: 24
Maximum number of columns: 2
Minimum number of columns: 0

GRASS_INFO_ERROR(15897,1): x column number > minimum last column number
GRASS_INFO_ERROR(15897,1): (incorrect field separator?)

The file site. dat is one line as follows
W115 58 2.4|N36 27 20.9

The default separator is "pipe", so I'm sure the delimiter is fine. Any
idea what I'm doing wrong here?

I guess that formatting should be

115:58:2.4W|36:27:20.9N

instead of
W115 58 2.4|N36 27 20.9

Markus

I changed the input format but got the same cryptic error message.

Markus Neteler wrote:

On Thu, Jul 13, 2006 at 01:30:43AM -0700, gary wrote:

I find this error message from v.in.ascii a bit cryptic.

grass command:
v.in.ascii input=/usr/localsrc/utm/PERMANENT/site.dat output=sites5
format=point fs=| skip=0 x=1 y=2 z=0 cat=0

error message:
Maximum input row length: 24
Maximum number of columns: 2
Minimum number of columns: 0

GRASS_INFO_ERROR(15897,1): x column number > minimum last column number
GRASS_INFO_ERROR(15897,1): (incorrect field separator?)

The file site. dat is one line as follows
W115 58 2.4|N36 27 20.9

The default separator is "pipe", so I'm sure the delimiter is fine. Any idea what I'm doing wrong here?

I guess that formatting should be

115:58:2.4W|36:27:20.9N

instead of
W115 58 2.4|N36 27 20.9

Markus

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

Hi
This command has provided hours or entertainment for me too. Usually I can get it to work by meticulously following the format in example 1 on the help page. To this end you might try making the W and N into column headers, decimalize the lat/long and 'note the blank before entering vertex coordinates'. Adding a columns= string helps too. (columns='x double, etc). Good luck.

Stuart
On Jul 14, 2006, at 4:07 PM, gary wrote:

I changed the input format but got the same cryptic error message.

Markus Neteler wrote:

On Thu, Jul 13, 2006 at 01:30:43AM -0700, gary wrote:

I find this error message from v.in.ascii a bit cryptic.

grass command:
v.in.ascii input=/usr/localsrc/utm/PERMANENT/site.dat output=sites5
format=point fs=| skip=0 x=1 y=2 z=0 cat=0

error message:
Maximum input row length: 24
Maximum number of columns: 2
Minimum number of columns: 0

GRASS_INFO_ERROR(15897,1): x column number > minimum last column number
GRASS_INFO_ERROR(15897,1): (incorrect field separator?)

The file site. dat is one line as follows
W115 58 2.4|N36 27 20.9

The default separator is "pipe", so I'm sure the delimiter is fine. Any idea what I'm doing wrong here?

I guess that formatting should be
115:58:2.4W|36:27:20.9N
instead of
W115 58 2.4|N36 27 20.9
Markus
_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

Just an FYI, there is a method described in the Markus' "Grass 6 in a Nutshell" to use QGIS to generate a vector map (Section 6.8). The command sequence works fine, but GRASS complains about the file that QGIS generates. [Yes, I know, not GRASS' problem.] I didn't log the error message, but basically it complained about the file being too large by I believe 14 bytes.

I'll hack with v.in.ascii a bit more.

Stuart Edwards wrote:

Hi
This command has provided hours or entertainment for me too. Usually I can get it to work by meticulously following the format in example 1 on the help page. To this end you might try making the W and N into column headers, decimalize the lat/long and 'note the blank before entering vertex coordinates'. Adding a columns= string helps too. (columns='x double, etc). Good luck.

Stuart
On Jul 14, 2006, at 4:07 PM, gary wrote:

I changed the input format but got the same cryptic error message.

Markus Neteler wrote:

On Thu, Jul 13, 2006 at 01:30:43AM -0700, gary wrote:

I find this error message from v.in.ascii a bit cryptic.

grass command:
v.in.ascii input=/usr/localsrc/utm/PERMANENT/site.dat output=sites5
format=point fs=| skip=0 x=1 y=2 z=0 cat=0

error message:
Maximum input row length: 24
Maximum number of columns: 2
Minimum number of columns: 0

GRASS_INFO_ERROR(15897,1): x column number > minimum last column number
GRASS_INFO_ERROR(15897,1): (incorrect field separator?)

The file site. dat is one line as follows
W115 58 2.4|N36 27 20.9

The default separator is "pipe", so I'm sure the delimiter is fine. Any idea what I'm doing wrong here?

I guess that formatting should be
115:58:2.4W|36:27:20.9N
instead of
W115 58 2.4|N36 27 20.9
Markus
_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

I managed to get this command to work (well at least issue no error messages) by using the CSV option. However, the open_office created CSV is was identical to my vim created file except that a comma is used as a delimiter rather than the pipe symbol.

The input format was numeric LL, using the minus sign for W.

Stuart Edwards wrote:

Hi
This command has provided hours or entertainment for me too. Usually I can get it to work by meticulously following the format in example 1 on the help page. To this end you might try making the W and N into column headers, decimalize the lat/long and 'note the blank before entering vertex coordinates'. Adding a columns= string helps too. (columns='x double, etc). Good luck.

Stuart
On Jul 14, 2006, at 4:07 PM, gary wrote:

I changed the input format but got the same cryptic error message.

Markus Neteler wrote:

On Thu, Jul 13, 2006 at 01:30:43AM -0700, gary wrote:

I find this error message from v.in.ascii a bit cryptic.

grass command:
v.in.ascii input=/usr/localsrc/utm/PERMANENT/site.dat output=sites5
format=point fs=| skip=0 x=1 y=2 z=0 cat=0

error message:
Maximum input row length: 24
Maximum number of columns: 2
Minimum number of columns: 0

GRASS_INFO_ERROR(15897,1): x column number > minimum last column number
GRASS_INFO_ERROR(15897,1): (incorrect field separator?)

The file site. dat is one line as follows
W115 58 2.4|N36 27 20.9

The default separator is "pipe", so I'm sure the delimiter is fine. Any idea what I'm doing wrong here?

I guess that formatting should be
115:58:2.4W|36:27:20.9N
instead of
W115 58 2.4|N36 27 20.9
Markus
_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

gary wrote:

>>>> error message:
>>>> Maximum input row length: 24
>>>> Maximum number of columns: 2
>>>> Minimum number of columns: 0
>>>>
>>>> GRASS_INFO_ERROR(15897,1): x column number > minimum last column number
>>>> GRASS_INFO_ERROR(15897,1): (incorrect field separator?)

Minimum number of columns: 0

is there a blank line somewhere in the file?

(dev: see r.in.xyz for skip blank line test)

Hamish