|
@@ -18,25 +18,13 @@ map. In this case vector objects can be transformed with different
|
|
|
parameters based on their category number. If the parameter cannot be
|
|
|
fetched from the table, default value is used instead.<p>
|
|
|
|
|
|
-<h3>Affine Transformation Matrix</h3>
|
|
|
-The affine transfomation matrix can optionally be printed with the '-m'
|
|
|
-flag. The format of the matrix is:
|
|
|
-<div class="code" style="width:30%;"><pre>
|
|
|
-| x_offset a b |
|
|
|
-| y_offset d e |
|
|
|
-</pre></div>
|
|
|
-
|
|
|
-This format can be used in the <a href="http://postgis.refractions.net/docs/ch06.html#id2904406">Affine() function of PostGIS</a>
|
|
|
-[Affine(geom, a, b, d, e, xoff, yoff)], or directly compared to the
|
|
|
-output of a similar operation performed in R.
|
|
|
-
|
|
|
<h2>EXAMPLE</h2>
|
|
|
|
|
|
<h3>DXF/DWG drawings</h3>
|
|
|
|
|
|
<p>Most DXF/DWG drawings are done within XY coordinate space. To transform
|
|
|
them to a national grid, we can use <em>v.transform</em> together with
|
|
|
-<em>v.rectify</em> and a first-order 4 point transformation.
|
|
|
+<em>v.rectify</em> and a first-order transformation.
|
|
|
|
|
|
<div class="code"><pre>
|
|
|
v.transform -t in=watertowerXY out=watertower_z zscale=0.04 zshift=1320
|
|
@@ -48,12 +36,11 @@ v.rectify in=watertower_z out=watertowerUTM points=wt.points order=1
|
|
|
Spearfish example with manual table editing for vertical shift:
|
|
|
|
|
|
<div class="code"><pre>
|
|
|
-# create table containing transformation parameters:
|
|
|
-echo "create table archsites_t (cat int, zs double)" | db.execute
|
|
|
-# insert transformation parameters for category 1:
|
|
|
-echo "insert into archsites_t values (1, 1000)" | db.execute
|
|
|
-# insert transformation parameters for category 2 (and so forth):
|
|
|
-echo "insert into archsites_t values (2, 2000)" | db.execute
|
|
|
+# work on own map copy:
|
|
|
+g.copy vect=archsites@PERMANENT,myarchsites
|
|
|
+# add new 'zs' column to later store height of each site:
|
|
|
+v.db.addcolumn myarchsites col="zs double precision"
|
|
|
+v.db.update myarchsites layer=1 column=zs value="cat * 1000"
|
|
|
|
|
|
# perform z transformation:
|
|
|
v.transform -t input=archsites output=myarchsites3d column="zshift:zs" table="archsites_t"
|
|
@@ -79,7 +66,7 @@ v.what.rast myarchsites rast=elevation.10m col=zs
|
|
|
v.db.select myarchsites
|
|
|
|
|
|
# perform transformation to 3D
|
|
|
-v.transform -t myarchsites output=myarchsites3d column="zshift:zs" table=myarchsites
|
|
|
+v.transform -t myarchsites output=myarchsites3d column="zshift:zs" layer=1
|
|
|
# drop table containing transformation parameters
|
|
|
v.db.dropcolumn myarchsites3d col=zs
|
|
|
</pre></div>
|