Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shp2pgsql -c -I -s 27700 admin_font_point strategi_point | psql -d opendata
- Shapefile type: MultiPoint
- Postgis type: MULTIPOINT[2]
- SET
- SET
- BEGIN
- NOTICE: CREATE TABLE will create implicit sequence "strategi_point_gid_seq" for serial column "strategi_point.gid"
- NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "strategi_point_pkey" for table "strategi_point"
- CREATE TABLE
- addgeometrycolumn
- -------------------------------------------------------------------
- public.strategi_point.the_geom SRID:27700 TYPE:MULTIPOINT DIMS:2
- (1 row)
- ERROR: new row for relation "strategi_point" violates check constraint "enforce_geotype_the_geom"
- ERROR: current transaction is aborted, commands ignored until end of transaction block
- SET CLIENT_ENCODING TO UTF8;
- SET STANDARD_CONFORMING_STRINGS TO ON;
- BEGIN;
- CREATE TABLE "strategi_point" (gid serial PRIMARY KEY,
- "code" int4,
- "legend" varchar(42),
- "file_name" varchar(16),
- "number" numeric(11,0),
- "name" varchar(180),
- "number0" varchar(64),
- "admin_name" varchar(50),
- "type" varchar(40),
- "ferry_from" varchar(50),
- "ferry_to" varchar(50),
- "ferry_time" varchar(10),
- "ferry_type" varchar(20),
- "restrictio" varchar(20),
- "access" varchar(30),
- "amended" date,
- "usage" varchar(64),
- "location" varchar(30),
- "gis" varchar(80),
- "owner" varchar(60),
- "north" varchar(60),
- "south" varchar(60),
- "east" varchar(60),
- "west" varchar(60),
- "clockwise" varchar(60),
- "anticlockw" varchar(60),
- "imperial" int4,
- "metric" int4);
- SELECT AddGeometryColumn('','strategi_point','the_geom','27700','MULTIPOINT',2);
- INSERT INTO "strategi_point" ("code","legend","file_name","number","name","number0","admin_name","type","ferry_from","ferry_to","ferry_time","ferry_type","restrictio","access","amended","usage","location","gis","owner","north","south","east","west","clockwise","anticlockw","imperial","metric",the_geom) VALUES ('5734','Administrative Detached Attribute Point','gb_north','5307',NULL,NULL,'ISLE OF MAN',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'20000413',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'-9999','-9999','0101000020346C000000000000302A0A4100000000304F1C41');
- Check constraints:
- "enforce_dims_the_geom" CHECK (st_ndims(the_geom) = 2)
- "enforce_geotype_the_geom" CHECK (geometrytype(the_geom) = 'MULTIPOINT'::text OR the_geom IS NULL)
- "enforce_srid_the_geom" CHECK (st_srid(the_geom) = 27700)
- Check constraints:
- "enforce_dims_the_geom" CHECK (st_ndims(the_geom) = 2)
- "enforce_srid_the_geom" CHECK (st_srid(the_geom) = 27700)
- select geometrytype('0101000020346C000000000000302A0A4100000000304F1C41');
- --POINT
- -S Generate simple Geometries instead of MULTIgeometries. Shape files don't differ between LINESTRINGs and MULTILINESTRINGs, so shp2pgsql generates MUL‐
- TILINESTRINGs by default. This switch will produce LINESTRINGs instead, but shp2pgsql will fail when it hits a real MULTILINESTRING. The same works
- for POLYGONs vs. MULTIPOLYGONs.
- SELECT AddGeometryColumn('','strategi_point','the_geom','27700','POINT',2);
- shp2pgsql -p -s 27700 admin_font_point strategi_point | psql -d opendata
- $ psql -d opendata
- psql (8.4.6)
- Type "help" for help.
- opendata=# ALTER TABLE strategi_point DROP CONSTRAINT enforce_geotype_the_geom;
- ALTER TABLE
- shp2pgsql -a -s 27700 admin_font_point strategi_point | psql -d opendata
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement