瀏覽代碼

vlib: Vect_maptype() added

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@39527 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 15 年之前
父節點
當前提交
d9fb7867f4
共有 3 個文件被更改,包括 19 次插入1 次删除
  1. 1 0
      include/vector.h
  2. 16 1
      lib/vector/Vlib/open.c
  3. 2 0
      lib/vector/vectorlib.dox

+ 1 - 0
include/vector.h

@@ -433,6 +433,7 @@ void Vect__init_head(struct Map_info *);
 /* 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);

+ 16 - 1
lib/vector/Vlib/open.c

@@ -764,13 +764,28 @@ const char *Vect_maptype_info(const struct Map_info *Map)
 	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')

+ 2 - 0
lib/vector/vectorlib.dox

@@ -2238,6 +2238,8 @@ programming. The programmer should use only routines with this prefix.
 
  - Vect_maptype_info()
 
+ - Vect_maptype()
+
  - Vect_open_new()
 
  - Vect__open_old()