[GRASS-user] v.in.ogr: encoding problem with shapefile DBF file

Moritz Lennert mlennert at club.worldonline.be
Thu Oct 1 00:50:05 PDT 2015


On 01/10/15 08:34, RichardCooper wrote:
> Hi,
>
> I'm getting an error on attempting to import a shapefile with a DBF file
> containing Thai characters (sample below) using v.in.ogr. I've also
> attempted to set encoding as per
> https://grass.osgeo.org/grass70/manuals/v.in.ogr.html
>
> The file is utf-8 and the headers do not contain Thai characters.
>
> I can open the file in QGIS and view Thai characters in its attribute table,
> but in GRASS, only the attribute column headers are imported.
>
> I'd be grateful for any suggestions.
>
> Cheers,
> Richard
>
>
> Error from GRASS command console:
> v.in.ogr input= ../Bridge.shp layer=Bridge output=Bridge --overwrite
> encoding=utf8
> Check if OGR layer <Bridge> contains polygons...
> WARNING: Vector map <Bridge> already exists and will be overwritten
> Importing 1189 features (OGR layer <Bridge>)...
> DBMI-PostgreSQL driver error:
> Unable to execute:
> insert into public.Bridge values ( 1, '', '', '',
> 0.00000000000, 0.00000000000, 0.00000000000,
> 'ถนนประชาร่วมใจ', '6', 6, 0, 0,
> 0.00000000000, 6.00000000000, '', '', 0, 0, 0, 0, 0, 0, 0,
> 0, '', 0, 0, '', '', '', '', '', 0.00000000000, '', '', '',
> '', '', '', 0.00000000000, 0.00000000000, 0.00000000000, '',
> '', '', '', 41, 0.00000000000, '', 0.00000000000, 0.000000 )
> ERROR:  invalid input syntax for type date: ""

Not sure this is an encoding issue. There seems to be some empty fields 
that are supposed to be date fields and PostgreSQL doesn't seem to like 
that.

I don't have a solution for this right now, though.

Moritz




More information about the grass-user mailing list