[GRASS-SVN] r39527 - in grass/trunk: include lib/vector lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Oct 16 05:40:22 EDT 2009


Author: martinl
Date: 2009-10-16 05:40:21 -0400 (Fri, 16 Oct 2009)
New Revision: 39527

Modified:
   grass/trunk/include/vector.h
   grass/trunk/lib/vector/Vlib/open.c
   grass/trunk/lib/vector/vectorlib.dox
Log:
vlib: Vect_maptype() added


Modified: grass/trunk/include/vector.h
===================================================================
--- grass/trunk/include/vector.h	2009-10-15 14:48:39 UTC (rev 39526)
+++ grass/trunk/include/vector.h	2009-10-16 09:40:21 UTC (rev 39527)
@@ -433,6 +433,7 @@
 /* Open/close/rewind map */
 int Vect_coor_info(const struct Map_info *, struct Coor_info *);
 const char *Vect_maptype_info(const struct Map_info *);
+int Vect_maptype(const struct Map_info *);
 int Vect_open_topo(struct Map_info *, int);
 int Vect_save_topo(struct Map_info *);
 int Vect_open_sidx(struct Map_info *, int);

Modified: grass/trunk/lib/vector/Vlib/open.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open.c	2009-10-15 14:48:39 UTC (rev 39526)
+++ grass/trunk/lib/vector/Vlib/open.c	2009-10-16 09:40:21 UTC (rev 39527)
@@ -764,14 +764,29 @@
 	sprintf(maptype, "ogr");
 	break;
     default:
-	sprintf(maptype, "unknown %d (update Vect_maptype_info)",
+	sprintf(maptype, _("unknown %d (update Vect_maptype_info)"),
 		Map->format);
     }
 
     return G_store(maptype);
 }
 
+/*!
+  \brief Gets vector map format
 
+  Currently are implemeted:
+   - Native format (GV_FORMAT_NATIVE)
+   - OGR format    (GV_FORMAT_OGR)
+
+  \param Map pointer to Map_info structure
+  
+  \return maptype code
+*/
+int Vect_maptype(const struct Map_info *Map)
+{
+    return Map->format;
+}
+
 /*!
  * \brief Open topology file ('topo')
  *

Modified: grass/trunk/lib/vector/vectorlib.dox
===================================================================
--- grass/trunk/lib/vector/vectorlib.dox	2009-10-15 14:48:39 UTC (rev 39526)
+++ grass/trunk/lib/vector/vectorlib.dox	2009-10-16 09:40:21 UTC (rev 39527)
@@ -2238,6 +2238,8 @@
 
  - Vect_maptype_info()
 
+ - Vect_maptype()
+
  - Vect_open_new()
 
  - Vect__open_old()



More information about the grass-commit mailing list