[GRASS-dev] v.in.ogr broken (\w shp)

Brad Douglas rez at touchofmadness.com
Mon Sep 4 21:21:48 EDT 2006


On Mon, 2006-09-04 at 18:09 +0200, Maciej Sieczka wrote:
> Hamish wrote:
> > Brad Douglas wrote:
> >> Is there an easy fix for this?  I'm trying to import a shapefile and
> >> I'm not terribly familiar with this part of the GRASS architecture.
> >>
> >> GRASS 6.3.cvs (hamilton):~/hamilton > v.in.ogr dsn=. output=roads
> >> layer=17
> >> Projection of input dataset and current location appear to match.
> >> Proceeding with import...
> >> Layer: 17
> >> DBMI-DBF driver error:
> >> Column 'ADMIN_CLAS' already exists (duplicate name)
> >> Cannot create table.
> >> Error in db_execute_immediate()
> >>
> >> ERROR: Cannot create table: create table roads (cat integer, PREFIX
> >> varchar
> >>        ( 2 ), NAME varchar ( 30 ), TYPE varchar ( 4 ), SUFFIX varchar
> >> ( 2
> >>        ), FCC varchar ( 3 ), FIPS varchar ( 11 ), ID integer,
> >>        FULL_NAME varchar ( 40 ), ADMIN_CLAS varchar ( 40 ), CATEGORY
> >>        integer, ST_CNTY_FI varchar ( 11 ), RD_CLASS varchar ( 4 ),
> >>        RTE_NUM1
> >> varchar
> >>        ( 4 ), RTE_NUM2 varchar ( 4 ), ADMIN_CLAS integer, AREA double
> >>        precision, LEN double precision)
> >> GRASS 6.3.cvs (hamilton):~/hamilton >
> 
> > DBF limits column names to 10 chars;
> 
> Brad,
> 
> Just curious:
> 
> Hamish is right. And you are importing a shapefile, correct? So how
> could a column name longer than 10 chars be in the dbf shipped with
> that shapefile?

After looking at the DBF, it appears that they've extracted from another
source to a shapefile.  During the extraction, it truncates the column
names at 10 characters, leaving duplicate column names.  It's *really*
bad practice on their part.

I have confirmed this with a new dataset.


-- 
Brad Douglas <rez touchofmadness com>                      KB8UYR
Address: 37.493,-121.924 / WGS84    National Map Corps #TNMC-3785




More information about the grass-dev mailing list