I am trying to read a CSV file where the geometries of neighbouring polygons are stored in couples. The file looks like this.
I usually read shapefiles in GDAL using the following syntax
GDALAllRegister();
GDALDataset *poDS;
poDS = (GDALDataset*) GDALOpenEx("shape.shp", GDAL_OF_VECTOR, NULL, NULL, NULL );
if( poDS == NULL )
{
printf( "Open failed.\n" );
exit( 1 );
}
OGRLayer *poLayer;
poLayer = poDS->GetLayerByName("shape" ); // returns the layer that refers to the name (name.shp)
cout <<"There are " << poLayer -> GetFeatureCount() << "features"<<endl ;
OGRFeature *poFeature;
But this of course doesn't work. The documentation found here (http://gdal.org/1.11/ogr/drv_csv.html) did not help me at all unfortunately.
I would like to know if there is a way to read this file in GDAL. I am coding in C++, but an answer in Python would be informative as well.