vectorlib_ascii.dox 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*! \page vlibAscii Vector ASCII Format
  2. by GRASS Development Team (http://grass.osgeo.org)
  3. \tableofcontents
  4. \section vlibAsciiMain Vector ASCII Format Specifications
  5. The GRASS ASCII vector map format may contain a mix of primitives
  6. including points, lines, boundaries, centroids, faces, and
  7. kernels. The format may also contain a header with various metadata
  8. (see example below).
  9. Vector map can be converted to the ASCII representation at user level
  10. by <tt>v.out.ascii format=standard</tt> command.
  11. See \ref vlibAsciiFn for list of related functions.
  12. The header is similar as the head file of vector binary format (see
  13. \ref vlibHeadFileFormat) but contains bounding box also. Keywords are:
  14. \verbatim
  15. ORGANIZATION
  16. DIGIT DATE
  17. DIGIT NAME
  18. MAP NAME
  19. MAP DATE
  20. MAP SCALE
  21. OTHER INFO
  22. ZONE
  23. WEST EDGE
  24. EAST EDGE
  25. SOUTH EDGE
  26. NORTH EDGE
  27. MAP THRESH
  28. \endverbatim
  29. Example:
  30. \verbatim
  31. ORGANIZATION: NC OneMap
  32. DIGIT DATE:
  33. DIGIT NAME: helena
  34. MAP NAME: North Carolina selected bridges (points map)
  35. MAP DATE: Mon Nov 6 15:32:39 2006
  36. MAP SCALE: 1
  37. OTHER INFO:
  38. ZONE: 0
  39. MAP THRESH: 0.000000
  40. \endverbatim
  41. The body begins with the row:
  42. \verbatim
  43. VERTI:
  44. \endverbatim
  45. followed by records of primitives:
  46. \verbatim
  47. TYPE NUMBER_OF_COORDINATES [NUMBER_OF_CATEGORIES]
  48. X Y [Z]
  49. ....
  50. X Y [Z]
  51. [ LAYER CATEGORY]
  52. ....
  53. [ LAYER CATEGORY]
  54. \endverbatim
  55. Everything above in <tt>[]</tt> is optional.
  56. The primitive codes are as follows:
  57. - 'P': point
  58. - 'L': line
  59. - 'B': boundary
  60. - 'C': centroid
  61. - 'F': face (3D boundary)
  62. - 'K': kernel (3D centroid)
  63. - 'A': area (boundary) - better use 'B'; kept only for backward
  64. compatibility
  65. The coordinates are listed following the initial line containing the
  66. primitive code, the total number of vectors in the series, and (optionally)
  67. the number of categories (1 for a single layer, higher for multiple layers).
  68. Below that 1 or several lines follow to indicate the layer number and
  69. the category number (ID).
  70. The order of coordinates is
  71. \verbatim
  72. X Y [Z]
  73. \endverbatim
  74. Note: The points are stored as y, x (i.e., east, north), which is the
  75. reserve of the way GRASS usually represents geographic coordinates.
  76. Example:
  77. \verbatim
  78. P 1 1
  79. 375171.4992779 317756.72097616
  80. 1 1
  81. B 5
  82. 637740 219580
  83. 639530 219580
  84. 639530 221230
  85. 637740 221230
  86. 637740 219580
  87. C 1 1
  88. 638635 220405
  89. 1 2
  90. \endverbatim
  91. In this example, the first vector feature is a point with category
  92. number 1. The second vector feature is a boundary composed by 5
  93. points. The third feature is a centroid with category number 2. The
  94. boundary and the centroid form an area with category number 2. All
  95. vector feature mentioned above are located in layer 1.
  96. */