[gdal-dev] Setting Geometry using WFS-T/OGR/GDAL
Ahmed Tolba
Ahmed.Tolba at schiebel.net
Wed Feb 8 03:04:39 PST 2017
Hi All,
I'm trying to set a Geometry which is a polygon using the following code:
OGRLayer *poLayer;
poLayer = m_wfs_t->GetLayerByName("tows:poiserver");
OGRFeature *poFeature;
poFeature = OGRFeature::CreateFeature( poLayer->GetLayerDefn() );
poFeature->SetField( "name", "ahmed" );
OGRLinearRing ring1;
OGRPolygon poly;
ring1.addPoint(1116651.439379124, 637392.6969887456);
ring1.addPoint(1188804.0108498496, 652655.7409537067);
ring1.addPoint(1226730.3625203592, 634155.0816022386);
ring1.addPoint(1281307.30760719, 636467.6640211721);
ring1.closeRings();
poly.addRing(&ring1);
poFeature->SetGeometry(&poly);
if( poLayer->CreateFeature( poFeature ) != OGRERR_NONE ) // ERROR HERE
{
std::cout <<"error creating a feature"<<endl;
}
But I get Error : Transaction Response. I don't know whether the problem is in my server or a problem in OGR itself.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170208/c89fa0f3/attachment-0001.html>
More information about the gdal-dev
mailing list