Hi all,<br>
<br>
ok i was able to get the points vector file done- silly syntax mistake on my part-sorry.<br>
But i could use some input on my attempts to connect my data dbf file to the vector points file as layer 2.<br>
<br>
What i did is, that i prepared a dbf file in Windows, then brought it
into my /dbf folder in Linux/Grass. Now this file is recognized when i
do db.describe(below):<br>
<br>
<span style="color: rgb(153, 0, 0);">GRASS 6.0.1 (ncdc):~/Desktop/NCDC > db.describe -c Data</span><br style="color: rgb(153, 0, 0);">
<span style="color: rgb(153, 0, 0);">ncols:11</span><br style="color: rgb(153, 0, 0);">
<span style="color: rgb(153, 0, 0);">Column 1: WMOID</span><br style="color: rgb(153, 0, 0);">
<span style="color: rgb(153, 0, 0);">Column 2: CITY</span><br style="color: rgb(153, 0, 0);">
<span style="color: rgb(153, 0, 0);">Column 3: YEAR</span><br style="color: rgb(153, 0, 0);">
<span style="color: rgb(153, 0, 0);">Column 4: YDAY</span><br style="color: rgb(153, 0, 0);">
<span style="color: rgb(153, 0, 0);">Column 5: TMAX</span><br style="color: rgb(153, 0, 0);">
<span style="color: rgb(153, 0, 0);">Column 6: TMIN</span><br style="color: rgb(153, 0, 0);">
<span style="color: rgb(153, 0, 0);">Column 7: TDAY</span><br style="color: rgb(153, 0, 0);">
<span style="color: rgb(153, 0, 0);">Column 8: RAIN</span><br style="color: rgb(153, 0, 0);">
<span style="color: rgb(153, 0, 0);">Column 9: VPD</span><br style="color: rgb(153, 0, 0);">
<span style="color: rgb(153, 0, 0);">Column 10: SRAD</span><br style="color: rgb(153, 0, 0);">
<span style="color: rgb(153, 0, 0);">Column 11: DAYLEN</span><br>
<br>
<span style="color: rgb(0, 0, 0);">BUT, the column 'WMOID' which i want
to use as key, has suddenly become float (it was integer when i made it
in windows), and in fact all numeric columns are assigned double
precision now when they were not originally. How do i rectify this,
since to identify a key tolink my vector points to this data file, the
key column should be integer?<br>
<br>
I dont know postgresql, mysql etc, therefore i'm trying things this way..<br>
<br>
thanks,<br>
vishal<br>
</span><br><div><span class="gmail_quote">On 3/17/06, <b class="gmail_sendername">David Finlayson</b> <<a href="mailto:david.p.finlayson@gmail.com">david.p.finlayson@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Breezy also has the "flip" command (search synaptic) for converting<br>line endings.<br><br>-David<br><br>On 3/16/06, Stefan Istvan <<a href="mailto:stefi@geohidroterv.hu">stefi@geohidroterv.hu</a>> wrote:
<br>> On Fri, 2006-03-17 at 11:30 +0530, Vishal Mehta wrote:<br>> > Hi all,<br>> ><br>> > I'm trying to bring in a comma separated text file as a point vector<br>> > file in GRASS using v.in.ascii
, before i try to link it to a large<br>> > 33Mb dbf data file.<br>> ><br>> > The csv file looks like this with 39 rows and i removed the header<br>> > because grass60 (on Ubuntu breezy) does not have the skip option in
<br>> > the v.in.ascii command: the columns are WMOID, cityname, Latitude and<br>> > Longitude. I want to use the WMOID as 'cat' in order to link my dbf<br>> > data later.<br>> ><br>> > 420710,AMRITSAR,
31.63,74.86<br>> > 421010,PATIALA,30.33,76.46<br>> > 421310,HISSAR,29.16,75.73<br>> > 421820,DELHI,28.58,77.20<br>> > 423390,JODHPUR,26.30,73.01<br>> > 423480,JAIPUR,26.81,75.80<br>> > 423690,LUCKNOW,
26.75,80.88<br>> > 424100,GAUHATI,26.10,91.58<br>> ><br>> > I Tried the following command and got the error:<br>> ><br>> > cat reformat/STATIONS2.dat | v.in.ascii output=stations2 fs=','<br>
> > columns='cat int, name(varchar(30), y double, x double' x=4 y=3 cat=1<br>> > WARNING: DOS text format found, attempting import anyway<br>> > Maximum input row length: 39<br>> > Maximum number of columns: 4
<br>> > Minimum number of columns: 4<br>> > column: 1 type: integer<br>> > column: 2 type: string length: 18<br>> > column: 3 type: double<br>> > column: 4 type: double<br>> > DBMI-DBF driver error:
<br>> > SQL parser error in statement:<br>> > create table stations2 ( cat int, name(varchar(30), x double, y<br>> > double )<br>> > Error in db_execute_immediate()<br>> ><br>> > ERROR: Cannot create table: create table stations2 ( cat int,
<br>> > name(varchar(30), x double, y double )<br>> ><br>> > I also get the same error with<br>> ><br>> > v.in.ascii input=reformat/STATIONS.csv output=gstations fs=',' skip=1<br>> > columns='cat int, label(varchar(30), y double, x double' x=4 y=3 cat=1
<br>> ><br>> There is an additional "(" sign in your columns definition. You should<br>> write columns='cat int, label varchar(30), y double, x double'.<br>> The other problem maybe that your file is in MSDOS format, but it could
<br>> be that it doesn't bother Grass. Try to use dos2unix command to convert<br>> it to unix format.<br>><br>> Regards,<br>> Istvan<br>><br>><br><br><br>--<br>David Finlayson<br></blockquote></div><br>