[GRASS-user] Error importing NOAA enc file with v.in.ogr (?)

Markus Metz markus.metz.giswork at gmail.com
Sun Dec 14 23:39:11 PST 2014


On Mon, Dec 15, 2014 at 6:41 AM, Markus Neteler <neteler at osgeo.org> wrote:
> On Mon, Dec 15, 2014 at 2:13 AM, Richard Reitmeyer
> <rareitmeyer at gmail.com> wrote:
>> Hello, all.
>>
>> I'm sure this is user error, but I'm not having much success importing NOAA ENC charts into GRASS. I'm missing a column, or something, and would welcome a suggestion.
>
> For a test I have downloaded
> http://www.charts.noaa.gov/ENCs/ENCs.shtml
> --> http://www.charts.noaa.gov/ENCs/IL_ENCs.zip   (random choice)
>
> and also run into troubles:
>
> GRASS 7.0.0svn (latlong):~/ENC_ROOT > v.in.ogr
> ENC_ROOT/US5IN11M/US5IN11M.000 out=s57
> [...]
> Importing 15 features (OGR layer <BCNLAT>)...
> DBMI-SQLite driver error:
> Error in sqlite3_prepare():
> table s57_2 has 44 columns but 43 values were supplied
>
> DBMI-SQLite driver error:
> Error in sqlite3_prepare():
> table s57_2 has 44 columns but 43 values were supplied
>
> ERROR: Cannot insert new row: insert into s57_2 values ( 1, 1, 1, 2, 7, 2,
>        550, 395184755, 3480, '0226178E0A730D98', '(1:2)', 1, 1, '4', '',
>        NULL, NULL, NULL, '', '', NULL, NULL, NULL, '', '', 'Buffington
>        Harbor Inner Breakwater West Light 1', '', '', '8', NULL, NULL,
>        NULL, '', '', '', '', NULL, 89999, '', '', '', '19960820',
>        'US,US,reprt,9thCGD,LNM 23/96' )
>
> I suspect that the comma in the last string entry is not parsed
> properly.

I don't think it is the comma because that would cause too many
values. Instead, too few values were supplied.

> I came across a similar issue recently with v.in.ascii,
> perhaps we get it solved. I'll discuss with Markus Metz who improved
> the tokenizer recently for other issues.

The GRASS tokenizer is not used here, the attribute values are
obtained from OGR. The bug was that a string list is recognized by
v.in.ogr as a supported column when creating a table, but not when
populating a table. Fixed in r63548.

Markus M


More information about the grass-user mailing list