[postgis-users] blank shapefile, force table creation

Chapman, Martin MChapman at sanz.com
Fri Sep 3 12:57:08 PDT 2004


Gregor,

The ESRI white paper for shape files says null geoms are valid, and apps
must test for them.  They are generally used when inserting new
geometries and sometimes apps don't handle them well.  There is a tool
called shapechecker that will remove nulls from shapefiles.  It's a
windows app and I don't know how good it is, but it's worked for me in
the past to clean up shape files.  I am attaching it and you can see if
it will give you a quick fix (if your data is in a .shp file)  Also, be
sure to back up your files first though.

Martin

-----Original Message-----
From: Gregor Mosheh [mailto:stigmata at blackangel.net] 
Sent: Friday, September 03, 2004 1:50 PM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] blank shapefile, force table creation



I have a dataset that I'm converting to PG via shp2pgsql

In this particular subset I'm trying to import, some of the shapefiles 
have 0 records in them (e.g. building points, but we're in a remote area

with no buildings). In these cases, shp2pgsql bails and says that
"shapefile contains 0 null objects"

There's a big difference between a table with 0 records and a table
that's 
missing, so what I would like it to do is still print the SQL for table 
creation even if there are no rows to insert. Would this be a relatively

simple patch?

_______________________________________________
postgis-users mailing list postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shapechk.zip
Type: application/x-zip-compressed
Size: 140957 bytes
Desc: shapechk.zip
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20040903/d40cb169/attachment.bin>


More information about the postgis-users mailing list