attrQueryRow.GetGeometry(geometry); int shapeType; geometry.GetShapeType(shapeType); GeometryType geometryType = (GeometryType)(geometry.GeometryType(shapeType)); vector<Point> retrievedPoints; switch(geometryType) { case GeometryType::geometryPolygon: { int numPoints; ((MultiPointShapeBuffer*)&geometry)->GetNumPoints(numPoints); if(numPoints > 1) { retrievedPoints.resize(numPoints); Point* testP = &(retrievedPoints[0]); ((MultiPointShapeBuffer*)&geometry)->GetPoints(testP);
It seems you are supposed to just send a new pointer and the GetPoints() will allocate memory for its points and set the pointer to that memory, but is there a method that frees the memory?
It feels a bit weird that I would first have to get the geometry, then check its shape and geometry type, then retrieve it once again. attrQueryRow.GetGeometry(geometry); int shapeType; geometry.GetShapeType(shapeType); GeometryType geometryType = (GeometryType)(geometry.GeometryType(shapeType)); vector<Point> retrievedPoints; switch(geometryType) { case GeometryType::geometryPolygon: { int numPoints; ((MultiPointShapeBuffer*)&geometry)->GetNumPoints(numPoints); if(numPoints > 1) { retrievedPoints.resize(numPoints); Point* testP = &(retrievedPoints[0]); ((MultiPointShapeBuffer*)&geometry)->GetPoints(testP); In this example, retrievedPoints gets filled with Point objects with x = 0 and y = 0, which is not correct. If I would take the same geometry and use it as a point geometry, I would get one correct point coordinate. Am I missing something?
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.