[gdal-dev] ogr2ogr, shapefile 2 postgis

Paal Sund paalsund at gmail.com
Thu May 1 17:09:07 EDT 2008


Hi,
I am getting the following error while loading a shapefile to postgis 
using ogr2ogr interactively from 'DOS' command window (cmd):

ogr2ogr -f "PostgreSQL" -a_srs "EPSG:32633" PG:"<some values>" 
33_n5000_bygg_punkt.shp -nln n5000_bygg_pun


ERROR 1: INSERT command for new feature failed.

FEIL: invalid byte sequence for encoding "UTF8": 0x86

HINT: This error can also happen if the byte sequence does not match the 
encoding expected by the server, which is controlled by "client_encoding".


Command: INSERT INTO "n5000_bygg_pun" (wkb_geometry , "area", 
"perimeter", "kupu

nkt_", "kupunkt_id", "objtype", "ptema", "tett_id", "navn", "fyr_id", 
"oppdatert

") VALUES (GeomFromEWKT('SRID=32768;POINT (897350 7911435)'::TEXT) ,

0.00000, 0.00000, 11, 503, 'Tettsted', 4007, 860

2, 'Honningsvåg', 0, 20010301)

ERROR 1: Terminating translation prematurely after failed

translation of layer 33_n5000_bygg_punkt




My ogr2ogr is from the latest FWTools, running on Windows XP 2002 sp2.
My PostGIS is from the latest windows binaries (postgresql 8.3 and the 
application stack builder)

Any clues? The error message seems to point in the encoding direction. 
My shapefile has 1252 encoding.
I havent done anything with encoding stuff in postgrsql.

Help appreciated,
best Pål Herman



More information about the gdal-dev mailing list