[GRASS-user] Shape file dbfs field name truncation leads to duplicate filed names on import

I've been working at trying bring data from either shapefile or e00
file into GRASS 6.4.3 However some of the layers simply do not
import. The trouble seems to be that some of the column names in the
shape dbf violate naming limits and result duplicate column names
which cause a failure. E00 files (same data but different format) also
result in a failure. As far as I can tell, the cause is the same. In
some tables the process of importing the data results in duplicate
field names due to truncation. Switching to the SQLite driver did not
help here.

The data files are USGS coverages created originally in the '90s. If
anyone has a recommended utility that can handle this problem, please
let me know.

JWDougherty

On Sun, Apr 20, 2014 at 10:12:48PM -0700, we recorded a bogon-computron collision of the <jwd@surewest.net> flavor, containing:

I've been working at trying bring data from either shapefile or e00
file into GRASS 6.4.3 However some of the layers simply do not
import. The trouble seems to be that some of the column names in the
shape dbf violate naming limits and result duplicate column names
which cause a failure. E00 files (same data but different format) also
result in a failure. As far as I can tell, the cause is the same. In
some tables the process of importing the data results in duplicate
field names due to truncation. Switching to the SQLite driver did not
help here.

The data files are USGS coverages created originally in the '90s. If
anyone has a recommended utility that can handle this problem, please
let me know.

The only answer I'm aware of to this problem is the "cnames=" option of
v.in.ogr, which allows you to rename the columns on import. I've had to
use it often for precisely the reasons you're seeing.

--
Tom Russo KM5VY SAR502 DM64ux http://www.swcp.com/~russo/
Tijeras, NM QRPL#1592 K2#398 SOC#236 http://kevan.org/brain.cgi?DDTNM
echo "prpv_a'rfg_cnf_har_cvcr" | sed -e 's/_/ /g' | tr [a-m][n-z] [n-z][a-m]

On Mon, Apr 21, 2014 at 7:12 AM, jwd <jwd@surewest.net> wrote:

I've been working at trying bring data from either shapefile or e00
file into GRASS 6.4.3 However some of the layers simply do not
import. The trouble seems to be that some of the column names in the
shape dbf violate naming limits and result duplicate column names
which cause a failure. E00 files (same data but different format) also
result in a failure. As far as I can tell, the cause is the same. In
some tables the process of importing the data results in duplicate
field names due to truncation. Switching to the SQLite driver did not
help here.

Hmm, switching to the SQLite driver should help. Did you use
db.connect driver=sqlite database="$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/"

or another command / other options. Note that you should use
$GISDBASE/$LOCATION_NAME/$MAPSET literally and not replace these
variables with their content.

What does db.connect -p say after switching to the SQLite dirver?
What are the error messages after switching to the SQLite dirver?

Markus M

The data files are USGS coverages created originally in the '90s. If
anyone has a recommended utility that can handle this problem, please
let me know.

JWDougherty

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

On Tue, Apr 22, 2014 at 2:25 PM, Markus Metz
<markus.metz.giswork@gmail.com>wrote:

On Mon, Apr 21, 2014 at 7:12 AM, jwd <jwd@surewest.net> wrote:
> I've been working at trying bring data from either shapefile or e00
> file into GRASS 6.4.3 However some of the layers simply do not
> import. The trouble seems to be that some of the column names in the
> shape dbf violate naming limits and result duplicate column names
> which cause a failure. E00 files (same data but different format) also
> result in a failure. As far as I can tell, the cause is the same. In
> some tables the process of importing the data results in duplicate
> field names due to truncation. Switching to the SQLite driver did not
> help here.

Hmm, switching to the SQLite driver should help. Did you use
db.connect driver=sqlite
database="$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/"

or another command / other options. Note that you should use
$GISDBASE/$LOCATION_NAME/$MAPSET literally and not replace these
variables with their content.

What does db.connect -p say after switching to the SQLite dirver?
What are the error messages after switching to the SQLite dirver?

See https://trac.osgeo.org/grass/ticket/2193 for explanation of

duplication and issues with cnames parameter.

Vaclav

Markus M

>
> The data files are USGS coverages created originally in the '90s. If
> anyone has a recommended utility that can handle this problem, please
> let me know.
>
> JWDougherty
>
> _______________________________________________
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user