[GRASS-SVN] r48189 - grass/trunk/lib/vector/Vlib
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Sep 7 13:27:22 EDT 2011
Author: martinl
Date: 2011-09-07 10:27:22 -0700 (Wed, 07 Sep 2011)
New Revision: 48189
Modified:
grass/trunk/lib/vector/Vlib/header.c
Log:
vlib: simplify Vect_get_ogr_geometry_type()
Modified: grass/trunk/lib/vector/Vlib/header.c
===================================================================
--- grass/trunk/lib/vector/Vlib/header.c 2011-09-07 16:46:35 UTC (rev 48188)
+++ grass/trunk/lib/vector/Vlib/header.c 2011-09-07 17:27:22 UTC (rev 48189)
@@ -309,43 +309,9 @@
return NULL;
Ogr_feature_defn = OGR_L_GetLayerDefn(Map->fInfo.ogr.layer);
- Ogr_geom_type = OGR_FD_GetGeomType(Ogr_feature_defn);
- switch(Ogr_geom_type) {
- case wkbPoint:
- return G_store(_("Point"));
- case wkbMultiPoint:
- return G_store(_("MultiPoint"));
- case wkbLineString:
- return G_store(_("LineString"));
- case wkbMultiLineString:
- return G_store(_("MultiLineString"));
- case wkbPolygon:
- return G_store(_("Polygon"));
- case wkbMultiPolygon:
- return G_store(_("MultiPolygon"));
- case wkbGeometryCollection:
- return G_store(_("GeometryCollection"));
- case wkbNone:
- return G_store(_("None"));
- case wkbLinearRing:
- return G_store(_("LinearRing"));
- case wkbPoint25D:
- return G_store(_("3D Point"));
- case wkbMultiPoint25D:
- return G_store(_("3D MultiPoint"));
- case wkbLineString25D:
- return G_store(_("3D LineString"));
- case wkbMultiLineString25D:
- return G_store(_("3D MultiLineString"));
- case wkbPolygon25D:
- return G_store(_("3D Polygon"));
- case wkbMultiPolygon25D:
- return G_store(_("3D MultiPolygon"));
- case wkbGeometryCollection25D:
- return G_store(_("3D GeometryCollection"));
- default:
- return G_store(_("Unknown"));
- }
+ Ogr_geom_type = wkbFlatten(OGR_FD_GetGeomType(Ogr_feature_defn));
+
+ return OGRGeometryTypeToName(Ogr_geom_type);
#endif
return NULL;
}
More information about the grass-commit
mailing list