[fdo-commits] r152 - branches/3.2.x/Providers/ArcSDE/Src/Provider

svn_fdo at osgeo.org svn_fdo at osgeo.org
Wed Mar 14 20:43:16 EDT 2007


Author: jacklee
Date: 2007-03-14 20:43:15 -0400 (Wed, 14 Mar 2007)
New Revision: 152

Modified:
   branches/3.2.x/Providers/ArcSDE/Src/Provider/ArcSDEUtils.cpp
Log:
Pass NULL for the z and m parameters to the ArcSDE functions if 2d or no measure

Modified: branches/3.2.x/Providers/ArcSDE/Src/Provider/ArcSDEUtils.cpp
===================================================================
--- branches/3.2.x/Providers/ArcSDE/Src/Provider/ArcSDEUtils.cpp	2007-03-12 16:39:06 UTC (rev 151)
+++ branches/3.2.x/Providers/ArcSDE/Src/Provider/ArcSDEUtils.cpp	2007-03-15 00:43:15 UTC (rev 152)
@@ -712,7 +712,17 @@
 		arr = (type)malloc(arr##_cursize); \
 	}
 
+#define SETUP_BUFFERS(Z,M) \
+	if (dim & FdoDimensionality_Z) \
+		zBuffer = Z; \
+	else \
+		zBuffer = NULL; \
+	if (dim & FdoDimensionality_M) \
+		mBuffer = M; \
+	else \
+		mBuffer = NULL;
 
+
 void convert_fgf_to_sde_shape(ArcSDEConnection *connection, FdoByteArray* fgf, SE_COORDREF coordref, SE_SHAPE& result_shape, bool bCropToExtents)
 {
     LONG lResult = SE_SUCCESS;
@@ -730,6 +740,9 @@
     SE_ENVELOPE given_coordref_envelope;
     SE_SHAPE *work_shape = NULL;
     FdoException *exception = NULL;
+	LFLOAT *zBuffer = NULL;
+	LFLOAT *mBuffer = NULL;
+
     
     try
     {
@@ -781,6 +794,8 @@
             work_shape = &result_shape;
         }
 
+		SETUP_BUFFERS(connection->mGeomBuffer_pointsZ, connection->mGeomBuffer_pointsM);
+
         // Convert FdoIGeometry to SE_SHAPE:
         switch (geom->GetDerivedType())
         {
@@ -835,7 +850,7 @@
                 }
 
                 // Populate the SE_SHAPE based on the XY,Z, and M arrays:
-                lResult = SE_shape_generate_point (totalNumPoints, connection->mGeomBuffer_pointsXY, connection->mGeomBuffer_pointsZ, connection->mGeomBuffer_pointsM, *work_shape);
+                lResult = SE_shape_generate_point (totalNumPoints, connection->mGeomBuffer_pointsXY, zBuffer, mBuffer, *work_shape);
                 handle_sde_err<FdoCommandException>(connection->GetConnection(), lResult, __FILE__, __LINE__, ARCSDE_CONVERT_SHAPE_FAILED, "Failed to convert FGF geometry to ArcSDE shape.");
             }
             break;
@@ -868,7 +883,7 @@
                 }
 
                 // Populate the SE_SHAPE based on the XY,Z, and M arrays:
-                lResult = SE_shape_generate_line (totalNumPoints, 1, NULL, connection->mGeomBuffer_pointsXY, connection->mGeomBuffer_pointsZ, connection->mGeomBuffer_pointsM, *work_shape);
+                lResult = SE_shape_generate_line (totalNumPoints, 1, NULL, connection->mGeomBuffer_pointsXY, zBuffer, mBuffer, *work_shape);
                 handle_sde_err<FdoCommandException>(connection->GetConnection(), lResult, __FILE__, __LINE__, ARCSDE_CONVERT_SHAPE_FAILED, "Failed to convert FGF geometry to ArcSDE shape.");
             }
             break;
