[GRASS-SVN] r51151 - grass/trunk/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Mar 23 10:34:50 EDT 2012


Author: martinl
Date: 2012-03-23 07:34:50 -0700 (Fri, 23 Mar 2012)
New Revision: 51151

Modified:
   grass/trunk/lib/vector/Vlib/open_ogr.c
Log:
vlib: partly revert r51126, don't use
OGR_L_GetName()/OGR_L_GetGeomType() (introduced in GDAL 1.8.0)


Modified: grass/trunk/lib/vector/Vlib/open_ogr.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open_ogr.c	2012-03-23 14:18:51 UTC (rev 51150)
+++ grass/trunk/lib/vector/Vlib/open_ogr.c	2012-03-23 14:34:50 UTC (rev 51151)
@@ -54,6 +54,7 @@
     
     OGRDataSourceH Ogr_ds;
     OGRLayerH Ogr_layer;
+    OGRFeatureDefnH Ogr_featuredefn;
     OGRwkbGeometryType Ogr_geom_type;
     
     Ogr_layer = NULL;
@@ -88,9 +89,10 @@
     G_debug(2, "%d layers found in data source", nLayers);
 
     for (i = 0; i < nLayers; i++) {
-	Ogr_layer = OGR_DS_GetLayer(Ogr_ds, i);
-	if (strcmp(OGR_L_GetName(Ogr_layer), ogr_info->layer_name) == 0) {
-	    Ogr_geom_type = OGR_L_GetGeomType(Ogr_layer);
+	Ogr_layer = OGR_DS_GetLayer(Ogr_ds, i);	
+	Ogr_featuredefn = OGR_L_GetLayerDefn(Ogr_layer);
+	if (strcmp(OGR_FD_GetName(Ogr_featuredefn), ogr_info->layer_name) == 0) {
+	    Ogr_geom_type = OGR_FD_GetGeomType(Ogr_featuredefn);
 	    layer = i;
 	    break;
 	}
@@ -178,6 +180,7 @@
     OGRSFDriverH    Ogr_driver;
     OGRDataSourceH  Ogr_ds;
     OGRLayerH       Ogr_layer;
+    OGRFeatureDefnH Ogr_featuredefn; 
     
     OGRRegisterAll();
     
@@ -203,7 +206,8 @@
     nlayers = OGR_DS_GetLayerCount(Ogr_ds);
     for (i = 0; i < nlayers; i++) {
       	Ogr_layer = OGR_DS_GetLayer(Ogr_ds, i);
-	if (strcmp(OGR_L_GetName(Ogr_layer), name) == 0) {	
+	Ogr_featuredefn = OGR_L_GetLayerDefn(Ogr_layer);
+	if (strcmp(OGR_FD_GetName(Ogr_featuredefn), name) == 0) {	
 	    if (G_get_overwrite()) {
 		G_warning(_("OGR layer <%s> already exists and will be overwritten"),
 			  ogr_info->layer_name);



More information about the grass-commit mailing list