Siva, I'm not sure how to help you with the below code. Perhaps if you explain the error someone else on the list might be able to help.
My suggestion was how to get the area using the command line tool ogr2ogr. Regards, Eli On Thu, Jun 14, 2012 at 1:16 AM, SIVA RAMA KRISHNA <s.r.kriis...@gmail.com> wrote: > Eli Adam, > > i am Trying To Find Area of A Polygon > with the Following Code > > int main() > { > OGRRegisterAll(); > OGRLayer *poLayer; > OGRFeature *poFeature; > OGRDataSource *poDS; > poDS = OGRSFDriverRegistrar::Open( "first.shp"); > poLayer = poDS->GetLayerByName( "first"); > int nCount=poDS->GetLayerCount(); > printf("%d",nCount); > poLayer->ResetReading(); > OGRGeometry *poGeometry; > OGRGeometryCollection *PoGC; > while((poFeature=poLayer->GetNextFeature())!=NULL) > { > int nCnt=poFeature->GetFieldCount(); > printf("\n %d",nCnt); > qDebug()<<"entered"; > poGeometry=poFeature->GetGeometryRef(); > if(poGeometry !=NULL > && wkbFlatten(poGeometry->getGeometryType()) == wkbPolygon) > { > PoGC->addGeometry(poGeometry); > double area = PoGC->get_Area() ; > qDebug() << area ; > } > } > return 0; > } > > i am getting Error > With Regards > siva > _______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev