Debian Codegraph @

vector/v.info/v.info.html

raw
1 <h2>DESCRIPTION</h2>
2
3 <em>v.info</em> reports some basic information (metadata) about a
4 user-specified vector map and its topology status.
5
6 <p>
7 If topology info is not available (i.e., vector map cannot be opened on
8 level 2), vector map extends and number of features need to be counted
9 on the fly which may take some time.
10
11 <p>
12 Note that the flag <b>-c</b> only works when the vector map is connected
13 to one or several attribute table(s). This connection can be shown or set
14 with <em>v.db.connect</em>.
15
16 <h2>EXAMPLE</h2>
17
18 <h3>Basic metadata information</h3>
19
20 <div class="code"><pre>
21 v.info map=geology
22
23 +----------------------------------------------------------------------------+
24 | Name: geology |
25 | Mapset: PERMANENT |
26 | Project: nc_spm_08 |
27 | Database: /home/martin/grassdata |
28 | Title: North Carolina geology map (polygon map) |
29 | Map scale: 1:1 |
30 | Map format: native |
31 | Name of creator: helena |
32 | Organization: NC OneMap |
33 | Source date: Mon Nov 6 15:48:53 2006 |
34 |----------------------------------------------------------------------------|
35 | Type of map: vector (level: 2) |
36 | |
37 | Number of points: 0 Number of centroids: 1832 |
38 | Number of lines: 0 Number of boundaries: 3649 |
39 | Number of areas: 1832 Number of islands: 907 |
40 | |
41 | Map is 3D: No |
42 | Number of dblinks: 1 |
43 | |
44 | Projection: Lambert Conformal Conic |
45 | |
46 | N: 318117.43741634 S: 10875.82723209 |
47 | E: 930172.31282271 W: 123971.19498978 |
48 | |
49 | Digitization threshold: 0 |
50 | Comment: |
51 | |
52 +----------------------------------------------------------------------------+
53 </pre></div>
54
55 <h3>Map history</h3>
56
57 <div class="code"><pre>
58 v.info -h map=geology
59
60 COMMAND: v.in.ogr input="geol.shp" output="geology" min_area=0.0001 snap=-1
61 GISDBASE: /bigdata/grassdata05
62 LOCATION: ncfromfile MAPSET: PERMANENT USER: helena DATE: Mon Nov 6 15:48:53 2006
63 ---------------------------------------------------------------------------------
64 1832 input polygons
65 total area: 1.276093e+11 (1832 areas)
66 overlapping area: 0.000000e+00 (0 areas)
67 area without category: 0.000000e+00 (0 areas)
68 ---------------------------------------------------------------------------------
69 </pre></div>
70
71 Note that while "project" is used by <em>v.info</em> elsewhere, history output
72 uses the legacy term "location" because "LOCATION" is currently a part of the
73 native vector format.
74
75 <h3>Attribute columns for given layer</h3>
76
77 <div class="code"><pre>
78 v.info -c map=geology
79
80 Displaying column types/names for database connection of layer &lt;1&gt;:
81 INTEGER|cat
82 DOUBLE PRECISION|onemap_pro
83 DOUBLE PRECISION|PERIMETER
84 INTEGER|GEOL250_
85 INTEGER|GEOL250_ID
86 CHARACTER|GEO_NAME
87 DOUBLE PRECISION|SHAPE_area
88 DOUBLE PRECISION|SHAPE_len
89 </pre></div>
90
91 <h3>Basic metadata information in shell script style</h3>
92
93 <div class="code"><pre>
94 v.info -get map=geology
95
96 name=geology
97 mapset=PERMANENT
98 project=nc_spm_08
99 database=/home/martin/grassdata
100 title=North Carolina geology map (polygon map)
101 scale=1:1
102 format=native
103 creator=helena
104 organization=NC OneMap
105 source_date=Mon Nov 6 15:48:53 2006
106 level=2
107 map3d=0
108 num_dblinks=1
109 projection=Lambert Conformal Conic
110 digitization_threshold=0.000000
111 comment=
112 north=318117.43741634
113 south=10875.82723209
114 east=930172.31282271
115 west=123971.19498978
116 top=0.000000
117 bottom=0.000000
118 nodes=4556
119 points=0
120 lines=0
121 boundaries=3649
122 centroids=1832
123 areas=1832
124 islands=907
125 primitives=5481
126 </pre></div>
127
128 <div class="code"><pre>
129 v.info -g map=geology
130
131 north=318117.43741634
132 south=10875.82723209
133 east=930172.31282271
134 west=123971.19498978
135 top=0.000000
136 bottom=0.000000
137 </pre></div>
138
139 <h3>Output in JSON format</h3>
140 <div class="code"><pre>
141 {
142 "name": "geology",
143 "mapset": "PERMANENT",
144 "project": "nc_spm_08_grass7",
145 "database": "\/grassdata",
146 "title": "North Carolina geology map (polygon map)",
147 "scale": 1,
148 "creator": "helena",
149 "organization": "NC OneMap",
150 "source_date": "Mon Nov 6 15:48:53 2006",
151 "timestamp": null,
152 "format": "native",
153 "level": 2,
154 "num_dblinks": 1,
155 "attribute_layer_number": 1,
156 "attribute_layer_name": "geology",
157 "attribute_database": "\/grassdata\/nc_spm_08_grass7\/PERMANENT\/sqlite\/sqlite.db",
158 "attribute_database_driver": "sqlite",
159 "attribute_table": "geology",
160 "attribute_primary_key": "cat",
161 "projection": "Lambert Conformal Conic",
162 "digitization_threshold": 0,
163 "comment": "",
164 "north": 318117.43741634465,
165 "south": 10875.827232091688,
166 "east": 930172.31282271142,
167 "west": 123971.19498978264,
168 "top": 0,
169 "bottom": 0,
170 "nodes": 2724,
171 "points": 0,
172 "lines": 0,
173 "boundaries": 3649,
174 "centroids": 1832,
175 "areas": 1832,
176 "islands": 907,
177 "primitives": 5481,
178 "map3d": false
179 }
180 </pre></div>
181
182 <h2>PYTHON</h2>
183
184 See <em><a href="https://grass.osgeo.org/grass-stable/manuals/libpython/">Python
185 Scripting Library</a></em> for more info.
186 <p>
187 Note: The Python tab in the <em>wxGUI</em> can be used for entering the
188 following code:
189 <p>
190 <div class="code"><pre>
191 import grass.script as gcore
192
193 gcore.vector_columns('geology') # for `v.info -c`
194 gcore.vector_info_topo('geology') # for `v.info shell=topo`
195 </pre></div>
196
197 Here is an example of how the JSON output format can be used to integrate Grass with other python libraries easily.
198 <div class="code"><pre>
199 import grass.script as gs
200 import pandas as pd
201
202 # Run v.info command
203 busstops = gs.run_command("v.info", map="busstopsall", format="json")
204
205 # Load data into dataframe
206 df = pd.DataFrame([busstops])
207
208 # Display the DataFrame
209 print(df)
210 </pre></div>
211
212 <h2>SEE ALSO</h2>
213
214 <em>
215 <a href="r.info.html">r.info</a>,
216 <a href="r3.info.html">r3.info</a>,
217 <a href="t.info.html">t.info</a>,
218 <a href="v.db.connect.html">v.db.connect</a>
219 </em>
220
221 <h2>AUTHORS</h2>
222
223 Original author CERL<br>
224 Updated to GRASS 6 by Radim Blazek, ITC-Irst, Trento, Italy<br>
225 Level 1 support by Markus Metz<br>
226 Updated to GRASS 7 by Martin Landa, CTU in Prague, Czech Republic