Hi guys!<div><br></div><div>I'm trying to create a shapefile containing a single polygon, but unfortunately I'm facing an error that I have no clue how to solve.</div><div>I'm successfuly creating a datasource and a layer with:</div>
<div><br></div><div>OGRLayer* testLayer = newDataSource->CreateLayer("test",NULL, wkbPolygon, NULL);</div><div><br></div><div>Then when I try to create a feature containing a <b>previously calculated*</b> polygon like this:</div>
<div><br></div><div>OGRFeature* feature = OGRFeature::CreateFeature(testLayer->GetLayerDefn());</div><div>feature->SetGeometry(myPolygon);</div><div>OGRErr errorCode = testLayer->CreateFeature(feature);</div><div>
<br></div><div>The line 'testLayer->CreateFeature(feature)' fails returning the error code:</div><div>OGRERR_UNSUPPORTED_GEOMETRY_TYPE 3</div><div><br></div><div>What am I missing here? How can I "make my geometry type supported"? Any clues?</div>
<div>Maybe I have to set the geometry type somehow somewhere else (on the layer or the geometry definition)... I don't know...</div><div><br></div><div><b>(*) </b>FYI, 'myPolygon' is generated with the Intersection of other 2 Polygons</div>
<div>OGRGeometry *myPolygon = basinPolygon->Intersection(landscapePolygon);</div><div><br></div><div>Thanks in Advance,</div><div>Best Regards,</div><div>Hugo Benício.</div>