[GRASSLIST:10087] Re: v.to.db syntax
Kirk R. Wythers
kwythers at umn.edu
Tue Jan 31 09:52:56 EST 2006
Michael,
Thanks for the response. As it turns out the columns were actually
named "x" and "y". I re-ran the command v.to.db NAME_OF_GRASS_VECTOR
option=coor col=x,y and it worked perfectly (I have no idea what was
going on earlier... oh well).
For Markus and Tom, thanks for all your suggestions as well. As it
turns out the simple explanation was the x and y attributes in the
original .dbf file (that came with the .shp file) were just plain
broken. In that their coordinates did not match up the correct
geometry in the .shp file.
Again, I have no idea why. However, it does not matter, because of
the very cool command v.to.db, which did what it promised and
extracted the correct geometry from the vector and wrote it to the x
and y attibutes in the associated database table.
This was a case of Murphy's Law where, if you try a new analysis or
command, the dataset that you are try it out on will inevitably be
faulty in some way. That way, when your analysis does not work, you
will be left thinking that you did something wrong, and then spend
two days figuring out that it was not you... it was the data. ;-)
Thanks again,
On Jan 31, 2006, at 12:50 AM, Michael Barton wrote:
> Kirk,
>
> Here's one thought. Are the columns actually named "x" and "y"?
> You need to specify real column names.
>
> Michael
> __________________________________________
> Michael Barton, Professor of Anthropology
> School of Human Evolution and Social Change
> Arizona State University
> Tempe, AZ 85287-2402
>
> phone: 480-965-6213
> fax: 480-965-7671
> www: http://www.public.asu.edu/~cmbarton
>
>
>
>> From: "Kirk R. Wythers" <kwythers at umn.edu>
>> Date: Mon, 30 Jan 2006 15:23:21 -0600
>> To: List Users GRASS <GRASSLIST at baylor.edu>
>> Cc: Blazek Radim <blazek at itc.it>
>> Subject: [GRASSLIST:10057] v.to.db syntax
>>
>> Could someone expand on the syntax for the command v.to.db?
>>
>> I have a vector file that came with bad y coordinate values in the
>> downloaded dbf attribute table. Therefor when I read the shape file
>> into grass with v.in.ogr (I'm connected to postgresql database), the
>> y value in attribute table in pg is also wrong. I want to re-write
>> the y coordinates in the attribute table with the correct geometry
>> from the vector file.
>>
>> I tried:
>>
>> v.to.db NAME_OF_GRASS_VECTOR option=coor col=x,y
>>
>> The command appeared to run (albit it took a while) but did not re-
>> write the attibute table associated with the vector. Anyone see what
>> I messed up?
>>
>> Thanks,
>>
>> Kirk
>
More information about the grass-user
mailing list