vectorascii.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <!-- meta page description: GRASS ASCII vector format specification -->
  2. <!-- meta page index: vector -->
  3. A vector map in GRASS native vector format may contain a mix of
  4. <i>primitives</i> including points, lines, boundaries, centroids, areas,
  5. faces, and kernels. The GRASS ASCII vector format may contain also
  6. a <i>header</i> with various metadata (see example below).
  7. <p>The header is similar as the head file of vector binary format but
  8. contains bounding box also. Key words are:
  9. <div class="code"><pre>
  10. ORGANIZATION
  11. DIGIT DATE
  12. DIGIT NAME
  13. MAP NAME
  14. MAP DATE
  15. MAP SCALE
  16. OTHER INFO
  17. ZONE
  18. WEST EDGE
  19. EAST EDGE
  20. SOUTH EDGE
  21. NORTH EDGE
  22. MAP THRESH
  23. </pre></div>
  24. <p>The body begins with the row:
  25. <div class="code"><pre>
  26. VERTI:
  27. </pre></div>
  28. followed by records of primitives:
  29. <div class="code"><pre>
  30. TYPE NUMBER_OF_COORDINATES [NUMBER_OF_CATEGORIES]
  31. X Y [Z]
  32. ....
  33. X Y [Z]
  34. [ LAYER CATEGORY]
  35. ....
  36. [ LAYER CATEGORY]
  37. </pre></div>
  38. Everything above in <tt>[&nbsp;]</tt> is optional.
  39. <p>The primitive codes are as follows:
  40. <ul>
  41. <li>'P': point</li>
  42. <li>'L': line</li>
  43. <li>'B': boundary</li>
  44. <li>'C': centroid</li>
  45. <li>'F': face (3D boundary)</li>
  46. <li>'K': kernel (3D centroid)</li>
  47. <li>'A': area (boundary) - better use 'B'; kept only for backward compatibility</li>
  48. </ul>
  49. The coordinates are listed following the initial line containing the
  50. primitive code, the total number of coordinates in the series, and
  51. (optionally) the number of categories (1 for a single layer, higher
  52. for multiple layers). Below that 1 or several lines follow to
  53. indicate the layer number and the category number (ID).
  54. <p>The order of coordinates is
  55. <div class="code"><pre>
  56. X Y [Z]
  57. </pre></div>
  58. In pre-GRASS 6 versions of the ASCII format, the order of coordinates
  59. was different:
  60. <div class="code"><pre>
  61. Y X
  62. </pre></div>
  63. <p>Latitude/Longitude data may be given in a number of ways.
  64. Decimal degrees must be positive or negative instead of using a hemisphere
  65. letter. Mixed coordinates must use a hemisphere letter. Whole minutes and
  66. seconds must always contain two digits (example: use <tt>167:03:04.567</tt>;
  67. and not <tt>167:3:4.567</tt>).
  68. <br><br>
  69. Acceptable formats:<br>
  70. <i>key: D=Degrees; M=Minutes; S=Seconds; h=Hemisphere (N,S,E,W)</i>
  71. <ul>
  72. <li><tt>(+/-)DDD.DDDDD</tt>
  73. <li><tt>DDDh</tt>
  74. <li><tt>DDD:MMh</tt>
  75. <li><tt>DDD:MM.MMMMMh</tt>
  76. <li><tt>DDD:MM:SSh</tt>
  77. <li><tt>DDD:MM:SS.SSSSSh</tt>
  78. </ul>
  79. <h2>EXAMPLES</h2>
  80. <div class="code"><pre>
  81. ORGANIZATION: GRASS Development Team
  82. DIGIT DATE: 1/9/2005
  83. DIGIT NAME: -
  84. MAP NAME: test
  85. MAP DATE: 2005
  86. MAP SCALE: 10000
  87. OTHER INFO: Test polygons
  88. ZONE: 0
  89. MAP THRESH: 0.500000
  90. VERTI:
  91. B 6
  92. 5958812.48844435 3400828.84221011
  93. 5958957.29887089 3400877.11235229
  94. 5959021.65906046 3400930.7458436
  95. 5959048.47580612 3400973.65263665
  96. 5959069.92920264 3401032.64947709
  97. 5958812.48844435 3400828.84221011
  98. C 1 1
  99. 5958952.42189184 3400918.23126419
  100. 1 20
  101. B 4
  102. 5959010.9323622 3401338.36037757
  103. 5959096.7459483 3401370.54047235
  104. 5959091.38259917 3401450.99070932
  105. 5959010.9323622 3401338.36037757
  106. C 1 1
  107. 5959063.08352122 3401386.98533277
  108. 1 21
  109. </pre></div>
  110. In this case the vector map contains 2 boundaries (first boundary with
  111. 6 vertices, second with 4 vertices) without category and 2 centroids
  112. with category number 20 and 21 (layer 1).
  113. <h2>SEE ALSO</h2>
  114. <em>
  115. <a href="v.in.ascii.html">v.in.ascii</a>,
  116. <a href="v.out.ascii.html">v.out.ascii</a>,
  117. <a href="v.edit.html">v.edit</a>
  118. </em>