[postgis-users] shp2pgsql multipolygon weirdness

Burgholzer,Robert rwburgholzer at deq.virginia.gov
Wed Jun 4 06:57:16 PDT 2008


You're seeing binary. Some where along the way the storage of shapes in
PostGIS was changed to that.  To see the type of stuff you want, AFTER
inserting your data, you can do:

 

SELECT gid, name, asText(the_geom) from geotable;

 

 

Robert W. Burgholzer

Surface Water Modeler

Office of Water Supply and Planning

Virginia Department of Environmental Quality

rwburgholzer at deq.virginia.gov

804-698-4405

Open Source Modeling Tools:

http://sourceforge.net/projects/npsource/

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Andre Hauptfleisch
Sent: Wednesday, June 04, 2008 9:51 AM
To: PostGIS User Mailing List
Subject: [postgis-users] shp2pgsql multipolygon weirdness

 

Good day,

I'm new to PostGIS and need to get a shapefile into the pgsql db.

I stumbled onto the shp2pgsql tool, but when I run it on my shapefile, I
get a string of weird looking hex digits. Perhaps I don't quite
understand what the tool does, but I would expect it to output something
'sensible' such as: 

INSERT INTO "geotable"
("zid","name","color","icon_size","extrude","tesellate",the_geom) 




VALUES ('1','Untitled Polygon',NULL,NULL,NULL,NULL,'POLYGON(x y, x
y,.....)');


Here is my output:

Shapefile type: Polygon

Postgis type: MULTIPOLYGON[2]
BEGIN;
CREATE TABLE "geotable" (gid serial PRIMARY KEY,
"zid" int4,
"name" varchar(30),
"color" varchar(10),
"icon_size" varchar(5),
"extrude" varchar(1),
"tesellate" varchar(1));
SELECT
AddGeometryColumn('','geotable','the_geom','-1','MULTIPOLYGON',2);
INSERT INTO "geotable"
("zid","name","color","icon_size","extrude","tesellate",the_geom) VALUES
('1','Untitled
Polygon',NULL,NULL,NULL,NULL,'0106000000010000000103000000010000000A0000
000000003411F63B400000C88F31073AC00000002B87F63B400000E81DA7083AC00000F0
53E3F53B400000385EBA093AC00000F085C9F43B40000008A3920A3AC0000060B3EAF33B
40000040355E0A3AC0000060DC46F33B4000006007CE093AC0000060DC46F33B400000A0
ABAD083AC00000807CD0F33B40000088F4DB073AC0000060A1D6F43B400000605452073A
C00000003411F63B400000C88F31073AC0');
...

Any guidance would be much appreciated.

-- 
Andre Hauptfleisch

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20080604/c7e1d04f/attachment.html>


More information about the postgis-users mailing list