[gdal-dev] ogr2ogr, shapefile 2 postgis

Roger André randre at gmail.com
Thu May 1 17:21:09 EDT 2008


Hi Paal,

I think you may need to create the PostGIS database with the encoding set
explicitly to 1252.

You can do that in the pgsql command line with, "createdb --encoding WIN1252
new_db".

Roger
--

On Thu, May 1, 2008 at 2:09 PM, Paal Sund <paalsund at gmail.com> wrote:

> 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
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080501/b5923422/attachment.html


More information about the gdal-dev mailing list