[postgis-users] UNICODE error message from shp2pgsql...

Mike Leahy mgleahy at fes.uwaterloo.ca
Thu Oct 14 14:04:03 PDT 2004


Hello list,

I'm trying out the PostgreSQL 8.0 beta 2 dev 3 and PostGIS 0.9.0 windows
installers on an XP pro machine.  I ran shp2pgsql with the dump option,
output the results to a text file as usual, and tried executing the sql from
the text file to create the PostGIS table.  Here's my results/error:

C:\Program Files\PostgreSQL\8.0-beta2-dev3\bin>psql -U postgres -q -f
d:/test2.txt mmdb
Password:
                 dropgeometrycolumn
----------------------------------------------------
 public.sig_distritos.the_geom effectively removed.
(1 row)

psql:d:/test2.txt:3: NOTICE:  CREATE TABLE will create implicit sequence
"sig_distritos_gid_seq" for serial column "sig_distritos.gid"
                     addgeometrycolumn
------------------------------------------------------------
 public.sig_distritos.the_geom SRID:32718 TYPE:MULTIPOLYGON
 geometry_column fixed:0
(1 row)

psql:d:/test2.txt:5: ERROR:  invalid byte sequence for encoding "UNICODE":
0xf83038
CONTEXT:  COPY sig_distritos, line 1, column lat_dist: "08ø08'33""
psql:d:/test2.txt:1836: NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create
implicit index "sig_distritos_pkey" for table
 "sig_distritos"
 setval
--------
   1827	
(1 row)

For what it's worth, the first few lines from the shp2pgsql-generated script
are included below (with most of the coordinates removed from the first
multipolygon in the copy command).  Does anyone know what I need to do to
get around this UNICODE error?  I don't even know where this 'lat_dist'
column mentioned in the error message is coming from, since it doesn't even
exist in the CREATE TABLE or COPY commands, but I've been getting similar
messages for files that had 'Ñ' in some text fields, which weren't
recognized properly in UNICODE.

Thanks in advance,
Mike

======================================================================

SELECT DropGeometryColumn('','sig_distritos','the_geom');
DROP TABLE "sig_distritos";
CREATE TABLE "sig_distritos" (gid serial, "codigo_dep" varchar, "nomb_dep"
varchar, "codigo_pro" varchar, "nomb_prov" varchar, "codigo_dis" varchar,
"nomb_dist" varchar, "nom_cap" varchar, "cat_cap" varchar, "alt_dist"
numeric(19,0), "reg_nat" varchar, "cod_dist" varchar, "easting" numeric,
"northing" numeric, "area" numeric);
SELECT
AddGeometryColumn('','sig_distritos','the_geom','32718','MULTIPOLYGON',2);
COPY "sig_distritos"
(gid,"codigo_dep","nomb_dep","codigo_pro","nomb_prov","codigo_dis","nomb_dis
t","nom_cap","cat_cap","alt_dist","reg_nat","cod_dist","easting","northing",
"area",the_geom) FROM stdin;
0	13	LA LIBERTAD	1310	SANTIAGO DE CHUCO	131001
SANTIAGO DE CHUCO	SANTIAGO DE CHUCO	CIUDAD	3099	2
131001	1.42577071247e+005	9.07566197790e+006	1.08067900996e+009
SRID=32718 ;MULTIPOLYGON(((151549.685634206 9101626.99430132
,151542.855396074 9101508.00165183 <
 removed coordinates 
>
151646.272470946 9101981.10502726 ,151528.539477517 9101741.01125204
,151549.685634206 9101626.99430132 )))






More information about the postgis-users mailing list