[postgis-users] how to import SHP into postGIS? error message.
Maciej Skorczewski
maciej.skorczewski at procad.pl
Mon Feb 19 10:52:23 PST 2007
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;
More information about the postgis-users
mailing list