[GRASS-dev] [GRASS GIS] #346: v.in.ogr fails when ArcIDs list is longer than 40 characters

#346: v.in.ogr fails when ArcIDs list is longer than 40 characters
-----------------------------+----------------------------------------------
Reporter: dmahoney | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: minor | Milestone:
Component: Vector | Version: svn-trunk
Keywords: v.in.ogr arcids | Platform: Unspecified
      Cpu: Unspecified |
-----------------------------+----------------------------------------------
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', '', '', '',
        '' )

}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/346&gt;
GRASS GIS <http://grass.osgeo.org>

#346: v.in.ogr fails when ArcIDs list is longer than 40 characters
--------------------------+-------------------------------------------------
  Reporter: dmahoney | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: svn-trunk
Resolution: | Keywords: v.in.ogr arcids
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by neteler):

  * priority: minor => major
  * milestone: => 6.4.0

Comment:

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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/346#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#346: v.in.ogr fails when ArcIDs list is longer than 40 characters
-----------------------+----------------------------------------------------
  Reporter: dmahoney | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.0
Component: Vector | Version: svn-trunk
Resolution: | Keywords: v.in.ogr arcids
  Platform: All | Cpu: All
-----------------------+----------------------------------------------------
Changes (by neteler):

  * platform: Unspecified => All
  * cpu: Unspecified => All

Comment:

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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/346#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#346: v.in.ogr fails when ArcIDs list is longer than 40 characters
-----------------------------+----------------------------------------------
Reporter: dmahoney | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: Vector | Version: svn-trunk
Keywords: v.in.ogr arcids | Platform: All
      Cpu: All |
-----------------------------+----------------------------------------------
Changes (by martinl):

* cc: martinl (added)

Comment:

Replying to [comment:2 neteler]:
> Is this a reasonable patch? Feedback from power users desired...

seems to be reasonable patch for me.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/346#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#346: v.in.ogr fails when ArcIDs list is longer than 40 characters
-----------------------------+----------------------------------------------
Reporter: dmahoney | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 6.4.4
Component: Vector | Version: svn-trunk
Keywords: v.in.ogr arcids | Platform: All
      Cpu: All |
-----------------------------+----------------------------------------------
Changes (by neteler):

  * milestone: 6.4.0 => 6.4.4

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/346#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#346: v.in.ogr fails when ArcIDs list is longer than 40 characters
-----------------------+-----------------------------
  Reporter: dmahoney | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: major | Milestone: 6.4.4
Component: Vector | Version: svn-trunk
Resolution: | Keywords: v.in.ogr arcids
       CPU: All | Platform: All
-----------------------+-----------------------------

Comment (by neteler):

OFTIntegerListlength enlarged in trunk in r65133

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/346#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>