vectorlib.dox 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584
  1. /*! \page vectorlib GRASS Vector Library
  2. by GRASS Development Team (http://grass.osgeo.org)
  3. <h2>Table of contents</h2>
  4. Specifications:
  5. - \subpage background
  6. - \subpage intro
  7. - \subpage libraries
  8. - \subpage vlib_topology_management
  9. - \subpage vlib_spidx
  10. - \subpage vlib_categories_layers
  11. - \subpage vlib_attributes
  12. - \subpage vlibtin
  13. - \subpage grassdglib
  14. - \subpage vlibascii
  15. - \subpage vectmodulesoper
  16. \subpage vlibfunc
  17. - \subpage area
  18. - \subpage array
  19. - \subpage box
  20. - \subpage break_lines
  21. - \subpage break_polygons
  22. - \subpage bridges
  23. - \subpage buffer
  24. - \subpage build
  25. - \subpage build_nat
  26. - \subpage build_ogr
  27. - \subpage cats
  28. - \subpage cindex
  29. - \subpage clean_nodes
  30. - \subpage close
  31. - \subpage constraint
  32. - \subpage dangles
  33. - \subpage dbcolumns
  34. - \subpage error
  35. - \subpage field
  36. - \subpage find
  37. - \subpage graph
  38. - \subpage header
  39. - \subpage hist
  40. - \subpage init_head
  41. - \subpage intersect
  42. - \subpage legal_vname
  43. - \subpage level
  44. - \subpage level_two
  45. - \subpage line
  46. - \subpage list
  47. - \subpage map
  48. - \subpage net
  49. - \subpage open
  50. - \subpage overlay
  51. - \subpage vpoly
  52. - \subpage read
  53. - \subpage remove_areas
  54. - \subpage remove_duplicates
  55. - \subpage rewind
  56. - \subpage select
  57. - \subpage sindex
  58. - \subpage snap
  59. - \subpage tin
  60. - \subpage type
  61. - \subpage delete
  62. - \subpage write
  63. \subpage contacts
  64. \subpage references
  65. \subpage seealso
  66. \section background Background
  67. Generally, the vector data model is used to describe geographic
  68. phenomena which may be represented by geometric entities like points,
  69. lines, and areas. The GRASS vector data model includes the description
  70. of topology, where besides the coordinates describing the location of
  71. the primitives (points, lines, boundaries, centroids, faces, and
  72. kernels), their spatial relations are also stored. In general,
  73. topological GIS require a data structure where the common boundary
  74. between two adjacent areas is stored as a single line, simplifying the
  75. map maintenance.
  76. \section intro Introduction
  77. The GRASS 6/7 vector format is very similar to old GRASS 4.x (5.0/5.3)
  78. vector format.
  79. This description covers the new GRASS 6 vector library architecture.
  80. This new architecture overcomes the vector limitations of GRASS
  81. 4.x-5.4.x by extending the vector support with attributes stored in
  82. external relational databases, and by new 3D capabilities. Besides
  83. internal file based storage the geometry may alternatively be stored
  84. in a PostGIS database. This enables users to maintain large data sets
  85. with simultaneous write access. External GIS formats such as
  86. SHAPE-files may be used directly, without requiring format conversion.
  87. The current implementation includes:
  88. - multi-layer: features in one vector map may represent more layers and
  89. may be linked to more external tables (see \ref vlib_categories_layers);
  90. - 2D and 3D vector geometry with full topology support for 2D and partial topology support for 3D (see \ref vlib_topology_management);
  91. - multi-format: external data formats supported (SHAPE-file, OGR sources etc.);
  92. - portability: platform independent internal format, read- and writable on 32bit,
  93. 64bit etc. computer architectures;
  94. - integrated \ref dglib: support for vector network analysis;
  95. - spatial index: based on R-tree method for fast vector geometry access (see \ref vlib_spidx).
  96. - multi-attribute: attributes saved in external Relational Database Management
  97. System (RDBMS) connected through DBMI library and drivers (\ref vlib_attributes);
  98. GRASS vector maps are stored in an arc-node representation, consisting
  99. of curves called arcs. An arc is stored as a series of x,y,z
  100. coordinate pairs. The two endpoints of an arc are called nodes. Two
  101. consecutive x,y,z pairs define an arc segment. The user specifies the
  102. type of input to GRASS; GRASS doesn't decide. GRASS allows for the
  103. line definition which allows for multiple types to co-exist in the
  104. same map. Centroid are assigned to area it is within/inside
  105. (geometrically). An area is identified by an x,y,z centroid point
  106. geometrically inside with a category number (ID). This identifies the
  107. area. Such centroids are stored in the same binary 'coor' file with
  108. other primitives. Each element may have none, one or more categories
  109. (cats). More cats are distinguished by field number (field, called
  110. "layer" at user level). Single and multi-category support on modules
  111. level are implemented. Z-coordinate is optional and both 2D and 3D
  112. files may be written.
  113. The following vector objects are defined:
  114. - point: a point;
  115. - line: a directed sequence of connected vertices with two endpoints called nodes;
  116. - boundary: the border line to describe an area;
  117. - centroid: a point within a closed boundary;
  118. - area: the topological composition of centroid and boundary;
  119. - face: a 3D area;
  120. - kernel: a 3D centroid in a volume;
  121. - volume: a 3D corpus, the topological composition of faces and kernel.
  122. Note that all lines and boundaries can be polylines (with nodes in
  123. between).
  124. Topology also holds information about isles. Isles are located within an area, not
  125. touching the boundaries of the outer area. Isles consist of one or more areas
  126. and are used internally by the vector libraries to maintain correct topology of areas.
  127. \section libraries Vector libraries
  128. Besides internal library functions there are two main libraries:
  129. - Vlib (Vector library), see \ref vlib
  130. - DGLib (Directed Graph Library), see \ref dglib
  131. For historical reasons, there are two internal libraries for vector:
  132. - diglib (with dig_*() functions), GRASS 3.x/4.x
  133. - Vlib (with V1_*(), V2_*() and Vect_*() functions), GRASS 4.x/5.x (except for the 5.7 interim version)
  134. The vector library was introduced in GRASS 4.0 to hide internal vector
  135. files' formats and structures. In GRASS 6/7, everything is accessed via
  136. Vect_*() functions, for example:
  137. Old 4.x code:
  138. \code
  139. xx = Map.Att[Map.Area[area_num].att].x;
  140. \endcode
  141. New 6.x/7.x functions:
  142. \code
  143. Vect_get_area_centroid();
  144. Vect_get_centroid_coor();
  145. \endcode
  146. In GRASS 6/7, all internal, mostly non-topological vector functions are
  147. hidden from the modules' API (mainly dig_*(), V1_*() and V2_*()
  148. functions). All available Vect_*() functions are topological vector
  149. functions.
  150. \subsection vlib Introduction to Vlib (Vector library)
  151. <i>Note: For details please read Blazek et al. 2002 (see below) as well as the
  152. references in this document.</i>
  153. \subsubsection Directory_structure Directory structure
  154. Directory structure and file names are changed with respect to
  155. previous GRASS versions. All vector files for one vector map are
  156. stored in one directory:<br>
  157. <b>$MAPSET/vector/vector_name/</b>
  158. This directory contains these files:
  159. - <b>coor</b> - binary file, coordinates [former dig/ file]
  160. - <b>topo</b> - binary file, topology [former dig_plus/ file]
  161. - <b>cidx</b> - binary file, category index
  162. - <b>head</b> - text file, header information [former part of dig/ file]
  163. - <b>dbln</b> - text file, link(s) to attribute table(s)
  164. - <b>hist</b> - text file, vector map change history
  165. \subsubsection coor_file_format_specification Coor file format specification
  166. -# In the coor file the following is stored: 'line' (element) type,
  167. number of attributes and layer number for each category.
  168. -# Coordinates in binary file are stored as double (8 bytes).
  169. <b>Head</b>
  170. <table border="1" style="border-collapse: collapse">
  171. <tr><td>Name</td><td>Type</td><td>Number</td><td>Description</td></tr>
  172. <tr><td>Version_Major </td><td>C</td><td>1</td><td>file version (major)</td></tr>
  173. <tr><td>Version_Minor </td><td>C</td><td>1</td><td>file version (minor)</td></tr>
  174. <tr><td>Back_Major</td><td>C</td><td>1</td><td>supported from GRASS version (major)</td></tr>
  175. <tr><td>Back_Minor</td><td>C</td><td>1</td><td>supported from GRASS version (minor)</td></tr>
  176. <tr><td>byte_order</td><td>C</td><td>1</td><td>little or big endian
  177. flag; files are written in machine native order but
  178. files in both little and big endian order may be
  179. read; zero for little endian</td></tr>
  180. <tr><td>size</td><td>L</td><td>1</td><td>coor file size</td></tr>
  181. <tr><td>with_z</td><td>C</td><td>1</td><td>2D or 3D flag; zero for 2D</td></tr>
  182. <tr><td>reserved</td><td>C</td><td>10</td><td>not used</td></tr>
  183. </table>
  184. <b>Body</b>
  185. The body consists of line records:
  186. <table border="1" style="border-collapse: collapse">
  187. <tr><td>Name</td><td>Type</td><td>Number</td><td>Description</td></tr>
  188. <tr><td>record header</td><td>C</td><td>1</td><td>
  189. <UL>
  190. <LI><B>0. bit</B> : 1 - alive, 0 - dead line
  191. <LI><B>1. bit</B> : 1 - categories, 0 - no categories
  192. <LI><B>2.-3. bit</B> : type - one of: GV_POINT, GV_LINE,
  193. GV_BOUNDARY, GV_CENTROID
  194. <LI><B>4.-7. bit</B> : reserved, not used
  195. </UL>
  196. </td></tr>
  197. <tr><td>ncats</td><td>I</td><td>1</td><td>number of categories
  198. (written only if categories exist) </td></tr>
  199. <tr><td>field</td><td>I</td><td>ncats</td><td>field identifier,
  200. distinguishes between more categories append to one feature (written
  201. only if categories exist; field is called "layer" at user
  202. level)</td></tr>
  203. <tr><td>cat</td><td>I</td><td>ncats</td><td>category value (written
  204. only if categories exist)</td></tr>
  205. <tr><td>ncoor</td><td>I</td><td>1</td><td>written for GV_LINES and GV_BOUNDARIES
  206. only</td></tr>
  207. <tr><td>x</td><td>D</td><td>ncoor</td><td>x coordinate</td></tr>
  208. <tr><td>y</td><td>D</td><td>ncoor</td><td>y coordinate</td></tr>
  209. <tr><td>z</td><td>D</td><td>ncoor</td><td>z coordinate; present if
  210. with_z in head is set to 1</td></tr> </table>
  211. <B>Types used in coor file</B>
  212. <table border="1" style="border-collapse: collapse">
  213. <tr><td>Type</td><td>Name</td><td>Size in Bytes</td></tr>
  214. <tr><td>D</td><td>Double</td><td>8</td></tr>
  215. <tr><td>L</td><td>Long </td><td>4</td></tr>
  216. <tr><td>I</td><td>Int </td><td>4</td></tr>
  217. <tr><td>S</td><td>Short </td><td>4</td></tr>
  218. <tr><td>C</td><td>Char </td><td>1</td></tr>
  219. </table>
  220. \subsubsection head_file_format Head file format
  221. The file is an unordered list of key/value entries. The <i>key</i>
  222. is a string separated from <i>value</i> by a colon and optional
  223. whitespace. Key words are:<br>
  224. \verbatim
  225. ORGANIZATION
  226. DIGIT DATE
  227. DIGIT NAME
  228. MAP NAME
  229. MAP DATE
  230. MAP SCALE
  231. OTHER INFO
  232. ZONE
  233. MAP THRESH
  234. \endverbatim
  235. \section vlib_topology_management Vector library topology management
  236. Topology general characteristics:
  237. - geometry and attributes are stored separately
  238. (don't read both if it is not necessary (usually it is not))</li>
  239. - the format is topological (areas build from boundaries)</li>
  240. - currently only 2D topology is supported
  241. Topology is written for native format while pseudo-topology is written
  242. for OGR sources, SHAPE-link.
  243. \subsection topo_file_format Topo file format
  244. <b>Head</b>
  245. <table border="1" style="border-collapse: collapse">
  246. <tr><td>Name</td><td>Type</td><td>Number</td><td>Description</td></tr>
  247. <tr><td>Version_Major </td><td>C</td><td>1</td><td>file version (major)</td></tr>
  248. <tr><td>Version_Minor </td><td>C</td><td>1</td><td>file version (minor)</td></tr>
  249. <tr><td>Back_Major</td><td>C</td><td>1</td><td>supported from GRASS version (major)</td></tr>
  250. <tr><td>Back_Minor</td><td>C</td><td>1</td><td>supported from GRASS version (minor)</td></tr>
  251. <tr><td>byte_order</td><td>C</td><td>1</td><td>little or big endian
  252. flag; files are written in machine native order but
  253. files in both little and big endian order may be
  254. readl; zero for little endian</td></tr>
  255. <tr><td>head_size</td><td>L</td><td>1</td><td>header size</td></tr>
  256. <tr><td>with_z</td><td>C</td><td>1</td><td>2D or 3D flag; zero for 2D</td></tr>
  257. <tr><td>box</td><td>D</td><td>6</td><td>Bounding box coordinates (N,S,E,W,T,B)</td></tr>
  258. <tr><td>n_nodes, n_lines, etc.</td><td>I</td><td>7</td><td>Number of
  259. nodes, edges, lines, areas, isles, volumes and holes</td></tr>
  260. <tr><td>n_plines, n_llines, etc.</td><td>I</td><td>7</td><td>Number of
  261. points, lines, boundaries, centroids, faces and kernels</td></tr>
  262. <tr><td>Node_offset, Edge_offset,
  263. etc.</td><td>L</td><td>7</td><td>Offset value for nodes, edges, lines,
  264. areas, isles, volumes and holes</td></tr>
  265. <tr><td>coor_size</td><td>L</td><td>1</td><td>File size</td></tr>
  266. </table>
  267. <b>Body</b>
  268. For each node (n_nodes):
  269. <table border="1" style="border-collapse: collapse">
  270. <tr><td>Name</td><td>Type</td><td>Number</td><td>Description</td></tr>
  271. <tr><td>n_lines</td><td>I</td><td>1</td><td>Number of lines (0 for dead node)</td></tr>
  272. <tr><td>lines</td><td>I</td><td>n_lines</td><td>Line ids</td></tr>
  273. <tr><td>angles</td><td>D</td><td>n_lines</td><td>Angle value</td></tr>
  274. <tr><td>n_edges</td><td>I</td><td>1</td><td>Reserved for edges (only for with_z)</td></tr>
  275. <tr><td>x,y</td><td>D</td><td>2</td><td>Coordinate pair</td></tr>
  276. <tr><td>z</td><td>D</td><td>1</td><td>Only for with_z</td></tr>
  277. </table>
  278. For each line (n_lines):
  279. <table border="1" style="border-collapse: collapse">
  280. <tr><td>Name</td><td>Type</td><td>Number</td><td>Description</td></tr>
  281. <tr><td>feature type</td><td>C</td><td>1</td><td>0 for dead</td></tr>
  282. <tr><td>offset</td><td>L</td><td>1</td><td>Line offset</td></tr>
  283. <tr><td>N1</td><td>I</td><td>1</td><td>First node id (only if feature type is GV_POINTS, GV_LINES or GV_KERNEL)</td></tr>
  284. <tr><td>N2</td><td>I</td><td>1</td><td>Second node id (only if feature type is GV_LINE or GV_BOUNDARY)</td></tr>
  285. <tr><td>left</td><td>I</td><td>1</td><td>Left area id for feature type GV_BOUNDARY / Area id for feature type GV_CENTROID</td></tr>
  286. <tr><td>right</td><td>I</td><td>1</td><td>Right area id (for feature type GV_BOUNDARY)</td></tr>
  287. <tr><td>vol</td><td>I</td><td>1</td><td>Reserved for kernel (volume number, for feature type GV_KERNEL)</td></tr>
  288. <tr><td>N,S,E,W</td><td>D</td><td>4</td><td>Line bounding box (for feature type GV_LINE, GV_BOUNDARY or GV_FACE)</td></tr>
  289. <tr><td>T,B</td><td>D</td><td>2</td><td>Line bounding box for 3D (only if with_z=1)</td></tr>
  290. </table>
  291. For each area (n_areas):
  292. <table border="1" style="border-collapse: collapse">
  293. <tr><td>Name</td><td>Type</td><td>Number</td><td>Description</td></tr>
  294. <tr><td>n_lines</td><td>I</td><td>1</td><td>number of boundaries</td></tr>
  295. <tr><td>lines</td><td>I</td><td>n_lines</td><td>Line ids</td></tr>
  296. <tr><td>n_isles</td><td>I</td><td>1</td><td>Number of isles</td></tr>
  297. <tr><td>isles</td><td>I</td><td>n_isles</td><td>Isle ids</td></tr>
  298. <tr><td>centroid</td><td>I</td><td>1</td><td>Centroid id</td></tr>
  299. <tr><td>N,S,E,W</td><td>D</td><td>4</td><td>Area bounding box</td></tr>
  300. <tr><td>T,B</td><td>D</td><td>2</td><td>Area bounding box for 3D (only if with_z=1)</td></tr>
  301. </table>
  302. For each isle (n_isle):
  303. <table border="1" style="border-collapse: collapse">
  304. <tr><td>Name</td><td>Type</td><td>Number</td><td>Description</td></tr>
  305. <tr><td>n_lines</td><td>I</td><td>1</td><td>number of boundaries</td></tr>
  306. <tr><td>lines</td><td>I</td><td>n_lines</td><td>Line ids</td></tr>
  307. <tr><td>area</td><td>I</td><td>1</td><td>Outer area id</td></tr>
  308. <tr><td>N,S,E,W</td><td>D</td><td>4</td><td>Isle bounding box</td></tr>
  309. <tr><td>T,B</td><td>D</td><td>2</td><td>Isle bounding box for 3D (only if with_z=1)</td></tr>
  310. </table>
  311. <b>Feature types:</b>
  312. \code
  313. /* Vector types used in memory on run time - may change */
  314. #define GV_POINT 0x01
  315. #define GV_LINE 0x02
  316. #define GV_BOUNDARY 0x04
  317. #define GV_CENTROID 0x08
  318. #define GV_FACE 0x10
  319. #define GV_KERNEL 0x20
  320. #define GV_AREA 0x40
  321. #define GV_VOLUME 0x80
  322. \endcode
  323. \code
  324. #define GV_POINTS (GV_POINT | GV_CENTROID )
  325. #define GV_LINES (GV_LINE | GV_BOUNDARY )
  326. \endcode
  327. Face and kernel are 3D equivalents of boundary and centroid, but there
  328. is no support (yet) for 3D topology (volumes). Faces are used in a
  329. couple of modules including NVIZ to visualize 3D buildings and other
  330. volumetric figures.
  331. \code
  332. /* Topology level details */
  333. #define GV_BUILD_NONE 0
  334. #define GV_BUILD_BASE 1
  335. #define GV_BUILD_AREAS 2
  336. #define GV_BUILD_ATTACH_ISLES 3 /* Attach islands to areas */
  337. #define GV_BUILD_CENTROIDS 4 /* Assign centroids to areas */
  338. #define GV_BUILD_ALL GV_BUILD_CENTROIDS
  339. \endcode
  340. GV_BOUNDARY contains geometry and it is used to build areas.
  341. GV_LINE cannot form an area.
  342. \code
  343. struct line_cats
  344. {
  345. int *field; /* pointer to array of fields a.k.a. layer*/
  346. int *cat; /* pointer to array of categories */
  347. int n_cats; /* number of vector categories attached to element */
  348. int alloc_cats; /* allocated space */
  349. };
  350. \endcode
  351. \subsection Topology_Example_1 Topology Example 1:
  352. A polygon may be formed by many boundaries (more primitives but connected).
  353. One boundary is shared by adjacent areas.
  354. \verbatim
  355. +--1--+--5--+
  356. | | |
  357. 2 A 4 B 6
  358. | | |
  359. +--3--+--7--+
  360. 1,2,3,4,5,6,7 = 7 boundaries (primitives)
  361. A,B = 2 areas
  362. \endverbatim
  363. \subsection Topology_Example_2 Topology Example 2:
  364. This is handled correctly in GRASS: A can be filled, B filled differently.
  365. \verbatim
  366. +---------+
  367. | A |
  368. +-----+ |
  369. | B | |
  370. +-----+ |
  371. | |
  372. +---------+
  373. \endverbatim
  374. In GRASS, whenever an 'inner' ring touches the boundary of an outside area, even in
  375. one point, it is no longer an 'inner' ring (Isle in GRASS topology), it is
  376. simply another area. A, B above can never be exported from GRASS as polygon A
  377. with inner ring B because there are only 2 areas A and B and no island.
  378. \subsection Topology_Example_3 Topology Example 3:
  379. This is handled correctly in GRASS: Areas A1, A2, and A3 can be filled differently.
  380. \verbatim
  381. +---------------------+
  382. | A1 |
  383. + +------+------+ |
  384. | | A2 | A3 | |
  385. + +------+------+ |
  386. | I1 |
  387. +---------------------+
  388. \endverbatim
  389. In GRASS, whenever an 'inner' ring does not touch the boundary of an outside area,
  390. also not in one point, it is an 'inner' ring (Isle). The areas A2 and A3 form a
  391. single Isle I1 located within area A1. The size of Isle I1 is substracted from
  392. the size of Area A1 when calculating the size of Area A1. Any centroids falling
  393. into Isle I1 are excluded when searching for a centroid that can be attached to
  394. Area A1. A1 above can be exported from GRASS as polygon A1 with inner ring I1.
  395. \subsection Topology_Example_4 Topology Example 4:
  396. v.in.ogr/v.clean can identify dangles and change the type from boundary
  397. to line (in TIGER data for example).
  398. Distinction between line and boundary isn't important only for dangles. Example:
  399. \verbatim
  400. +-----+-----+
  401. | . |
  402. | . |
  403. +.....+.....+
  404. | . |
  405. | x . |
  406. +-----+-----+
  407. ---- road + boundary of one parcel => type boundary
  408. .... road => type line
  409. x parcel centroid (identifies whole area)
  410. \endverbatim
  411. Because lines are not used to build areas, we have only one area/centroid,
  412. instead of 4 which would be necessary in TIGER.
  413. \subsection vlib_topo_memory Topology memory management
  414. Topology is generated for all kinds of vector types. Memory is not
  415. released by default. The programmer can force the library to release
  416. the memory by using Vect_set_release_support(). But: The programmer
  417. cannot run Vect_set_release_support() in mid process because all
  418. vectors are needed in the spatial index, which is needed to build topology.
  419. Topology is also necessary for points in case of a vector network
  420. because the graph is built using topology information about lines
  421. and points.
  422. The topology structure does not only store the topology but also
  423. the 'line' bounding box and line offset in coor file (index).
  424. The existing spatial index is using line ID in 'topology' structure
  425. to identify lines in 'coor' file. Currently it is not possible to build
  426. spatial index without topology.
  427. \section vlib_spidx Vector library spatial index management
  428. Spatial index (based on R-tree) is generated on the fly.
  429. Spatial index occupies a lot of memory but it is necessary for
  430. topology building. Also, it takes a long time to release the memory
  431. occupied by spatial index (dig_spidx_free()).
  432. The function building topology (Vect_build()) is usually called
  433. at the end of modules (before Vect_close()) so it is faster to call
  434. exit() and operating system releases all the memory much faster.
  435. By default the memory is not released.
  436. It is possible to call Vect_set_release_support() before Vect_close()
  437. to enforce memory release, but it takes a long time on large files.
  438. Currently most of the modules do not release the memory occupied for
  439. spatial index and work like this (pseudocode):
  440. \code
  441. int main
  442. {
  443. Vect_open_new();
  444. //writing new vector
  445. Vect_build();
  446. Vect_close(); // memory is not released
  447. }
  448. \endcode
  449. In general it is possible to free the memory with Vect_set_release_support()
  450. such as:
  451. \code
  452. int main
  453. {
  454. Vect_open_new();
  455. // writing new vector
  456. Vect_build();
  457. Vect_set_release_support();
  458. Vect_close(); // memory is released
  459. }
  460. \endcode
  461. but it takes longer.
  462. <P>
  463. It make sense to release the spatial index if it is used only at the beginning
  464. of a module or in permanently running programs like QGIS.
  465. For example:
  466. \code
  467. int main
  468. {
  469. Vect_open_old();
  470. // select features using spatial index, e.g. Vect_select_lines_by_box()
  471. Vect_set_release_support();
  472. Vect_close(); // memory is released
  473. // do some processing which needs memory
  474. }
  475. \endcode
  476. \section vlib_categories_layers Vector library categories and layers
  477. <i>Note: "layer" was called "field" in earlier version.</i>
  478. In GRASS, a "category" or "category number" is a vector feature ID
  479. used to link geometry to attributes which are stored in one or several
  480. (external) database table(s). This category number is stored into the
  481. vector geometry as well as a "cat" column (integer type) in each
  482. attribute database table. The category number is used to lookup an
  483. attribute assigned to a vector object. At user level, category numbers
  484. can be assigned to vector objects with the v.category command.
  485. In order to assign multiple attributes in different tables to vector
  486. objects, each map can hold multiple category numbers. This is achieved
  487. by assigning more than one "layer" to the map (v.db.connect
  488. command). The layer number determines which table to be used for
  489. attribute queries. For example, a cadastrial vector area map can be
  490. assigned on layer 1 to an attribute table containing landuse
  491. descriptions which are maintained by department A while layer 2 is
  492. assigned to an attribute table containing owner descriptions which are
  493. maintained by department B.
  494. Each vector feature inside a vector map has zero, one or more
  495. &lt;layer,category&gt; tuple(s). A user can (but not must) create
  496. attribute tables which are referenced by the layer, and rows which are
  497. essentially referenced by the &lt;layer,category&gt; pair. <P>
  498. Categories start with 1. Categories do not have to be continuous.
  499. \section vlib_cidx Vector library category index
  500. The category index (stored in the cidx file) improves the performance of all
  501. selections by cats/attributes (SQL, e.g. 'd.vect cats=27591', 'v.extract list=20000-21000').
  502. This avoids that all selections have to be made by looping through all vector lines.
  503. Category index is also essential for simple feature representation of GRASS vectors.
  504. Category index is created for each field. In memory, it is stored in
  505. \code
  506. struct Cat_index {
  507. int field; /* field number a.k.a. layer*/
  508. int n_cats; /* number of items in cat array */
  509. int a_cats; /* allocated space in cat array */
  510. int (*cat)[3]; /* array of cats (cat,type, lines/area) */
  511. int n_ucats; /* number of unique cats (not updated) */
  512. int n_types; /* number of types in type */
  513. int type[7][2];/* number of elements for each type (point, line, boundary, centroid, area, face, kernel) */
  514. long offset; /* offset of the beginning of this index in cidx file */
  515. };
  516. \endcode
  517. Category index is built with topology, but it is <b>not updated</b> if vector is edited on level 2.
  518. Category index is stored in 'cidx' file, 'cat' array is written/read by one call of
  519. dig__fwrite_port_I( (int *)ci->cat, 3 * ci->n_cats, fp) or
  520. dig__fread_port_I( (int *)ci->cat, 3 * ci->n_cats, fp).
  521. Stored values can be retrieved either by index in 'cat' array
  522. (if all features of given field are required) or by category value
  523. (one or few features), always by Vect_cidx_*() functions.
  524. To create category index, it will be necessary to rebuild topology for all existing vectors.
  525. This is an opportunity to make (hopefully) last changes in 'topo', 'cidx' formats.
  526. \section vlibtin Vector TINs
  527. TINs are simply created as 2D/3D vector polygons consisting of
  528. 3 vertices. See Vect_tin_get_z().
  529. \section vlib_attributes Vector library and attributes
  530. The old GRASS 4.x 'dig_cats' files are not used any more and vectors'
  531. attributes are stored in external database. Connection with the
  532. database is done through drivers based on DBMI library (DBF, SQLite,
  533. PostgreSQL, MySQL and ODBC drivers are available at this
  534. time). Records in a table are linked to vector entities by layer and
  535. category number. The layer identifies table and the category
  536. identifies record. I.e., for any unique combination
  537. map+mapset+layer+category, there exists one unique combination
  538. driver+database+table+row.
  539. The general DBMI settings are defined in the "MAPSET/VAR" text file
  540. (maintained with db.connect command at user level).
  541. Each vector maps has its own DBMI settings stored in the
  542. "MAPSET/vector/vector_name/dbln" text file. For each pair <B>map +
  543. layer</B>, all of <B>table, key column, database, driver</B> must be
  544. defined in a new row. This definition must be written to
  545. "MAPSET/vector/vector_name/dbln" text file. Each row in the "dbln"
  546. file contains names separated by spaces in following order ([] -
  547. optional): <BR><BR>
  548. \verbatim
  549. map[@mapset] layer table [key [database [driver]]]
  550. \endverbatim
  551. If key, database or driver are omitted (on second and higher row only)
  552. the last definition is used. When reading a vector map from another
  553. mapset (if mapset is specified along with map name), definitions in
  554. the related "dbln" file may overwrite the DBMI definition in the
  555. current mapset. This means that the map-wise definition is always
  556. "stronger".
  557. Wild cards <B>*</B> and <B>?</B> may be used in map and mapset names.
  558. Variables <B>$GISDBASE, $LOCATION_NAME, $MAPSET, $MAP</B> may be used
  559. in table, key, database and driver names (function
  560. Vect_subst_var()). Note that $MAPSET is not the current mapset but
  561. mapset of the map the rule is defined for.
  562. Note that vector features in GRASS vector maps may have attributes
  563. in different tables or may be without attributes. Boundaries
  564. form areas but it may happen that some boundaries are not closed
  565. (such boundaries would not appear in polygon layer).
  566. Boundaries may have attributes. All types may be mixed in one vector map.
  567. The link to the table is permanent and it is stored in 'dbln' file
  568. in vector directory. Tables are considered to be a part of the vector
  569. and the command g.remove, for example, deletes linked tables of the vector.
  570. Attributes must be joined with geometry.
  571. <B>Examples:</B>
  572. Examples are written mostly for the DBF driver, where database is full path to
  573. the directory with dbf files and table name is the name of dbf file without
  574. .dbf extension:
  575. \verbatim
  576. * 1 mytable id $GISDBASE/$LOCATION_NAME/$MAPSET/vector/$MAP dbf
  577. \endverbatim
  578. This definition says that entities with category of layer 1 are linked
  579. to dbf tables with names "mytable.dbf" saved in vector directories of
  580. each map. The attribute column containing the category numbers is
  581. called "id".
  582. \verbatim
  583. * 1 $MAP id $GISDBASE/$LOCATION_NAME/$MAPSET/dbf dbf
  584. \endverbatim
  585. Similar as above but all dbf files are in one directory dbf/ in mapset
  586. and names of dbf files are $MAP.dbf
  587. \verbatim
  588. water* 1 rivers id /home/grass/dbf dbf
  589. water* 2 lakes lakeid /home/guser/mydb
  590. trans* 1 roads key basedb odbc
  591. trans* 5 rails
  592. \endverbatim
  593. These definitions define more layers (called "field" in the API) for one map
  594. i.e. in one map may be more features linked to more tables. Definitions on
  595. first 2 rows are applied for example on maps water1, water2, ... so that more
  596. maps may share one table.<BR><BR>
  597. \verbatim
  598. water@PERMANENT 1 myrivers id /home/guser/mydbf dbf
  599. \endverbatim
  600. This definion overwrites the definition saved in PERMANENT/VAR and
  601. links the water map from PERMANENT mapset to the user's table.
  602. Modules should be written so that connections to databases for each
  603. vector layer are independent. It should be possible to read attributes
  604. of an input map from one database and write to some other and even with
  605. some other driver (should not be a problem).
  606. There are open questions, however. For one, how does one distinguish when
  607. new tables should be written and when not? For example, definitions:<BR>
  608. \verbatim
  609. river 1 river id water odbc
  610. river.backup* 1 NONE
  611. \endverbatim
  612. could be used to say that tables should not be copied for backups of
  613. map river because table is stored in a reliable RDBMS.
  614. \section grassdglib DGLib (Directed Graph Library)
  615. The Directed Graph Library or DGLib (Micarelli 2002, \ref dglib ,
  616. http://grass.osgeo.org/dglib/) provides functionality for vector network
  617. analysis. This library released under GPL is hosted by the GRASS
  618. project (within the GRASS source code). As a stand-alone library it
  619. may also be used by other software projects.
  620. The Directed Graph Library library provides functionality to assign costs to
  621. lines and/or nodes. That means that costs can be accumulated while traveling
  622. along polylines. The user can assign individual costs to all lines and/or
  623. nodes of a vector map and later calculate shortest path connections based on
  624. the accumulated costs. Applications are transport analysis, connectivity and
  625. more. Implemented applications cover Shortest path, Traveling salesman (round trip),
  626. Allocation of sources (creation of subnetworks), Minimum Steiner trees
  627. (star-like connections), and iso-distances (from centers).
  628. For details, please read Blazek et al. 2002 (see below).
  629. Related vector functions are:
  630. Vect_graph_add_edge(),
  631. Vect_graph_init(),
  632. Vect_graph_set_node_costs(),
  633. Vect_graph_shortest_path(),
  634. Vect_net_build_graph(),
  635. Vect_net_nearest_nodes(),
  636. Vect_net_shortest_path(), and
  637. Vect_net_shortest_path_coor().
  638. \section vlibascii Vector ASCII Format Specifications
  639. The ASCII format is (currently) explained in the
  640. manual page of v.in.ascii, which is defined in the file:
  641. vector/v.in.ascii/description.html
  642. \section vectmodules Vector modules and their parameters/flags
  643. See also grass5/documents/parameter_proposal.txt
  644. <I>A module is a GRASS command invoked by the user.</I>
  645. \subsection vectmodulesoper Modules operation
  646. Each module which modifies and writes data must read from input= and
  647. write to output= so that data may not be lost. For example v.spag
  648. works on map= at in grass5.0 but if program (system) crashes or threshold was
  649. specified incorrectly and vector was not backuped, data were lost.
  650. In this case map= option should be replaced by input= and output=
  651. Topology is always built by default if the coor file was modified.
  652. Dimensionality is generally kept. Input 2D vector is written as 2D, 3D as 3D.
  653. There are a few modules which change the dimension on purpose.
  654. \subsection vectmodulesopt Modules parameters/flags
  655. <B>-b</B> do not build topo file; by default topo file is written <BR>
  656. <B>-t</B> create new table, default<BR>
  657. <B>-u</B> don't create new table<BR>
  658. <B>-z</B> write 3D vector map (if input was 2D) <BR>
  659. <BR>
  660. <B>map=</B> input vector map for modules without output <BR>
  661. <B>input=</B> input vector map <BR>
  662. <B>output=</B> output vector map <BR>
  663. <B>type=</B> type of elements: point,line,boundary,centroid,area <BR>
  664. <B>cat=</B> category or category list (example: 1,5,9-13,35) <BR>
  665. <B>layer=</B> layer number <BR>
  666. <B>where=</B> condition of SQL statement for selection of records <BR>
  667. <B>column=</B> column name (in external table)
  668. \section vlibfunc List of vector library functions
  669. The Vect_*() functions are the programmer's API for GRASS vector
  670. programming.
  671. \section area Vector area functions
  672. - Vect_get_area_area()
  673. - Vect_get_area_boundaries()
  674. - Vect_get_area_centroid()
  675. - Vect_get_area_isle()
  676. - Vect_get_area_num_isles()
  677. - Vect_area_perimeter()
  678. - Vect_get_area_points()
  679. - Vect_get_isle_area()
  680. - Vect_get_isle_boundaries()
  681. - Vect_get_isle_points()
  682. - Vect_point_in_area()
  683. \section array Vector array functions
  684. - Vect_new_varray()
  685. - Vect_set_varray_from_cat_list()
  686. - Vect_set_varray_from_cat_string()
  687. - Vect_set_varray_from_db()
  688. \section box Vector bounding box functions
  689. - Vect_box_copy()
  690. - Vect_box_clip()
  691. - Vect_box_extend()
  692. - Vect_box_overlap()
  693. - Vect_get_area_box()
  694. - Vect_get_isle_box()
  695. - Vect_get_line_box()
  696. - Vect_get_map_box()
  697. - Vect_point_in_box()
  698. - Vect_region_box()
  699. \section break_lines Vector break lines functions
  700. - Vect_break_lines()
  701. - Vect_break_lines_list()
  702. \section break_polygons Vector break polygons functions
  703. - Vect_break_polygons()
  704. \section bridges Vector bridges functions
  705. - Vect_chtype_bridges()
  706. - Vect_remove_bridges()
  707. \section buffer Vector buffer functions
  708. - Vect_line_buffer()
  709. - Vect_line_parallel()
  710. \section build Vector build functions
  711. - Vect_build()
  712. - Vect_build_partial()
  713. - Vect_get_built()
  714. - Vect_save_spatial_index()
  715. - Vect_save_topo()
  716. - Vect_spatial_index_dump()
  717. - Vect_topo_dump()
  718. \subsection build_nat Vector build (native) functions
  719. - Vect_attach_centroids()
  720. - Vect_attach_isle()
  721. - Vect_attach_isles()
  722. - Vect_build_line_area()
  723. - Vect_build_nat()
  724. - Vect_isle_find_area()
  725. \subsection build_ogr Vector build (OGR) functions
  726. - Vect_build_ogr()
  727. \section cats Vector categories functions
  728. - Vect_array_to_cat_list()
  729. - Vect_cat_del()
  730. - Vect_cat_get()
  731. - Vect_cat_in_array()
  732. - Vect_cat_in_cat_list()
  733. - Vect_cat_set()
  734. - Vect_destroy_cat_list()
  735. - Vect_destroy_cats_struct()
  736. - Vect_field_cat_del()
  737. - Vect_get_area_cats()
  738. - Vect_get_area_cat()
  739. - Vect_get_line_cat()
  740. - Vect_new_cat_list()
  741. - Vect_new_cats_struct()
  742. - Vect_reset_cats()
  743. - Vect_str_to_cat_list()
  744. \section cindex Vector category index functions
  745. (note: vector layer is historically called "field")
  746. - Vect_cidx_dump()
  747. - Vect_cidx_find_next()
  748. - Vect_cidx_find_all()
  749. - Vect_cidx_get_cat_by_index()
  750. - Vect_cidx_get_field_index()
  751. - Vect_cidx_get_field_number()
  752. - Vect_cidx_get_num_cats_by_index()
  753. - Vect_cidx_get_num_fields()
  754. - Vect_cidx_get_num_types_by_index()
  755. - Vect_cidx_get_num_unique_cats_by_index()
  756. - Vect_cidx_get_type_count()
  757. - Vect_cidx_get_type_count_by_index()
  758. - Vect_cidx_open()
  759. - Vect_cidx_save()
  760. - Vect_set_category_index_update()
  761. \section clean_nodes Vector clean nodes functions
  762. - Vect_clean_small_angles_at_nodes()
  763. \section close Vector close functions
  764. - Vect_close()
  765. \section constraint Vector constraint functions
  766. - Vect_get_constraint_box()
  767. - Vect_remove_constraints()
  768. - Vect_set_constraint_region()
  769. - Vect_set_constraint_type()
  770. \section dangles Vector dangles functions
  771. - Vect_chtype_dangles()
  772. - Vect_remove_dangles()
  773. - Vect_select_dangles()
  774. \section dbcolumns Vector dbcolumns functions
  775. - Vect_get_column_names()
  776. - Vect_get_column_names_types()
  777. - Vect_get_column_types()
  778. \section error Vector error functions
  779. - Vect_get_fatal_error()
  780. - Vect_set_fatal_error()
  781. \section field Vector field functions
  782. (note: vector layer is historically called "field")
  783. - Vect_add_dblink()
  784. - Vect_check_dblink()
  785. - Vect_default_field_info()
  786. - Vect_get_dblink()
  787. - Vect_get_field()
  788. - Vect_map_add_dblink()
  789. - Vect_map_check_dblink()
  790. - Vect_map_del_dblink()
  791. - Vect_new_dblinks_struct()
  792. - Vect_read_dblinks()
  793. - Vect_reset_dblinks()
  794. - Vect_set_db_updated()
  795. - Vect_subst_var()
  796. - Vect_write_dblinks()
  797. \section find Vector find functions
  798. - Vect_find_area()
  799. - Vect_find_island()
  800. - Vect_find_line()
  801. - Vect_find_line_list()
  802. - Vect_find_node()
  803. \section graph Vector graph functions
  804. - Vect_graph_add_edge()
  805. - Vect_graph_build()
  806. - Vect_graph_init()
  807. - Vect_graph_set_node_costs()
  808. - Vect_graph_shortest_path()
  809. \section header Vector header functions
  810. - Vect_get_comment()
  811. - Vect_get_constraint_box()
  812. - Vect_get_date()
  813. - Vect_get_full_name()
  814. - Vect_get_map_date()
  815. - Vect_get_map_name()
  816. - Vect_get_mapset()
  817. - Vect_get_name()
  818. - Vect_get_organization()
  819. - Vect_get_person()
  820. - Vect_get_proj()
  821. - Vect_get_proj_name()
  822. - Vect_get_scale()
  823. - Vect_get_thresh()
  824. - Vect_get_zone()
  825. - Vect_is_3d()
  826. - Vect_print_header()
  827. - Vect_read_header()
  828. - Vect_set_comment()
  829. - Vect_set_date()
  830. - Vect_set_map_date()
  831. - Vect_set_map_name()
  832. - Vect_set_organization()
  833. - Vect_set_person()
  834. - Vect_set_scale()
  835. - Vect_set_thresh()
  836. - Vect_set_zone()
  837. - Vect_write_header()
  838. \section hist Vector history functions
  839. - Vect_hist_command()
  840. - Vect_hist_copy()
  841. - Vect_hist_read()
  842. - Vect_hist_rewind()
  843. - Vect_hist_write()
  844. \section init_head Vector header functions
  845. - Vect_copy_head_data()
  846. \section intersect Vector intersection functions
  847. - Vect_line_check_intersection()
  848. - Vect_line_intersection()
  849. - Vect_segment_intersection()
  850. \section legal_vname Vector valid map name functions
  851. - Vect_check_input_output_name()
  852. - Vect_legal_filename()
  853. \section level Vector level functions
  854. - Vect_level()
  855. \section level_two Vector topological (level 2) functions
  856. - Vect_get_centroid_area()
  857. - Vect_get_line_areas()
  858. - Vect_get_line_nodes()
  859. - Vect_get_node_coor()
  860. - Vect_get_node_line()
  861. - Vect_get_node_line_angle()
  862. - Vect_get_node_n_lines()
  863. - Vect_get_num_areas()
  864. - Vect_get_num_dblinks()
  865. - Vect_get_num_faces()
  866. - Vect_get_num_islands()
  867. - Vect_get_num_lines()
  868. - Vect_get_num_nodes()
  869. - Vect_get_num_primitives()
  870. - Vect_get_num_updated_lines()
  871. - Vect_get_num_updated_nodes()
  872. - Vect_get_updated_line()
  873. - Vect_get_updated_node()
  874. - Vect_set_release_support()
  875. \section line Vector feature functions
  876. - Vect_append_point()
  877. - Vect_append_points()
  878. - Vect_copy_pnts_to_xyz()
  879. - Vect_copy_xyz_to_pnts()
  880. - Vect_destroy_line_struct()
  881. - Vect_line_box()
  882. - Vect_line_delete_point()
  883. - Vect_line_distance()
  884. - Vect_line_geodesic_length()
  885. - Vect_line_insert_point()
  886. - Vect_line_length()
  887. - Vect_line_prune()
  888. - Vect_line_prune_thresh()
  889. - Vect_line_reverse()
  890. - Vect_line_segment()
  891. - Vect_new_line_struct()
  892. - Vect_point_on_line()
  893. - Vect_points_distance()
  894. - Vect_reset_line()
  895. \section list Vector list functions
  896. - Vect_destroy_list()
  897. - Vect_list_append()
  898. - Vect_list_append_list()
  899. - Vect_list_delete()
  900. - Vect_list_delete_list()
  901. - Vect_new_list()
  902. - Vect_reset_list()
  903. - Vect_val_in_list()
  904. \section map Vector map functions
  905. - Vect_copy()
  906. - Vect_copy_map_lines()
  907. - Vect_copy_table()
  908. - Vect_copy_table_by_cats()
  909. - Vect_copy_tables()
  910. - Vect_delete()
  911. - Vect_rename()
  912. \section net Vector network functions
  913. - Vect_net_build_graph()
  914. - Vect_net_get_line_cost()
  915. - Vect_net_get_node_cost()
  916. - Vect_net_nearest_nodes()
  917. - Vect_net_shortest_path()
  918. - Vect_net_shortest_path_coor()
  919. \section open Vector open functions
  920. - Vect_coor_info()
  921. - Vect_maptype_info()
  922. - Vect_open_new()
  923. - Vect__open_old()
  924. - Vect_open_old()
  925. - Vect_open_old_head()
  926. - Vect_open_spatial_index()
  927. - Vect_open_topo()
  928. - Vect_open_update()
  929. - Vect_open_update_head()
  930. - Vect_set_open_level()
  931. \section overlay Vector overlay functions
  932. - Vect_overlay()
  933. - Vect_overlay_str_to_operator()
  934. \section vpoly Vector polygon functions
  935. - Vect_find_poly_centroid()
  936. - Vect_get_point_in_area()
  937. - Vect_point_in_area_outer_ring()
  938. - Vect_point_in_island()
  939. - Vect_get_point_in_poly()
  940. - Vect_get_point_in_poly_isl()
  941. \section read Vector read functions
  942. \subsection read1_2 Level 1 and 2
  943. - Vect_read_next_line()
  944. \subsection read2 Level 2 only
  945. - Vect_area_alive()
  946. - Vect_isle_alive()
  947. - Vect_line_alive()
  948. - Vect_node_alive()
  949. - Vect_read_line()
  950. \section remove_areas Vector remove areas functions
  951. - Vect_remove_small_areas()
  952. \section remove_duplicates Vector remove duplicates functions
  953. - Vect_line_check_duplicate()
  954. - Vect_remove_duplicates()
  955. \section rewind Vector rewind functions
  956. - Vect_rewind()
  957. \section select Vector select functions
  958. - Vect_select_areas_by_box()
  959. - Vect_select_areas_by_polygon()
  960. - Vect_select_isles_by_box()
  961. - Vect_select_lines_by_box()
  962. - Vect_select_lines_by_polygon()
  963. - Vect_select_nodes_by_box()
  964. \section sindex Vector spatial index functions
  965. - Vect_build_sidx_from_topo()
  966. - Vect_build_spatial_index()
  967. - Vect_spatial_index_add_item()
  968. - Vect_spatial_index_del_item()
  969. - Vect_spatial_index_destroy()
  970. - Vect_spatial_index_init()
  971. - Vect_spatial_index_select()
  972. \section snap Vector snap functions
  973. - Vect_snap_lines()
  974. - Vect_snap_lines_list()
  975. \section tin Vector TIN functions
  976. - Vect_tin_get_z()
  977. \section type Vector type option functions
  978. - Vect_option_to_types()
  979. \section delete Vector delete functions
  980. \subsection delete2 Level 2 only
  981. - Vect_delete_line()
  982. \section write Vector write functions
  983. \subsection write1_2 Level 1 and 2
  984. - Vect_write_line()
  985. \subsection write2 Level 2 only
  986. - Vect_rewrite_line()
  987. \section geos GEOS support
  988. Note: The functions are available only if GRASS is compiled with
  989. <tt>--with-geos</tt> switch.
  990. - Vect_read_line_geos()
  991. - Vect_read_area_geos()
  992. - Vect_line_to_geos()
  993. \section contacts Contacts
  994. Radim Blazek (vector architecture) <radim.blazek@gmail.com>
  995. Roberto Micarelli (DGLib) <mi.ro@iol.it>
  996. \section references References
  997. Text based on: R. Blazek, M. Neteler, and R. Micarelli. The new GRASS 5.1
  998. vector architecture. In Open source GIS - GRASS users conference 2002,
  999. Trento, Italy, 11-13 September 2002. University of Trento, Italy, 2002.
  1000. <a href="http://www.ing.unitn.it/~grass/conferences/GRASS2002/proceedings/proceedings/pdfs/Blazek_Radim.pdf">http://www.ing.unitn.it/~grass/conferences/GRASS2002/proceedings/proceedings/pdfs/Blazek_Radim.pdf</a>
  1001. \section seealso See Also
  1002. - \ref dglib
  1003. - \ref dbmilib
  1004. - \ref veditlib
  1005. Last change: $Date$
  1006. */