[postgis-users] importing shape files nightmare!

strk at refractions.net strk at refractions.net
Fri Sep 16 05:10:24 PDT 2005


Christo, would you try applying the following patch
to shp2pgsql.c from 1.0.4 ? It would be very helpful ...

--strk(patch_follows);

Index: shp2pgsql.c
===================================================================
RCS file: /home/cvs/postgis/postgis/loader/shp2pgsql.c,v
retrieving revision 1.88.2.7
diff -U2 -r1.88.2.7 shp2pgsql.c
--- shp2pgsql.c 29 Aug 2005 22:36:14 -0000      1.88.2.7
+++ shp2pgsql.c 16 Sep 2005 12:08:20 -0000
@@ -450,9 +450,12 @@
        {
                obj = SHPReadObject(hSHPHandle,j);
-               if ( obj && obj->nVertices > 0 ) {
+               if ( obj )
+               {
+                       if ( obj->nVertices > 0 ) {
+                               SHPDestroyObject(obj);
+                               break;
+                       }
                        SHPDestroyObject(obj);
-                       break;
                }
-               SHPDestroyObject(obj);
                obj=NULL;
        }




More information about the postgis-users mailing list