<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=windows-1255"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hi Patrick<br>
<br>
On 12/01/2010 05:29 PM, Patrick_schirmer wrote:
<blockquote cite="mid:4CF669BE.6060702@gmx.ch" type="cite">
<meta http-equiv="content-type"
content="text/html; charset=windows-1255">
Hi, me again :-/<br>
<br>
I got two vectorfiles with points - one file representing the current
location of persons and the other one representing previous locations
of the same persons. Persons are unique and have an id which is present
in both files. I would like to calculate the distance each person has
moved. Thought it would be best doing this in the datbase.<br>
<br>
<u>my approach:</u><br>
v.db.addcolumn map=GR_xy_current col="x_current double precision,
y_current double precision, distance double precision"<br>
v.db.addcolumn map=GR_xy_last col="x_last double precision, y_last
double precision"<br>
v.to.db map=GR_xy_current option=coor col=x_current,y_current<br>
v.to.db map=GR_xy_last option=coor col=x_last,y_last<br>
v.db.join map=GR_xy_current column=id otable=GR_xy_last ocolumn=id <br>
<br>
<u>All commands will run except the last one, creating this error:</u><br>
<br>
DBMI-Postgres driver error:<br>
Cannot execute: <br>
ALTER TABLE GR_xy_current ADD COLUMN x_arbeit DOUBLE PRECISION(8)<br>
ERROR: syntax error at or near "("<br>
LINE 1: ... TABLE GR_xy_current ADD COLUMN x_arbeit DOUBLE PRECISION(8)<br>
^<br>
<br>
</blockquote>
<br>
I can't figure out where the "(8)" is coming from. That syntax is an
error in postgres: double precision does not take a length qualifier.<br>
There's nothing in the v.db.join script that I can find that would add
such a thing. Are the commands above what you typed? Where did the
"x_arbeit" column name come from??<br>
<br>
-- <br>
Micha<br>
<br>
<br>
<blockquote cite="mid:4CF669BE.6060702@gmx.ch" type="cite">ERROR: Error
while executing: 'ALTER TABLE GR_xy_current ADD COLUMN<br>
x_last DOUBLE PRECISION(8)'<br>
ERROR: Unable to add column <x_last DOUBLE PRECISION(8)>.<br>
ERROR: Error creating column <x_last>.<br>
<br>
The value the coord "x" has it bigger than (8), which might be the
problem. But it is already in the table and I can't define it's length
in the command. Is that a problem of v.db.join or can I set the length
of the double_precision_field before creation through v.db.addcolumn?<br>
<br>
Thanks for your hints!<br>
<br>
Patrick<br>
<br>
datbase: PG; Grass-version 7.0<br>
<br>
<br>
<br>
This mail was received via Mail-SeCure System.<br>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
grass-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a>
This mail was received via Mail-SeCure System.
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Micha Silver
Arava Development Co. +972-52-3665918
<a class="moz-txt-link-freetext" href="http://www.surfaces.co.il">http://www.surfaces.co.il</a>
</pre>
</body>
</html>