vectorlib_ascii.dox 2.7 KB

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