v.transform.html 3.2 KB

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