[postgis-users] how to import SHP into postGIS? error message.

Paul Ramsey pramsey at refractions.net
Mon Feb 19 11:23:07 PST 2007


Drop your database and start again with a different encoding that 
matches the strings in your dbf file.

createdb --encoding=<encoding> dbname

http://www.postgresql.org/docs/8.1/static/multibyte.html

Maciej Skorczewski wrote:
> i use this command:
> 
> 
> ogr2ogr -f postgres "PG:dbname=postgis user=postgres password=pass 
> host=localhost port=5432"  osienazwy.shp
> 
> this command create a table:
> 
> CREATE TABLE osienazwy
> (
>   ogc_fid serial NOT NULL,
>   wkb_geometry geometry,
>   id double precision,
>   idulicy double precision,
>   ulica character(30),
>   id1 double precision,
>   id2 double precision,
>   kier2 character(1),
>   length numeric(31,15),
>   idodcinka double precision,
>   CONSTRAINT osienazwy_pk PRIMARY KEY (ogc_fid),
>   CONSTRAINT enforce_dims_wkb_geometry CHECK (ndims(wkb_geometry) = 2),
>   CONSTRAINT enforce_geotype_wkb_geometry CHECK 
> (geometrytype(wkb_geometry) = 'LINESTRING'::text OR wkb_geometry IS NULL),
>   CONSTRAINT enforce_srid_wkb_geometry CHECK (srid(wkb_geometry) = -1)
> )
> WITHOUT OIDS;
> ALTER TABLE osienazwy OWNER TO postgres;
> 
> 
> 
> 
> !!!BUT!!!
> 
> i have problem whit encoding so can't load data form shp - have can i 
> use another encoding? (i think that table create is ok.)
> 
> i have this error
> http://img89.imageshack.us/img89/3579/errorae0.jpg
> (encoding problem)
> 
> 
> 
> 
> 
> 
> when i  use shp2pgsql i get another table (whit this same shp file)
> 
> 
> CREATE TABLE osienazwy
> (
>   gid serial NOT NULL,
>   id bigint,
>   idulicy bigint,
>   ulica character varying(30),
>   "pełna" character varying(100),
>   id1 bigint,
>   id2 bigint,
>   kier2 boolean,
>   length numeric,
>   idodcinka bigint,
>   the_geom geometry,
>   CONSTRAINT osienazwy_pkey PRIMARY KEY (gid),
>   CONSTRAINT enforce_dims_the_geom CHECK (ndims(the_geom) = 2),
>   CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) = 
> 'MULTILINESTRING'::text OR the_geom IS NULL),
>   CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = -1)
> )
> WITHOUT OIDS;
> ALTER TABLE osienazwy OWNER TO postgres;
> 
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users


-- 

   Paul Ramsey
   Refractions Research
   http://www.refractions.net
   pramsey at refractions.net
   Phone: 250-383-3022
   Cell: 250-885-0632



More information about the postgis-users mailing list