Debian Codegraph @

vector/v.transform/v.transform.html

raw
1 <h2>DESCRIPTION</h2>
2
3 <em>v.transform</em> performs an affine transformation (translate and rotate) of a
4 vector map. An affine transform includes one or several linear transformations
5 (scaling, rotation) and translation (shifting). Several linear transformations
6 can be combined in a single operation. The command can be used to georeference
7 unreferenced vector maps or to modify existing geocoded maps.
8
9 <h2>NOTES</h2>
10
11 Coordinate transformation based on Ground Control Points (GCPs) is done
12 by <em><a href="v.rectify.html">v.rectify</a></em> and not supported by
13 <em>v.transform</em>.
14
15 <p>Transformation parameters (i.e. <em>xshift</em>, <em>yshift</em>,
16 etc.) can be fetched from attribute table connected to the vector
17 map. In this case vector objects can be transformed with different
18 parameters based on their category number. If the parameter cannot be
19 fetched from the table, default value is used instead.
20 <p>
21 Note that the transformation matrix can be printed by
22 <em><a href="m.transform.html">m.transform</a></em>.
23
24 <h2>EXAMPLE</h2>
25
26 <h3>DXF/DWG drawings</h3>
27
28 <p>Most DXF/DWG drawings are done within XY coordinate space. To transform
29 them to a national grid, we can use <em>v.transform</em> together with
30 <em>v.rectify</em> and a first-order transformation.
31
32 <div class="code"><pre>
33 v.transform -t in=watertowerXY out=watertower_z zscale=0.04 zshift=1320
34 v.rectify in=watertower_z out=watertowerUTM points=wt.points order=1
35 </pre></div>
36
37 <h3>Extrude 2D vector points to 3D based on attribute column values</h3>
38
39 Spearfish example with manual table editing for vertical shift:
40
41 <div class="code"><pre>
42 # work on own map copy:
43 g.copy vect=archsites@PERMANENT,myarchsites
44 # add new 'zs' column to later store height of each site:
45 v.db.addcolumn myarchsites col="zs double precision"
46 v.db.update myarchsites layer=1 column=zs value="cat * 1000"
47
48 # perform z transformation:
49 v.transform -t input=archsites output=myarchsites3d column="zshift:zs" table="archsites_t"
50 # drop table containing transformation parameters:
51 echo "drop table archsites_t" | db.execute
52 </pre></div>
53 The resulting map is a 3D vector map.
54
55 <h3>Extrude 2D vector points to 3D based on attribute column values</h3>
56
57 Spearfish example with automated elevation extraction for vertical shift:
58
59 <div class="code"><pre>
60 # work on own map copy:
61 g.copy vect=archsites@PERMANENT,myarchsites
62 # add new 'zs' column to later store height of each site:
63 v.db.addcolumn myarchsites col="zs double precision"
64
65 # set region to elevation map and fetch individual heights:
66 g.region raster=elevation.10m -p
67 v.what.rast myarchsites rast=elevation.10m col=zs
68 # verify:
69 v.db.select myarchsites
70
71 # perform transformation to 3D
72 v.transform -t myarchsites output=myarchsites3d column="zshift:zs" layer=1
73 # drop table containing transformation parameters
74 v.db.dropcolumn myarchsites3d col=zs
75 </pre></div>
76 The resulting map is a 3D vector map.
77
78 <h2>SEE ALSO</h2>
79
80 <em>
81 <a href="m.transform.html">m.transform</a>,
82 <a href="i.rectify.html">i.rectify</a>,
83 <a href="v.rectify.html">v.rectify</a>,
84 <a href="r.region.html">r.region</a>
85 </em>
86
87 <h2>AUTHORS</h2>
88
89 Radim Blazek, ITC-irst, Trento, Italy,<br>
90 Column support added by Martin Landa, FBK-irst (formerly ITC-irst), Trento, Italy (2007/09)