Opened 13 years ago

Last modified 6 years ago

#346 new defect

v.in.ogr fails when ArcIDs list is longer than 40 characters

Reported by: dmahoney Owned by: grass-dev@…
Priority: major Milestone: 6.4.6
Component: Vector Version: svn-trunk
Keywords: v.in.ogr arcids Cc: martinl
CPU: All Platform: All

Description

When importing from Arc/INFO coverage, OGR inserts a column called arcids as an integer list. It is inserted into the GRASS attribute tables as a 40 character string field. However, some database backends do not truncate overly long strings, but fail instead when the record is inserted into the database. So some (polygon) coverages can be imported, and some can not.

This is the error reported.

Importing map 7030 features...
DBMI-Postgres driver error:
Cannot execute:
insert into test values ( 7029, '(9:13801,-13851,-13937,-14012,-14045,-13979,-13902,13856,13804)',        809371204,       154051.26690, 7030, 6850, '', 'XX00000000', '', '', '', '' )
ERROR:  value too long for type character varying(40)


ERROR: Cannot insert new row: insert into test values ( 7029,
       '(9:13801,-13851,-13937,-14012,-14045,-13979,-13902,13856,13804)',
       809371204, 154051.26690, 7030, 6850, '', 'XX00000000', '', '', '',
       '' )

Attachments (1)

v.in.ogr.patch (1.0 KB) - added by dmahoney 13 years ago.
Patch to fix ArcID string length issue

Download all attachments as: .zip

Change History (7)

Changed 13 years ago by dmahoney

Attachment: v.in.ogr.patch added

Patch to fix ArcID string length issue

comment:1 Changed 13 years ago by neteler

Milestone: 6.4.0
Priority: minormajor

Note for devs:

cd grass64/vector/v.in.ogr/
grep 40 *
main.c:    int OFTIntegerListlength = 40;       /* hack due to limitation in OGR */

The attached patch seems to address this hack.

Markus

comment:2 Changed 13 years ago by neteler

CPU: UnspecifiedAll
Platform: UnspecifiedAll

Is this a reasonable patch? Feedback from power users desired...

comment:3 in reply to:  2 Changed 11 years ago by martinl

Cc: martinl added

Replying to neteler:

Is this a reasonable patch? Feedback from power users desired...

seems to be reasonable patch for me.

comment:4 Changed 9 years ago by neteler

Milestone: 6.4.06.4.4

comment:5 Changed 7 years ago by neteler

OFTIntegerListlength enlarged in trunk in r65133

comment:6 Changed 6 years ago by neteler

Milestone: 6.4.46.4.6
Note: See TracTickets for help on using tickets.