Sorry, the call GDALOpen will not work for shape files:
Use OGRRegisterAll(); dataSource = OGRSFDriverRegistrar::Open((const char*) filePath.c_str()); for c++; and hDS = OGROpen <http://www.gdal.org/ogr/ogr__api_8h.html#123bb02ac8c5cfe143e132f627531125> ( "point.shp", FALSE, NULL ); for c. see http://www.gdal.org/ogr/ogr_apitut.html for more info Martin From: Martin Chapman [mailto:[email protected]] Sent: Monday, July 20, 2009 3:48 PM To: 'Smart, Gary'; '[email protected]' Subject: RE: [gdal-dev] How do I open vector files (e.g. shp) using GDAL Call OGRRegisterAll(); on the line right before GDALOpen(); Martin From: [email protected] [mailto:[email protected]] On Behalf Of Smart, Gary Sent: Monday, July 20, 2009 2:51 PM To: [email protected] Subject: [gdal-dev] How do I open vector files (e.g. shp) using GDAL I understand that GDAL can open vector formats as if they were a dataset? E.g. I read that it is possible to pass the GDALOpen either a single .shp file (in which case it treats it as if it only had one layer) or a directory containing multiple .shp files - which presumably it opens as multi layered? However, whenever I try to open vector files in this way (directory or file) I get. ERROR 4 - blah blah is not recognised as a supported file format" I am still new to all this (having only just conquered raster formats) so I suspect I am doing something pretty dumb. Perhaps someone can help? Gary
_______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
