[GRASS-user] Error while importing shapefile

Richard Chirgwin rchirgwin at ozemail.com.au
Wed Oct 26 17:34:31 EDT 2011


On 26/10/11 10:57 AM, grass-user-request at lists.osgeo.org wrote:
> Message: 1
> Date: Tue, 25 Oct 2011 15:42:31 +0100
> From: Ant?nio Rocha<antonio.rocha at deimos.com.pt>
> Subject: [GRASS-user] Error while importing shapefile
> To: GRASS user list<grass-user at lists.osgeo.org>
> Message-ID:<4EA6CAD7.5020203 at deimos.com.pt>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Greetings
> I have tried to import this shapefile (that I can display in QGIS) but I
> go this error
> (Tue Oct 25 15:38:40
> 2011)
> v.in.ogr dsn=/home/GPS_Project.shp layer=GPS_Project output=GPS_Project
> Projection of input dataset and current location appear to match
> Layer: GPS_Project
> DBMI-DBF driver error:
> SQL parser error: syntax error, unexpected TIME, expecting
> NAME processing 'time'
> in statement:
> create table GPS_Project (cat integer, ele
> double precision, time varchar ( 80 ), magvar double
> precision, geoidheigh double precision, name varchar ( 80 ),
> cmt varchar ( 80 ), desc_ varchar ( 80 ), src varchar ( 80
> ), link1_href varchar ( 80 ), link1_text varchar ( 80 ),
> link1_type varchar ( 80 ), link2_href varchar ( 80 ),
> link2_text varchar ( 80 ), link2_type varchar ( 80 ), sym
> varchar ( 80 ), type varchar ( 80 ), fix varchar ( 80 ), sat
> integer, hdop double precision, vdop double precision, pdop
> double precision, ageofdgpsd double precision, dgpsid
> integer, label varchar ( 80 ))
> Error in db_execute_immediate()
> ERROR: Unable to create table: 'create table GPS_Project (cat integer,
> ele double precision, time varchar ( 80 ), magvar double precision,
> geoidheigh double precision, name varchar ( 80 ), cmt varchar ( 80 ),
> desc_ varchar ( 80 ), src varchar ( 80 ), link1_href varchar ( 80 ),
> link1_text varchar ( 80 ), link1_type varchar ( 80 ), link2_href varchar
> ( 80 ), link2_text varchar ( 80 ), link2_type varchar ( 80 ), sym
> varchar ( 80 ), type varchar ( 80 ), fix varchar ( 80 ), sat integer,
> hdop double precision, vdop double precision, pdop double precision,
> ageofdgpsd double precision, dgpsid integer, label varchar ( 80 ))'
> (Tue Oct 25 15:38:41 2011) Command finished (0 sec)
>
> Any suggestion on how to solve this?
> Thanks
> Best regards,
> Antonio
Antonio - I think "time" is not allowed as a field name in some databases?

If that's the problem, then you need to specify the field names for 
v.in.ogr import, using the cnames flag - and instead of naming the field 
"time", call it something else (my_time would do, I suppose).

With a big table, this is a pain in the neck, but I think it's your only 
choice.

Richard C


More information about the grass-user mailing list