vectorlib.dox 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589
  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 consist of multiple segments.
  123. Topology also holds information about isles. Isles are located within an area, not
  124. touching the boundaries of the outer area. Isles consist of one or more areas
  125. and are used internally by the vector libraries to maintain correct topology of areas.
  126. \section libraries Vector libraries
  127. Besides internal library functions there are two main libraries:
  128. - Vlib (Vector library), see \ref vlib
  129. - DGLib (Directed Graph Library), see \ref dglib
  130. For historical reasons, there are two internal libraries for vector:
  131. - diglib (with dig_*() functions), GRASS 3.x/4.x
  132. - Vlib (with V1_*(), V2_*() and Vect_*() functions), GRASS 4.x/5.x (except for the 5.7 interim version)
  133. The vector library was introduced in GRASS 4.0 to hide internal vector
  134. files' formats and structures. In GRASS 6/7, everything is accessed via
  135. Vect_*() functions, for example:
  136. Old 4.x code:
  137. \code
  138. xx = Map.Att[Map.Area[area_num].att].x;
  139. \endcode
  140. New 6.x/7.x functions:
  141. \code
  142. Vect_get_area_centroid();
  143. Vect_get_centroid_coor();
  144. \endcode
  145. In GRASS 6/7, all internal, mostly non-topological vector functions are
  146. hidden from the modules' API (mainly dig_*(), V1_*() and V2_*()
  147. functions). All available Vect_*() functions are topological vector
  148. functions.
  149. \subsection vlib Introduction to Vlib (Vector library)
  150. <i>Note: For details please read Blazek et al. 2002 (see below) as well as the
  151. references in this document.</i>
  152. \subsubsection Directory_structure Directory structure
  153. Directory structure and file names are changed with respect to
  154. previous GRASS versions. All vector files for one vector map are
  155. stored in one directory:<br>
  156. <b>$MAPSET/vector/vector_name/</b>
  157. This directory contains these files:
  158. - <b>coor</b> - binary file, coordinates [former dig/ file]
  159. - <b>topo</b> - binary file, topology [former dig_plus/ file]
  160. - <b>sidx</b> - binary file, spatial index
  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 created with topology.
  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. The spatial index is stored in file and not loaded for old vectors that
  439. are not updated, saving a lot of memory. Spatial queries are done in
  440. file.
  441. Currently most of the modules do not release the memory occupied for
  442. spatial index and work like this (pseudocode):
  443. \code
  444. int main
  445. {
  446. Vect_open_new();
  447. //writing new vector
  448. Vect_build();
  449. Vect_close(); // memory is not released
  450. }
  451. \endcode
  452. In general it is possible to free the memory with Vect_set_release_support()
  453. such as:
  454. \code
  455. int main
  456. {
  457. Vect_open_new();
  458. // writing new vector
  459. Vect_build();
  460. Vect_set_release_support();
  461. Vect_close(); // memory is released
  462. }
  463. \endcode
  464. but it takes longer.
  465. <P>
  466. It makes sense to release the spatial index if it is used only at the beginning
  467. of a module or in permanently running programs like QGIS. Note that this
  468. applies only when creating a new vector or updating an old vector.
  469. For example:
  470. \code
  471. int main
  472. {
  473. Vect_open_update();
  474. // select features using spatial index, e.g. Vect_select_lines_by_box()
  475. Vect_set_release_support();
  476. Vect_close(); // memory is released
  477. // do some processing which needs memory
  478. }
  479. \endcode
  480. \section vlib_categories_layers Vector library categories and layers
  481. <i>Note: "layer" was called "field" in earlier version.</i>
  482. In GRASS, a "category" or "category number" is a vector feature ID
  483. used to link geometry to attributes which are stored in one or several
  484. (external) database table(s). This category number is stored into the
  485. vector geometry as well as a "cat" column (integer type) in each
  486. attribute database table. The category number is used to lookup an
  487. attribute assigned to a vector object. At user level, category numbers
  488. can be assigned to vector objects with the v.category command.
  489. In order to assign multiple attributes in different tables to vector
  490. objects, each map can hold multiple category numbers. This is achieved
  491. by assigning more than one "layer" to the map (v.db.connect
  492. command). The layer number determines which table to be used for
  493. attribute queries. For example, a cadastrial vector area map can be
  494. assigned on layer 1 to an attribute table containing landuse
  495. descriptions which are maintained by department A while layer 2 is
  496. assigned to an attribute table containing owner descriptions which are
  497. maintained by department B.
  498. Each vector feature inside a vector map has zero, one or more
  499. &lt;layer,category&gt; tuple(s). A user can (but not must) create
  500. attribute tables which are referenced by the layer, and rows which are
  501. essentially referenced by the &lt;layer,category&gt; pair. <P>
  502. Categories start with 1. Categories do not have to be continuous.
  503. \section vlib_cidx Vector library category index
  504. The category index (stored in the cidx file) improves the performance of all
  505. selections by cats/attributes (SQL, e.g. 'd.vect cats=27591', 'v.extract list=20000-21000').
  506. This avoids that all selections have to be made by looping through all vector lines.
  507. Category index is also essential for simple feature representation of GRASS vectors.
  508. Category index is created for each field. In memory, it is stored in
  509. \code
  510. struct Cat_index {
  511. int field; /* field number a.k.a. layer*/
  512. int n_cats; /* number of items in cat array */
  513. int a_cats; /* allocated space in cat array */
  514. int (*cat)[3]; /* array of cats (cat,type, lines/area) */
  515. int n_ucats; /* number of unique cats (not updated) */
  516. int n_types; /* number of types in type */
  517. int type[7][2];/* number of elements for each type (point, line, boundary, centroid, area, face, kernel) */
  518. long offset; /* offset of the beginning of this index in cidx file */
  519. };
  520. \endcode
  521. Category index is built with topology, but it is <b>not updated</b> if vector is edited on level 2.
  522. Category index is stored in 'cidx' file, 'cat' array is written/read by one call of
  523. dig__fwrite_port_I( (int *)ci->cat, 3 * ci->n_cats, fp) or
  524. dig__fread_port_I( (int *)ci->cat, 3 * ci->n_cats, fp).
  525. Stored values can be retrieved either by index in 'cat' array
  526. (if all features of given field are required) or by category value
  527. (one or few features), always by Vect_cidx_*() functions.
  528. To create category index, it will be necessary to rebuild topology for all existing vectors.
  529. This is an opportunity to make (hopefully) last changes in 'topo', 'cidx' formats.
  530. \section vlibtin Vector TINs
  531. TINs are simply created as 2D/3D vector polygons consisting of
  532. 3 vertices. See Vect_tin_get_z().
  533. \section vlib_attributes Vector library and attributes
  534. The old GRASS 4.x 'dig_cats' files are not used any more and vectors'
  535. attributes are stored in external database. Connection with the
  536. database is done through drivers based on DBMI library (DBF, SQLite,
  537. PostgreSQL, MySQL and ODBC drivers are available at this
  538. time). Records in a table are linked to vector entities by layer and
  539. category number. The layer identifies table and the category
  540. identifies record. I.e., for any unique combination
  541. map+mapset+layer+category, there exists one unique combination
  542. driver+database+table+row.
  543. The general DBMI settings are defined in the "MAPSET/VAR" text file
  544. (maintained with db.connect command at user level).
  545. Each vector maps has its own DBMI settings stored in the
  546. "MAPSET/vector/vector_name/dbln" text file. For each pair <B>map +
  547. layer</B>, all of <B>table, key column, database, driver</B> must be
  548. defined in a new row. This definition must be written to
  549. "MAPSET/vector/vector_name/dbln" text file. Each row in the "dbln"
  550. file contains names separated by spaces in following order ([] -
  551. optional): <BR><BR>
  552. \verbatim
  553. map[@mapset] layer table [key [database [driver]]]
  554. \endverbatim
  555. If key, database or driver are omitted (on second and higher row only)
  556. the last definition is used. When reading a vector map from another
  557. mapset (if mapset is specified along with map name), definitions in
  558. the related "dbln" file may overwrite the DBMI definition in the
  559. current mapset. This means that the map-wise definition is always
  560. "stronger".
  561. Wild cards <B>*</B> and <B>?</B> may be used in map and mapset names.
  562. Variables <B>$GISDBASE, $LOCATION_NAME, $MAPSET, $MAP</B> may be used
  563. in table, key, database and driver names (function
  564. Vect_subst_var()). Note that $MAPSET is not the current mapset but
  565. mapset of the map the rule is defined for.
  566. Note that vector features in GRASS vector maps may have attributes
  567. in different tables or may be without attributes. Boundaries
  568. form areas but it may happen that some boundaries are not closed
  569. (such boundaries would not appear in polygon layer).
  570. Boundaries may have attributes. All types may be mixed in one vector map.
  571. The link to the table is permanent and it is stored in 'dbln' file
  572. in vector directory. Tables are considered to be a part of the vector
  573. and the command g.remove, for example, deletes linked tables of the vector.
  574. Attributes must be joined with geometry.
  575. <B>Examples:</B>
  576. Examples are written mostly for the DBF driver, where database is full path to
  577. the directory with dbf files and table name is the name of dbf file without
  578. .dbf extension:
  579. \verbatim
  580. * 1 mytable id $GISDBASE/$LOCATION_NAME/$MAPSET/vector/$MAP dbf
  581. \endverbatim
  582. This definition says that entities with category of layer 1 are linked
  583. to dbf tables with names "mytable.dbf" saved in vector directories of
  584. each map. The attribute column containing the category numbers is
  585. called "id".
  586. \verbatim
  587. * 1 $MAP id $GISDBASE/$LOCATION_NAME/$MAPSET/dbf dbf
  588. \endverbatim
  589. Similar as above but all dbf files are in one directory dbf/ in mapset
  590. and names of dbf files are $MAP.dbf
  591. \verbatim
  592. water* 1 rivers id /home/grass/dbf dbf
  593. water* 2 lakes lakeid /home/guser/mydb
  594. trans* 1 roads key basedb odbc
  595. trans* 5 rails
  596. \endverbatim
  597. These definitions define more layers (called "field" in the API) for one map
  598. i.e. in one map may be more features linked to more tables. Definitions on
  599. first 2 rows are applied for example on maps water1, water2, ... so that more
  600. maps may share one table.<BR><BR>
  601. \verbatim
  602. water@PERMANENT 1 myrivers id /home/guser/mydbf dbf
  603. \endverbatim
  604. This definion overwrites the definition saved in PERMANENT/VAR and
  605. links the water map from PERMANENT mapset to the user's table.
  606. Modules should be written so that connections to databases for each
  607. vector layer are independent. It should be possible to read attributes
  608. of an input map from one database and write to some other and even with
  609. some other driver (should not be a problem).
  610. There are open questions, however. For one, how does one distinguish when
  611. new tables should be written and when not? For example, definitions:<BR>
  612. \verbatim
  613. river 1 river id water odbc
  614. river.backup* 1 NONE
  615. \endverbatim
  616. could be used to say that tables should not be copied for backups of
  617. map river because table is stored in a reliable RDBMS.
  618. \section grassdglib DGLib (Directed Graph Library)
  619. The Directed Graph Library or DGLib (Micarelli 2002, \ref dglib ,
  620. http://grass.osgeo.org/dglib/) provides functionality for vector network
  621. analysis. This library released under GPL is hosted by the GRASS
  622. project (within the GRASS source code). As a stand-alone library it
  623. may also be used by other software projects.
  624. The Directed Graph Library library provides functionality to assign costs to
  625. lines and/or nodes. That means that costs can be accumulated while traveling
  626. along polylines. The user can assign individual costs to all lines and/or
  627. nodes of a vector map and later calculate shortest path connections based on
  628. the accumulated costs. Applications are transport analysis, connectivity and
  629. more. Implemented applications cover Shortest path, Traveling salesman (round trip),
  630. Allocation of sources (creation of subnetworks), Minimum Steiner trees
  631. (star-like connections), and iso-distances (from centers).
  632. For details, please read Blazek et al. 2002 (see below).
  633. Related vector functions are:
  634. Vect_graph_add_edge(),
  635. Vect_graph_init(),
  636. Vect_graph_set_node_costs(),
  637. Vect_graph_shortest_path(),
  638. Vect_net_build_graph(),
  639. Vect_net_nearest_nodes(),
  640. Vect_net_shortest_path(), and
  641. Vect_net_shortest_path_coor().
  642. \section vlibascii Vector ASCII Format Specifications
  643. The ASCII format is (currently) explained in the
  644. manual page of v.in.ascii, which is defined in the file:
  645. vector/v.in.ascii/description.html
  646. \section vectmodules Vector modules and their parameters/flags
  647. See also grass5/documents/parameter_proposal.txt
  648. <I>A module is a GRASS command invoked by the user.</I>
  649. \subsection vectmodulesoper Modules operation
  650. Each module which modifies and writes data must read from input= and
  651. write to output= so that data may not be lost. For example v.spag
  652. works on map= at in grass5.0 but if program (system) crashes or threshold was
  653. specified incorrectly and vector was not backuped, data were lost.
  654. In this case map= option should be replaced by input= and output=
  655. Topology is always built by default if the coor file was modified.
  656. Dimensionality is generally kept. Input 2D vector is written as 2D, 3D as 3D.
  657. There are a few modules which change the dimension on purpose.
  658. \subsection vectmodulesopt Modules parameters/flags
  659. <B>-b</B> do not build topo file; by default topo file is written <BR>
  660. <B>-t</B> create new table, default<BR>
  661. <B>-u</B> don't create new table<BR>
  662. <B>-z</B> write 3D vector map (if input was 2D) <BR>
  663. <BR>
  664. <B>map=</B> input vector map for modules without output <BR>
  665. <B>input=</B> input vector map <BR>
  666. <B>output=</B> output vector map <BR>
  667. <B>type=</B> type of elements: point,line,boundary,centroid,area <BR>
  668. <B>cat=</B> category or category list (example: 1,5,9-13,35) <BR>
  669. <B>layer=</B> layer number <BR>
  670. <B>where=</B> condition of SQL statement for selection of records <BR>
  671. <B>column=</B> column name (in external table)
  672. \section vlibfunc List of vector library functions
  673. The Vect_*() functions are the programmer's API for GRASS vector
  674. programming.
  675. \section area Vector area functions
  676. - Vect_get_area_area()
  677. - Vect_get_area_boundaries()
  678. - Vect_get_area_centroid()
  679. - Vect_get_area_isle()
  680. - Vect_get_area_num_isles()
  681. - Vect_area_perimeter()
  682. - Vect_get_area_points()
  683. - Vect_get_isle_area()
  684. - Vect_get_isle_boundaries()
  685. - Vect_get_isle_points()
  686. - Vect_point_in_area()
  687. \section array Vector array functions
  688. - Vect_new_varray()
  689. - Vect_set_varray_from_cat_list()
  690. - Vect_set_varray_from_cat_string()
  691. - Vect_set_varray_from_db()
  692. \section box Vector bounding box functions
  693. - Vect_box_copy()
  694. - Vect_box_clip()
  695. - Vect_box_extend()
  696. - Vect_box_overlap()
  697. - Vect_get_area_box()
  698. - Vect_get_isle_box()
  699. - Vect_get_line_box()
  700. - Vect_get_map_box()
  701. - Vect_point_in_box()
  702. - Vect_region_box()
  703. \section break_lines Vector break lines functions
  704. - Vect_break_lines()
  705. - Vect_break_lines_list()
  706. \section break_polygons Vector break polygons functions
  707. - Vect_break_polygons()
  708. \section bridges Vector bridges functions
  709. - Vect_chtype_bridges()
  710. - Vect_remove_bridges()
  711. \section buffer Vector buffer functions
  712. - Vect_line_buffer()
  713. - Vect_line_parallel()
  714. \section build Vector build functions
  715. - Vect_build()
  716. - Vect_build_partial()
  717. - Vect_get_built()
  718. - Vect_build_sidx_from_topo()
  719. - Vect_build_sidx()
  720. - Vect_save_sidx()
  721. - Vect_save_topo()
  722. - Vect_sidx_dump()
  723. - Vect_topo_dump()
  724. \subsection build_nat Vector build (native) functions
  725. - Vect_attach_centroids()
  726. - Vect_attach_isle()
  727. - Vect_attach_isles()
  728. - Vect_build_line_area()
  729. - Vect_build_nat()
  730. - Vect_isle_find_area()
  731. \subsection build_ogr Vector build (OGR) functions
  732. - Vect_build_ogr()
  733. \section cats Vector categories functions
  734. - Vect_array_to_cat_list()
  735. - Vect_cat_del()
  736. - Vect_cat_get()
  737. - Vect_cat_in_array()
  738. - Vect_cat_in_cat_list()
  739. - Vect_cat_set()
  740. - Vect_destroy_cat_list()
  741. - Vect_destroy_cats_struct()
  742. - Vect_field_cat_del()
  743. - Vect_get_area_cats()
  744. - Vect_get_area_cat()
  745. - Vect_get_line_cat()
  746. - Vect_new_cat_list()
  747. - Vect_new_cats_struct()
  748. - Vect_reset_cats()
  749. - Vect_str_to_cat_list()
  750. \section cindex Vector category index functions
  751. (note: vector layer is historically called "field")
  752. - Vect_cidx_dump()
  753. - Vect_cidx_find_next()
  754. - Vect_cidx_find_all()
  755. - Vect_cidx_get_cat_by_index()
  756. - Vect_cidx_get_field_index()
  757. - Vect_cidx_get_field_number()
  758. - Vect_cidx_get_num_cats_by_index()
  759. - Vect_cidx_get_num_fields()
  760. - Vect_cidx_get_num_types_by_index()
  761. - Vect_cidx_get_num_unique_cats_by_index()
  762. - Vect_cidx_get_type_count()
  763. - Vect_cidx_get_type_count_by_index()
  764. - Vect_cidx_open()
  765. - Vect_cidx_save()
  766. - Vect_set_category_index_update()
  767. \section clean_nodes Vector clean nodes functions
  768. - Vect_clean_small_angles_at_nodes()
  769. \section close Vector close functions
  770. - Vect_close()
  771. \section constraint Vector constraint functions
  772. - Vect_get_constraint_box()
  773. - Vect_remove_constraints()
  774. - Vect_set_constraint_region()
  775. - Vect_set_constraint_type()
  776. \section dangles Vector dangles functions
  777. - Vect_chtype_dangles()
  778. - Vect_remove_dangles()
  779. - Vect_select_dangles()
  780. \section dbcolumns Vector dbcolumns functions
  781. - Vect_get_column_names()
  782. - Vect_get_column_names_types()
  783. - Vect_get_column_types()
  784. \section error Vector error functions
  785. - Vect_get_fatal_error()
  786. - Vect_set_fatal_error()
  787. \section field Vector field functions
  788. (note: vector layer is historically called "field")
  789. - Vect_add_dblink()
  790. - Vect_check_dblink()
  791. - Vect_default_field_info()
  792. - Vect_get_dblink()
  793. - Vect_get_field()
  794. - Vect_map_add_dblink()
  795. - Vect_map_check_dblink()
  796. - Vect_map_del_dblink()
  797. - Vect_new_dblinks_struct()
  798. - Vect_read_dblinks()
  799. - Vect_reset_dblinks()
  800. - Vect_set_db_updated()
  801. - Vect_subst_var()
  802. - Vect_write_dblinks()
  803. \section find Vector find functions
  804. - Vect_find_area()
  805. - Vect_find_island()
  806. - Vect_find_line()
  807. - Vect_find_line_list()
  808. - Vect_find_node()
  809. \section graph Vector graph functions
  810. - Vect_graph_add_edge()
  811. - Vect_graph_build()
  812. - Vect_graph_init()
  813. - Vect_graph_set_node_costs()
  814. - Vect_graph_shortest_path()
  815. \section header Vector header functions
  816. - Vect_get_comment()
  817. - Vect_get_constraint_box()
  818. - Vect_get_date()
  819. - Vect_get_full_name()
  820. - Vect_get_map_date()
  821. - Vect_get_map_name()
  822. - Vect_get_mapset()
  823. - Vect_get_name()
  824. - Vect_get_organization()
  825. - Vect_get_person()
  826. - Vect_get_proj()
  827. - Vect_get_proj_name()
  828. - Vect_get_scale()
  829. - Vect_get_thresh()
  830. - Vect_get_zone()
  831. - Vect_is_3d()
  832. - Vect_print_header()
  833. - Vect_read_header()
  834. - Vect_set_comment()
  835. - Vect_set_date()
  836. - Vect_set_map_date()
  837. - Vect_set_map_name()
  838. - Vect_set_organization()
  839. - Vect_set_person()
  840. - Vect_set_scale()
  841. - Vect_set_thresh()
  842. - Vect_set_zone()
  843. - Vect_write_header()
  844. \section hist Vector history functions
  845. - Vect_hist_command()
  846. - Vect_hist_copy()
  847. - Vect_hist_read()
  848. - Vect_hist_rewind()
  849. - Vect_hist_write()
  850. \section init_head Vector header functions
  851. - Vect_copy_head_data()
  852. \section intersect Vector intersection functions
  853. - Vect_line_check_intersection()
  854. - Vect_line_intersection()
  855. - Vect_segment_intersection()
  856. \section legal_vname Vector valid map name functions
  857. - Vect_check_input_output_name()
  858. - Vect_legal_filename()
  859. \section level Vector level functions
  860. - Vect_level()
  861. \section level_two Vector topological (level 2) functions
  862. - Vect_get_centroid_area()
  863. - Vect_get_line_areas()
  864. - Vect_get_line_nodes()
  865. - Vect_get_node_coor()
  866. - Vect_get_node_line()
  867. - Vect_get_node_line_angle()
  868. - Vect_get_node_n_lines()
  869. - Vect_get_num_areas()
  870. - Vect_get_num_dblinks()
  871. - Vect_get_num_faces()
  872. - Vect_get_num_islands()
  873. - Vect_get_num_lines()
  874. - Vect_get_num_nodes()
  875. - Vect_get_num_primitives()
  876. - Vect_get_num_updated_lines()
  877. - Vect_get_num_updated_nodes()
  878. - Vect_get_updated_line()
  879. - Vect_get_updated_node()
  880. - Vect_set_release_support()
  881. \section line Vector feature functions
  882. - Vect_append_point()
  883. - Vect_append_points()
  884. - Vect_copy_pnts_to_xyz()
  885. - Vect_copy_xyz_to_pnts()
  886. - Vect_destroy_line_struct()
  887. - Vect_line_box()
  888. - Vect_line_delete_point()
  889. - Vect_line_distance()
  890. - Vect_line_geodesic_length()
  891. - Vect_line_insert_point()
  892. - Vect_line_length()
  893. - Vect_line_prune()
  894. - Vect_line_prune_thresh()
  895. - Vect_line_reverse()
  896. - Vect_line_segment()
  897. - Vect_new_line_struct()
  898. - Vect_point_on_line()
  899. - Vect_points_distance()
  900. - Vect_reset_line()
  901. \section list Vector list functions
  902. - Vect_destroy_list()
  903. - Vect_list_append()
  904. - Vect_list_append_list()
  905. - Vect_list_delete()
  906. - Vect_list_delete_list()
  907. - Vect_new_list()
  908. - Vect_reset_list()
  909. - Vect_val_in_list()
  910. \section map Vector map functions
  911. - Vect_copy()
  912. - Vect_copy_map_lines()
  913. - Vect_copy_table()
  914. - Vect_copy_table_by_cats()
  915. - Vect_copy_tables()
  916. - Vect_delete()
  917. - Vect_rename()
  918. \section net Vector network functions
  919. - Vect_net_build_graph()
  920. - Vect_net_get_line_cost()
  921. - Vect_net_get_node_cost()
  922. - Vect_net_nearest_nodes()
  923. - Vect_net_shortest_path()
  924. - Vect_net_shortest_path_coor()
  925. \section open Vector open functions
  926. - Vect_coor_info()
  927. - Vect_maptype_info()
  928. - Vect_open_new()
  929. - Vect__open_old()
  930. - Vect_open_old()
  931. - Vect_open_old_head()
  932. - Vect_open_sidx()
  933. - Vect_open_topo()
  934. - Vect_open_update()
  935. - Vect_open_update_head()
  936. - Vect_set_open_level()
  937. \section overlay Vector overlay functions
  938. - Vect_overlay()
  939. - Vect_overlay_str_to_operator()
  940. \section vpoly Vector polygon functions
  941. - Vect_find_poly_centroid()
  942. - Vect_get_point_in_area()
  943. - Vect_point_in_area_outer_ring()
  944. - Vect_point_in_island()
  945. - Vect_get_point_in_poly()
  946. - Vect_get_point_in_poly_isl()
  947. \section read Vector read functions
  948. \subsection read1_2 Level 1 and 2
  949. - Vect_read_next_line()
  950. \subsection read2 Level 2 only
  951. - Vect_area_alive()
  952. - Vect_isle_alive()
  953. - Vect_line_alive()
  954. - Vect_node_alive()
  955. - Vect_read_line()
  956. \section remove_areas Vector remove areas functions
  957. - Vect_remove_small_areas()
  958. \section remove_duplicates Vector remove duplicates functions
  959. - Vect_line_check_duplicate()
  960. - Vect_remove_duplicates()
  961. \section rewind Vector rewind functions
  962. - Vect_rewind()
  963. \section sindex Vector spatial index functions
  964. - Vect_select_areas_by_box()
  965. - Vect_select_areas_by_polygon()
  966. - Vect_select_isles_by_box()
  967. - Vect_select_lines_by_box()
  968. - Vect_select_lines_by_polygon()
  969. - Vect_select_nodes_by_box()
  970. \section select custom spatial index functions
  971. - Vect_spatial_index_add_item()
  972. - Vect_spatial_index_del_item()
  973. - Vect_spatial_index_destroy()
  974. - Vect_spatial_index_init()
  975. - Vect_spatial_index_select()
  976. \section snap Vector snap functions
  977. - Vect_snap_lines()
  978. - Vect_snap_lines_list()
  979. \section tin Vector TIN functions
  980. - Vect_tin_get_z()
  981. \section type Vector type option functions
  982. - Vect_option_to_types()
  983. \section delete Vector delete functions
  984. \subsection delete2 Level 2 only
  985. - Vect_delete_line()
  986. \section write Vector write functions
  987. \subsection write1_2 Level 1 and 2
  988. - Vect_write_line()
  989. \subsection write2 Level 2 only
  990. - Vect_rewrite_line()
  991. \section geos GEOS support
  992. Note: The functions are available only if GRASS is compiled with
  993. <tt>--with-geos</tt> switch.
  994. - Vect_read_line_geos()
  995. - Vect_read_area_geos()
  996. - Vect_line_to_geos()
  997. \section contacts Contacts
  998. Radim Blazek (vector architecture) <radim.blazek@gmail.com>
  999. Roberto Micarelli (DGLib) <mi.ro@iol.it>
  1000. \section references References
  1001. Text based on: R. Blazek, M. Neteler, and R. Micarelli. The new GRASS 5.1
  1002. vector architecture. In Open source GIS - GRASS users conference 2002,
  1003. Trento, Italy, 11-13 September 2002. University of Trento, Italy, 2002.
  1004. <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>
  1005. \section seealso See Also
  1006. - \ref dglib
  1007. - \ref dbmilib
  1008. - \ref veditlib
  1009. Last change: $Date$
  1010. */