@@ -921,7 +936,7 @@
                 }
 
                 // Populate the SE_SHAPE based on the XY,Z, and M arrays:
-                lResult = SE_shape_generate_line (totalNumPoints, numLineStrings, connection->mGeomBuffer_offsets, connection->mGeomBuffer_pointsXY, connection->mGeomBuffer_pointsZ, connection->mGeomBuffer_pointsM, *work_shape);
+                lResult = SE_shape_generate_line (totalNumPoints, numLineStrings, connection->mGeomBuffer_offsets, connection->mGeomBuffer_pointsXY, zBuffer, mBuffer, *work_shape);
                 handle_sde_err<FdoCommandException>(connection->GetConnection(), lResult, __FILE__, __LINE__, ARCSDE_CONVERT_SHAPE_FAILED, "Failed to convert FGF geometry to ArcSDE shape.");
             }
             break;
@@ -985,7 +1000,7 @@
                 }
 
                 // Populate the SE_SHAPE based on the XY,Z, and M arrays:
-                lResult = SE_shape_generate_polygon (totalNumPoints, 1, NULL, connection->mGeomBuffer_pointsXY, connection->mGeomBuffer_pointsZ, connection->mGeomBuffer_pointsM, *work_shape);
+                lResult = SE_shape_generate_polygon (totalNumPoints, 1, NULL, connection->mGeomBuffer_pointsXY, zBuffer, mBuffer, *work_shape);
                 handle_sde_err<FdoCommandException>(connection->GetConnection(), lResult, __FILE__, __LINE__, ARCSDE_CONVERT_SHAPE_FAILED, "Failed to convert FGF geometry to ArcSDE shape.");
             }
             break;
@@ -1066,7 +1081,7 @@
                 }
 
                 // Populate the SE_SHAPE based on the XY,Z, and M arrays:
-                lResult = SE_shape_generate_polygon (totalNumPoints, numPolygons, connection->mGeomBuffer_offsets, connection->mGeomBuffer_pointsXY, connection->mGeomBuffer_pointsZ, connection->mGeomBuffer_pointsM, *work_shape);
+                lResult = SE_shape_generate_polygon (totalNumPoints, numPolygons, connection->mGeomBuffer_offsets, connection->mGeomBuffer_pointsXY, zBuffer, mBuffer, *work_shape);
                 handle_sde_err<FdoCommandException>(connection->GetConnection(), lResult, __FILE__, __LINE__, ARCSDE_CONVERT_SHAPE_FAILED, "Failed to convert FGF geometry to ArcSDE shape.");
             }
             break;
@@ -1948,6 +1963,8 @@
     SE_SHAPE *resultShapes = NULL;
     FdoException *exception = NULL;
     SE_COORDREF coordref = NULL;
+	LFLOAT *zBuffer = NULL;
+	LFLOAT *mBuffer = NULL;
 
     try
     {
@@ -1983,7 +2000,8 @@
         {
             RESIZE(connection->mGeomBuffer_pointsM, double*, numPoints * sizeof(double));
         }
-        lResult = SE_shape_get_all_points (shape, SE_DEFAULT_ROTATION, connection->mGeomBuffer_part_offsets, connection->mGeomBuffer_subpart_offsets, connection->mGeomBuffer_pointsXY, connection->mGeomBuffer_pointsZ, connection->mGeomBuffer_pointsM);
+		SETUP_BUFFERS(connection->mGeomBuffer_pointsZ, connection->mGeomBuffer_pointsM);
+        lResult = SE_shape_get_all_points (shape, SE_DEFAULT_ROTATION, connection->mGeomBuffer_part_offsets, connection->mGeomBuffer_subpart_offsets, connection->mGeomBuffer_pointsXY, zBuffer, mBuffer);
         handle_sde_err<FdoException>(lResult, __FILE__, __LINE__, ARCSDE_FAILED_PROCESSING_SPATIAL_CONDITION, "Failed to process the given spatial condition.");
 
         // Get shape's coordref:



More information about the fdo-commits mailing list