[postgis-commits] svn - r3359 - trunk/loader

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Wed Dec 3 09:12:54 PST 2008


Author: mcayland
Date: 2008-12-03 09:12:54 -0800 (Wed, 03 Dec 2008)
New Revision: 3359

Modified:
   trunk/loader/shp2pgsql.c
Log:
Fix GBT#79: shp2pgsql does not honor -s (also known as Mark accidentally missed the sr_id from the geometry constructors)


Modified: trunk/loader/shp2pgsql.c
===================================================================
--- trunk/loader/shp2pgsql.c	2008-12-03 16:27:44 UTC (rev 3358)
+++ trunk/loader/shp2pgsql.c	2008-12-03 17:12:54 UTC (rev 3359)
@@ -866,13 +866,13 @@
 		}
 	
 		/* Generate the LWLINE */
-		lwmultilinestrings[u] = lwline_as_lwgeom(lwline_construct(-1, &bbox, dpas[u]->pa));
+		lwmultilinestrings[u] = lwline_as_lwgeom(lwline_construct(sr_id, &bbox, dpas[u]->pa));
 	}
 
 	/* If using MULTILINESTRINGs then generate the serialized collection, otherwise just a single LINESTRING */
 	if (simple_geometries == 0)
 	{
-		lwcollection = lwcollection_construct(MULTILINETYPE, -1, &bbox, obj->nParts, lwmultilinestrings);
+		lwcollection = lwcollection_construct(MULTILINETYPE, sr_id, &bbox, obj->nParts, lwmultilinestrings);
 		serialized_lwgeom = lwgeom_serialize(lwcollection_as_lwgeom(lwcollection));
 	}
 	else
@@ -1156,14 +1156,14 @@
 		}
 
 		/* Generate the LWGEOM */
-		lwpoly = lwpoly_construct(-1, &bbox, ring_total, pas[pi]);	
+		lwpoly = lwpoly_construct(sr_id, &bbox, ring_total, pas[pi]);	
 		lwpolygons[pi] = lwpoly_as_lwgeom(lwpoly);
 	}
 
 	/* If using MULTIPOLYGONS then generate the serialized collection, otherwise just a single POLYGON */
 	if (simple_geometries == 0)
 	{
-		lwcollection = lwcollection_construct(MULTIPOLYGONTYPE, -1, &bbox, polygon_total, lwpolygons);
+		lwcollection = lwcollection_construct(MULTIPOLYGONTYPE, sr_id, &bbox, polygon_total, lwpolygons);
 		serialized_lwgeom = lwgeom_serialize(lwcollection_as_lwgeom(lwcollection));
 	}
 	else
@@ -1247,14 +1247,14 @@
 		dynptarray_addPoint4d(dpas[u], &point4d, 0);
 
 		/* Generate the LWPOINT */
-		lwmultipoints[u] = lwpoint_as_lwgeom(lwpoint_construct(-1, NULL, dpas[u]->pa));
+		lwmultipoints[u] = lwpoint_as_lwgeom(lwpoint_construct(sr_id, NULL, dpas[u]->pa));
 	}
 
 	/* If we have more than 1 vertex then we are working on a MULTIPOINT and so generate a MULTIPOINT
 	rather than a POINT */
 	if (obj->nVertices > 1)
 	{
-		lwcollection = lwcollection_construct(MULTIPOINTTYPE, -1, &bbox, obj->nVertices, lwmultipoints);
+		lwcollection = lwcollection_construct(MULTIPOINTTYPE, sr_id, &bbox, obj->nVertices, lwmultipoints);
 		serialized_lwgeom = lwgeom_serialize(lwcollection_as_lwgeom(lwcollection));
 	}
 	else



More information about the postgis-commits mailing list