[GRASS-user] GRASS 7.2 v.in.ascii error
Thomas Adams
tea3rd at gmail.com
Thu Jan 19 10:22:18 PST 2017
Hi all!
I'm using GRASS 7.2 on Ubuntu 16.04 LTS trying to import a csv file that
looks like this:
2017-01-15T16:47:29.070Z,36.4586667,-83.0818333,22.74,2.58,md,24,69,0.2334,0.11,se,se60172026,2017-01-18T00:59:44.532Z,"8km
NW of Rogersville, Tennessee",earthquake,0.24,0.55,0.107,14,reviewed,se,se
2016-12-13T11:37:31.220Z,35.7103333,-82.8548333,6.08,2.59,md,30,43,0.05349,0.15,se,se60141742,2017-01-18T09:14:07.040Z,"18km
NE of Cove Creek, North Carolina",earthquake,0.2,0.5,0.048,23,reviewed,se,se
2016-10-30T04:01:47.390Z,35.619,-84.2315,9.7,2.56,md,30,52,0.06166,0.19,se,se60163691,2016-12-01T06:52:36.040Z,"3km
NNE of Vonore, Tennessee",earthquake,0.31,0.5,0.09,17,reviewed,se,se
2016-10-25T02:42:50.480Z,35.8158333,-84.0938333,3.32,2.7,md,31,36,0.1557,0.25,se,se60163236,2016-12-07T22:23:49.040Z,"4km
W of Louisville, Tennessee",earthquake,0.41,1.25,0.123,18,reviewed,se,se
2016-09-26T06:05:04.530Z,35.3206667,-84.5148333,5.56,2.54,md,27,51,0.04922,0.14,se,se60134497,2016-12-14T03:17:50.040Z,"0km
ESE of Etowah, Tennessee",earthquake,0.26,0.33,0.086,12,reviewed,se,se
2016-09-07T00:07:27.880Z,35.8961667,-83.681,23.79,2.53,md,21,59,0.08793,0.18,se,se60158301,2016-12-03T02:54:46.040Z,"5km
ENE of Seymour, Tennessee",earthquake,0.31,0.6,0.192,13,reviewed,se,se
2016-07-18T09:53:39.560Z,37.1892,-81.8317,0,3.7,mwr,,,,0.83,us,us20006fi5,2016-09-17T01:27:49.040Z,"11km
NNW of Richlands, Virginia",mine collapse,3.5,2,,30,reviewed,nm,slm
2016-06-17T14:38:15.320Z,35.3501667,-84.8731667,17.96,2.59,md,33,53,0.2193,0.13,se,se60147326,2016-08-27T02:15:26.040Z,"12km
N of Hopewell, Tennessee",earthquake,0.2,0.57,0.146,19,reviewed,se,se
2016-05-08T09:09:55.970Z,36.1145,-83.7825,16.13,2.65,md,27,50,0.08996,0.16,se,se60115062,2016-07-20T18:10:48.040Z,"6km
NNW of Mascot, Tennessee",earthquake,0.26,0.51,0.076,17,reviewed,se,se
2016-04-25T14:43:29.760Z,35.7528333,-82.5716667,4.25,2.53,md,28,47,0.2129,0.26,se,se60025303,2016-07-08T02:49:22.040Z,"6km
N of Weaverville, North
Carolina",earthquake,0.4,1.05,0.059,12,reviewed,se,se
2016-04-25T08:00:11.710Z,35.3116667,-84.2303333,17.32,2.54,md,35,54,0.1843,0.16,se,se60138746,2016-07-08T02:49:21.040Z,"26km
SSE of Madisonville, Tennessee",earthquake,0.25,0.64,0.083,19,reviewed,se,se
in v.in.ascii my column definition is:
time varchar(30),latitude double precision,longitude double precision,depth
double precision,mag double precision,magType varchar(4),nst int,gap
int,dmin double precision,rms double precision,net varchar(4),id
varchar(20),updated varchar(30),place varchar(50),type
varchar(20),horizontalError double precision,depthError double
precision,magError double precision,magNst int,status
varchar(20),locationSource varchar(4),magSource varchar(4)
So, the command line looks like this:
v.in.ascii input=/home/teaiii/Downloads/earthquake_query.csv
output=earthquakes separator=comma columns="time varchar(30),latitude
double precision,longitude double precision,depth double precision,mag
double precision,magType varchar(4),nst int,gap int,dmin double
precision,rms double precision,net varchar(4),id varchar(20),updated
varchar(30),place varchar(50),type varchar(20),horizontalError double
precision,depthError double precision,magError double precision,magNst
int,status varchar(20),locationSource varchar(4),magSource varchar(4)" x=3
y=2 z=4 cat=0
I'm getting this error:
(Thu Jan 19 13:05:13
2017)
v.in.ascii input=/home/teaiii/Downloads/earthquake_query.csv
output=earthquakes separator=comma columns=time varchar(30),latitude double
precision,longitude double precision,depth double precision,mag double
precision,magType varchar(4),nst int,gap int,dmin double precision,rms
double precision,net varchar(4),id varchar(20),updated varchar(30),place
varchar(50),type varchar(20),horizontalError double precision,depthError
double precision,magError double precision,magNst int,status
varchar(20),locationSource varchar(4),magSource varchar(4) x=3 z=4
Scanning input for column types...
Number of columns: 22
Number of rows: 429
DBMI-DBF driver error:
SQL parser error (syntax error, unexpected TIME, expecting
NAME processing 'time') in statement:
create table earthquakes ( cat integer, time
varchar(30),latitude double precision,longitude double
precision,depth double precision,mag double
precision,magType varchar(4),nst int,gap int,dmin double
precision,rms double precision,net varchar(4),id
varchar(20),updated varchar(30),place varchar(50),type
varchar(20),horizontalError double precision,depthError
double precision,magError double precision,magNst int,status
varchar(20),locationSource varchar(4),magSource varchar(4) )
Unable to execute statement.
DBMI-DBF driver error:
SQL parser error (syntax error, unexpected TIME, expecting
NAME processing 'time') in statement:
create table earthquakes ( cat integer, time
varchar(30),latitude double precision,longitude double
precision,depth double precision,mag double
precision,magType varchar(4),nst int,gap int,dmin double
precision,rms double precision,net varchar(4),id
varchar(20),updated varchar(30),place varchar(50),type
varchar(20),horizontalError double precision,depthError
double precision,magError double precision,magNst int,status
varchar(20),locationSource varchar(4),magSource varchar(4) )
Unable to execute statement.
ERROR: Unable to create table: create table earthquakes ( cat integer, time
varchar(30),latitude double precision,longitude double precision,depth
double precision,mag double precision,magType varchar(4),nst int,gap
int,dmin double precision,rms double precision,net varchar(4),id
varchar(20),updated varchar(30),place varchar(50),type
varchar(20),horizontalError double precision,depthError double
precision,magError double precision,magNst int,status
varchar(20),locationSource varchar(4),magSource varchar(4) )
WARNING: Table <earthquakes> linked to vector map <earthquakes> does not
exist
(Thu Jan 19 13:05:13 2017) Command finished (0
sec)
Any thoughts?
Best,
Tom
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20170119/8541f5fb/attachment.html>
More information about the grass-user
mailing list