<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://grasswiki.osgeo.org/w/index.php?action=history&amp;feed=atom&amp;title=V.generalize_tutorial%2Fid</id>
	<title>V.generalize tutorial/id - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://grasswiki.osgeo.org/w/index.php?action=history&amp;feed=atom&amp;title=V.generalize_tutorial%2Fid"/>
	<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=V.generalize_tutorial/id&amp;action=history"/>
	<updated>2026-04-12T03:58:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=V.generalize_tutorial/id&amp;diff=14487&amp;oldid=prev</id>
		<title>Neteler: /* AUTHORS */</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=V.generalize_tutorial/id&amp;diff=14487&amp;oldid=prev"/>
		<updated>2011-12-04T11:40:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;AUTHORS&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:40, 4 December 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l390&quot;&gt;Line 390:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 390:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Wolf Bergenheim, Mentor&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Wolf Bergenheim, Mentor&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Documentation]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: Documentation&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Languages/id]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category: Tutorial&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: Languages/id]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key grass_wiki:diff:1.41:old-8984:rev-14487:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Neteler</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=V.generalize_tutorial/id&amp;diff=8984&amp;oldid=prev</id>
		<title>Neteler: carried ID content over to correct language page</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=V.generalize_tutorial/id&amp;diff=8984&amp;oldid=prev"/>
		<updated>2009-05-31T20:25:55Z</updated>

		<summary type="html">&lt;p&gt;carried ID content over to correct language page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Trans|Bahasa Indonesia|English}}&lt;br /&gt;
&lt;br /&gt;
== MODUL ==&lt;br /&gt;
'''''v.generalize'''''&lt;br /&gt;
&lt;br /&gt;
== TUTORIAL ==&lt;br /&gt;
 &lt;br /&gt;
== Pendahuluan ==&lt;br /&gt;
 &lt;br /&gt;
Tutorial ini menggambarkan dan menjelaskan tentang kegunaan modul vektor GRASS ''v.generalize''.&lt;br /&gt;
Modul ini mengimplementasikan operasi generalisasi untuk peta vektor GRASS. Topis yang dibahas dalam tutorial ini adalah : simplifikasi,&lt;br /&gt;
smoothing, generalisasi jaringan dan perubahan posisi. Untuk penjelasan dasar mengenai operasi ini silakan lihat halaman {{cmd|v.generalize}} atau yang lebih lengkap lagi lihat McMaster dan Shea (TODO: tambahkan literatur).&lt;br /&gt;
&lt;br /&gt;
Disarankan untuk membaca halaman resmi manual sebelum membaca dokumen ini, atau baca kedua dokumen sekarang juga, karena tutorial ini tidak menjelaskan lebih detil tentang semua parameter input yang ada di manual. Begitu juga sebaliknya, halaman manual tidak disertai dengan contoh yang banyak dan juga tanpa gambar. Dokumen ini juga lebih bersifat sebagai laporan singkat, hasil yang diperoleh dari Google Summer of Code 2007.&lt;br /&gt;
&lt;br /&gt;
Hampir semua contoh dalam dokumen ini menggunakan dataset Spearfish, yang dapat diunduh di [[Sample_datasets|sini]]. Juga, tutorial ini mengasumsikan bahwa pengguna telah menjalankan sesi GRASS dengan location Spearfish dan sebuah window display yang dibuka. Jika Anda mengklik salah satu gambar di sini, ia akan ditampilkan dalam resolusi sebenarnya.&lt;br /&gt;
&lt;br /&gt;
Semua algoritma yang ditampilkan dalam dokumen ini (berusaha tetap) memelihara topologi dari peta input. Artinya, sebagai contoh, metoda smoothing dan simplifikasi tidak pernah menghilangkan titik awal dan terakhir dari garis, dan pemindahan garis tetap mempertahankan persimpangan (junctions) yang dimiliki.&lt;br /&gt;
&lt;br /&gt;
== Simplifikasi ==&lt;br /&gt;
 &lt;br /&gt;
''v.generalize'' mengimplementasikan banyak algoritma simplifikasi. Metoda yang paling banyak digunakan adalah algoritma Douglas-Peucker (TODO: literatur). Kita dapat menerapkan algoritma ini untuk sebarang peta vektor dengan cara berikut :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_douglas method=douglas threshold=50&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Penjelasan dari baris perintah di atas adalah : Jalankan v.generalize, terapkan algoritma Douglas-Peucker dengan threshold sama dengan 50 pada peta jalan dan simpan outputnya sebagai peta vektor output_douglas. Baris terakhir dari output garis oleh modul ini :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Number of vertices was reduced from 5468 to 2107[38%]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
berarti bahwa berkas input (roads) memiliki jumlah vertex total 5468 dan peta baru(roads_douglas) hanya memiliki 2107 vertex, yang artinya hanya 38% dari aslinya. Dalam contoh lain, jika kita jalankan perintah:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
d.vect roads&lt;br /&gt;
d.vect roads_douglas col=blue&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Kita akan melihat bahwa tidak ada perbedaan signifikan antara peta input dan output. &amp;quot;Only the details were removed&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic1.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
Tingkat kedetilan yang dihilangkan dapat ditentukan dengan parameter : threshold. Ini merupakan contoh bahwa peta output memiliki vertex lebih sedikit dan kedetilan lebih dari threshold tetap dipertahankan. Sebagai contoh, jika kita jalankan&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_douglas method=douglas threshold=200 --overwrite&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
kita akan mendapatkan sebuah peta dengan hanya 1726 verteks. Kerugian dari perintah di atas adalah perintah tersebut tidak pernah menghapus garis. Jika kita juga ingin menghilangkan garis kecil, kita harus menjalankan perintah di atas dengan tambahan -r, hingga garis yang kurang dari threshold dan area dengan luas dibawah threshold akan dihilangkan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize -r input=roads output=roads_douglas method=douglas threshold=200 --overwrite&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pada kasus ini, roads_douglas hanya memiliki 850 verteks dan 387 garis dibandingkan pada peta aslinya (roads) yang memiliki 825 garis. Dalam kasus ini, peta output memiliki detail yang lebih sediki tetapi bentuk dasar dan topologinya tetap dipertahankan:&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic2.png|center|thumb|400px|caption text here]]  &lt;br /&gt;
&lt;br /&gt;
Juga mungkin untuk hanya menghilangkan garis/area kecil saja (tanpa simplifikasi). Hal ini bisa dicapai dengan method=remove_small:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_remove_small method=remove_small threshold=200&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
yang menghasilkan peta dengan 399 baris (Perhatikan bahwa garis yang dihilangkan berada di sebelah kiri atas)&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic3.png|center|thumb|400px|caption text here]]  &lt;br /&gt;
&lt;br /&gt;
Douglas-Peucker Algorithm has very reasonable results, but it is very hard to find(guess) the&lt;br /&gt;
right value of threshold. Moreover, it is also impossible to simplify each line to (for example) 40%.&lt;br /&gt;
Exactly for such cases, ''v.generalize'' provides method=douglas_reduction. This algorithm&lt;br /&gt;
is a modification of Douglas-Peucker Algorithm which takes another paratemer ''reduction''&lt;br /&gt;
which denotes (approximate) simplification of lines. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_douglas_reduction method=douglas_reduction \&lt;br /&gt;
  threshold=0 reduction=50 --overwrite&lt;br /&gt;
d.erase&lt;br /&gt;
d.vect roads_douglas_reduction&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
produces following map with 3018 vertices (55%). (Note that there are almost no differencies between the original and the new map)&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic4.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
Also observe that the following commands are equivalent&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=in output=out method=douglas threshold=eps&lt;br /&gt;
v.generalize input=in output=out method=douglas_reduction threshold=eps reduction=100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another algorithm implemented in this modules is &amp;quot;Vertex Reduction&amp;quot;. This algorithm removes&lt;br /&gt;
the consecutive poins (on the same line) which are closer to each other than threshold. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=in output=out method=reduction threshold=0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
removes duplicate points. More precisely, if two consecutive points have the same &lt;br /&gt;
coordinates then the second point is removed and the first is preserved. The last two algorithm&lt;br /&gt;
implemented by this module are &amp;quot;Lang&amp;quot; and &amp;quot;Reumann-Witkam&amp;quot; algorithm. For more information about these two algorithms, please see the {{cmd|v.generalize}} man page.&lt;br /&gt;
[[File:Contoh.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
The following four pictures show the results obtained by Reumann, Douglas, Lang&lt;br /&gt;
and Vertex Reduction algorithm resp. The algorithms were run with threshold set to 50&lt;br /&gt;
and Lang algorithm with look_ahead=7.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery Caption=&amp;quot;Simplification algorithms&amp;quot; widths=&amp;quot;300px&amp;quot; heights=&amp;quot;225px&amp;quot; perrow=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
Image:v.generalize.reumann.png|Reumann-Witkam algorithm result containing 2522 [46%] points&lt;br /&gt;
&lt;br /&gt;
Image:v.generalize.douglas.png|Douglas algorithm result containing 2107 [38%] points&lt;br /&gt;
&lt;br /&gt;
Image:v.generalize.lang.png|Lang algorithm result containing 2160 [39%] points&lt;br /&gt;
&lt;br /&gt;
Image:v.generalize.reduction.png|Vertex Reduction algorithm result containing 4296 [78%] points&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The map produced by&lt;br /&gt;
* Reumann-Witkam algorithm contains 2522 [46%] points,&lt;br /&gt;
* Douglas: 2107 [38%] points,&lt;br /&gt;
* Lang: 2160 [39%] and&lt;br /&gt;
* Vertex Reduction: 4296 [78%].&lt;br /&gt;
&lt;br /&gt;
== Smoothing ==&lt;br /&gt;
 &lt;br /&gt;
''v.generalize'' also supports many smoothing algorithm. For basic descriptions, please consult the {{cmd|v.generalize}} man page.&lt;br /&gt;
&lt;br /&gt;
Probably, the best results are produced by &amp;quot;Chaiken&amp;quot;, &amp;quot;Hermite&amp;quot; and &amp;quot;Snakes&amp;quot; algorithms/methods. &lt;br /&gt;
However, the remaining algorithms may also produce very reasonable results. Although&lt;br /&gt;
the Chaiken and Hermite methods may produce the maps with a lot of new points, the methods&lt;br /&gt;
presented above (simplification) provide a good tool for tackling this problem.&lt;br /&gt;
&lt;br /&gt;
If we run the following command&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_chaiken method=chaiken threshold=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we get a new map with 33364[640%] vertices.&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic5.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
This map looks almost exactly the same as the original map at the current level of detail as the&lt;br /&gt;
picture below shows. This pictures was produced by the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
d.erase&lt;br /&gt;
d.vect roads&lt;br /&gt;
d.vect roads_chaiken col=blue&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic6.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
However, if we zoom to a small region, we can see that the new map consists of smooth(er) lines &lt;br /&gt;
which (very reasonable) approximate the original ones. &lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic7.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
If we apply &amp;quot;Hermite&amp;quot; method instead, we will obtain a map with 14640[267%] vertices.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_hermite method=hermite threshold=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic8.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
Note, that a difference between &amp;quot;Chaiken&amp;quot; and &amp;quot;Hermite&amp;quot; is that the lines produced&lt;br /&gt;
by &amp;quot;Chaiken&amp;quot; &amp;quot;inscribe&amp;quot; the orginal lines whereas the &amp;quot;Hermite&amp;quot; lines &amp;quot;circumscribe&amp;quot; the&lt;br /&gt;
original lines as can be seen in the picture below. (Black line is original line,&lt;br /&gt;
green line is &amp;quot;Chaiken&amp;quot; and blue is &amp;quot;Hermite&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic9.png|center|thumb|400px|caption text here]]  &lt;br /&gt;
&lt;br /&gt;
The algorithms mentioned above are suitable for smooth approximation of given lines.&lt;br /&gt;
On the other hand, if the aim of smoothing is to &amp;quot;straighten&amp;quot; the lines then the better&lt;br /&gt;
results are achieved by the other methods. For example,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_sa method=sliding_averaging look_ahead=7 slide=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--[[Image:v.generalize.pic10.png]] ??? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At first sight, we can see that roads_sa contains smooth and straight lines which&lt;br /&gt;
preserve the original shape of the lines. This difference is obvious if we zoom to a small&lt;br /&gt;
region of a map (see below. Again, original line is black, new line is blue)&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic11.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
If the lines are &amp;quot;too straight&amp;quot; then we can set &amp;quot;slide&amp;quot; to a smaller value to obtain the lines&lt;br /&gt;
which better preserve the original shape. In the picture below, original line is black,&lt;br /&gt;
line produced by &amp;quot;slide=1&amp;quot; is blue and &amp;quot;slide=0.3&amp;quot; is green.&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic12.png|center|thumb|400px|caption text here]]  &lt;br /&gt;
&lt;br /&gt;
Very similar results can be obtained by Distance Weighting Algorithm (method=distance_weighting).&lt;br /&gt;
This is not very surprising since these algorithms are almost the same. For example,&lt;br /&gt;
the image below shows the outputs of &amp;quot;Distance Weighting Algorithm&amp;quot;. The image was generated&lt;br /&gt;
by the following sequence of commands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_dw1 method=distance_weighting look_ahead=7 slide=1&lt;br /&gt;
v.generalize input=roads output=roads_dw2 method=distance_weighting look_ahead=7 slide=0.3&lt;br /&gt;
d.erase&lt;br /&gt;
d.vect roads&lt;br /&gt;
d.vect roads_dw1 col=red&lt;br /&gt;
d.vect roads_dw2 col=blue&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic13.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
Also, very good resutls can be obtained by the &amp;quot;Snakes&amp;quot; algorithm. On the other hand,&lt;br /&gt;
it is the (assymtotically) slowest&lt;br /&gt;
smoothing algorithm implemented in this however. Behaviour of this algorithm is controlled by&lt;br /&gt;
&amp;quot;alpha&amp;quot; and &amp;quot;beta&amp;quot; parameter. Reasonable range of values for these two parameters is [0..5]&lt;br /&gt;
where higher values correspond to the straighter lines. Module outputs the input map if&lt;br /&gt;
alpha=beta=0. And this command&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_snakes method=snakes alpha=1 beta=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
produces a map containing following region (original line is black)&lt;br /&gt;
[[Image:v.generalize.pic14.png|center|thumb|400px|caption text here]]  &lt;br /&gt;
&lt;br /&gt;
Last smoothing algorithm implemented in this module is &amp;quot;Boyle's Forward-Looking Algorithm&amp;quot; which&lt;br /&gt;
is another &amp;quot;straightening&amp;quot; algorithm.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_boyle method=boyle look_ahead=5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
produces a map containing following region (original line is black)&lt;br /&gt;
[[Image:v.generalize.pic15.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
=== Area smoothing example ===&lt;br /&gt;
&lt;br /&gt;
 # spearfish&lt;br /&gt;
 g.region rast=geology&lt;br /&gt;
 r.reclass in=geology out=geology.claysand &amp;lt;&amp;lt; EOF&lt;br /&gt;
 8 = 8 claysand&lt;br /&gt;
 EOF&lt;br /&gt;
 r.to.vect in=geology.claysand out=geology_claysand feature=area&lt;br /&gt;
 v.generalize in=geology_claysand out=geology_claysand_smooth method=snakes&lt;br /&gt;
&lt;br /&gt;
== Displacement ==&lt;br /&gt;
&lt;br /&gt;
If we render entire Spearfish location, we can see in the upper half of the map two interstates which&lt;br /&gt;
overlap. This is not logically correct (I hope, they do not evarlap in real) and it is also&lt;br /&gt;
considered as an (presentation) error. For solving such problems, ''v.generalize'' provides&lt;br /&gt;
&amp;quot;dislplacement&amp;quot; method. As the name suggests, this method displaces linear features which are&lt;br /&gt;
close to each other so that they do not overlap/collide. Method implemented in this modules (based on Snakes)&lt;br /&gt;
has very good results but not very good perfomance. Therefore the calculations may take few(several) minutes.&lt;br /&gt;
For this reason, displacement is applied to the simplified lines in this document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_dr method=douglas_reduction threshold=0 reduction=50&lt;br /&gt;
v.generalize input=roads_dr output=roads_dr_disp method=displacement alpha=0.01 beta=0.01 threshold=100 iterations=35&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First command produces simplified lines and then the second command applied displacement operator&lt;br /&gt;
to the simplified line. Parameters alpha and beta specifies the rigidity of the lines. This means&lt;br /&gt;
that displacement is bigger for small values of alpha and beta. Also, the displacement is&lt;br /&gt;
not very significant for higher(&amp;amp;gt;=1.0) values of alpha, beta. Threshold parameter&lt;br /&gt;
denotes the critical distance. Only the points (and their neighbours) which are closer&lt;br /&gt;
than threshold apart are displaced by ''v.generalize''. Module tries to move these&lt;br /&gt;
points such that they are at least threshold apart. However, the displaced points are never&lt;br /&gt;
threshold (or more) apart for positive values of alpha and beta. Displacement as implemented&lt;br /&gt;
in ''v.generalize'' is an iterative process. Parameter &amp;quot;iterarions&amp;quot; specifies the number&lt;br /&gt;
of iterations the collisions between the points are resolved. In general, the quality of displacement&lt;br /&gt;
increases with the number of iterations. However, quality converges quite rapidly and&lt;br /&gt;
for all maps I tried, the sufficient value of iterations was between 20 and 50.&lt;br /&gt;
Two command above produce the picture below. Note that it is now possible to distinguish&lt;br /&gt;
between two &amp;quot;interastate lines&amp;quot; and also observe the free space between interstate and the lines&lt;br /&gt;
directly below it.     &lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic16.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
== Network Generalization ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Network generalization is suitable for selecting &amp;quot;the most important&amp;quot; subnetwork&lt;br /&gt;
of a network. For example, to select highways, interstates from a road network. Examples&lt;br /&gt;
in this section work with new GRASS default dataset, which can be downloaded [[Sample_datasets|here]].&lt;br /&gt;
&lt;br /&gt;
If we render map &amp;quot;streets_wake&amp;quot; we really cannot see the streets, but the only&lt;br /&gt;
thing we can see is a big black rhombus. We will try to improve this. Firstly, network&lt;br /&gt;
generalization requites quite a lot of time and memory. Therefore, we begin with&lt;br /&gt;
simplification of &amp;quot;streets_wake&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=streets_wake output=streets_rs method=remove_small threshold=50&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we can begin with network generalization. If we execute the folllowing command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=streets_rs output=streets_rs_network method=network betweeness_thresh=50&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we obtain the following map containing &amp;quot;only&amp;quot; 14128. Original map has 49746&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.net50.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
If this is still not enough, we can increase the value of betweeness_thresh to, for example 200.&lt;br /&gt;
For this value, ''v.generalize'' produces following map with 11537 lines.&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.net200.png|center|thumb|400px|caption text here]]&lt;br /&gt;
&lt;br /&gt;
It is also possible to change the values of &amp;quot;closeness_thresh&amp;quot; and &amp;quot;degree_thresh&amp;quot;. Parameter&lt;br /&gt;
&amp;quot;closeness_thresh&amp;quot; is suitable for selecting the &amp;quot;centre(s)&amp;quot; of a network. This parameter&lt;br /&gt;
is always between 0 and 1. And &amp;quot;reasonable values&amp;quot; of this parameter are smaller for&lt;br /&gt;
bigger network.&lt;br /&gt;
&lt;br /&gt;
== Gereneral Parameters ==&lt;br /&gt;
&lt;br /&gt;
''v.generalize'' has some parameters and flags which affect the general behaviour of module.&lt;br /&gt;
&lt;br /&gt;
The simplest one is -c flag. &amp;quot;C&amp;quot; stands for copy and if this flag is on then the attributes&lt;br /&gt;
are copied from the old map to the new map. Note that the attributes of removed features are&lt;br /&gt;
dropped. &lt;br /&gt;
&lt;br /&gt;
Default behaviour of this module is that the selected algorithm/method is applied to the all&lt;br /&gt;
lines/areas. It is possible to apply the most of the algorithms only to the selected features.&lt;br /&gt;
This is achieved by &amp;quot;type&amp;quot;, &amp;quot;layer&amp;quot;, &amp;quot;cats&amp;quot; and &amp;quot;where&amp;quot; parameters. This works for all algorithms&lt;br /&gt;
except &amp;quot;Network Generalization&amp;quot; which is always applied to the all features. &lt;br /&gt;
For example, the following command applies &amp;quot;Douglas Reduction&amp;quot; algorithm to interstates and highways (cat&amp;amp;lt;3)&lt;br /&gt;
and leaves the other lines unaltered. It also copies the attributes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize -c input=roads output=roads_douglas_reduction2 method=douglas_reduction threshold=0 reduction=50 type=line where=&amp;quot;cat&amp;amp;lt;3&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the following command removes the small areas&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=soils output=soils_remove_small method=remove_small threshold=200 type=area&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Similarly, the following command displaces only the interstates (cats=1) and the lines with a different&lt;br /&gt;
category number are not taken into the account.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.generalize input=roads output=roads_displacement2 method=displacement \&lt;br /&gt;
   threshold=75 alpha=0.01 beta=0.01 iterations=20 cats=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.pic10.png|center|thumb|400px|caption text here]]  &lt;br /&gt;
&lt;br /&gt;
We end up with a complex example of a generalization of &amp;quot;roads&amp;quot; in Spearfish location.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#straighten the lines&lt;br /&gt;
v.generalize input=roads output=step1 method=snakes alpha=1 beta=1&lt;br /&gt;
#simplification&lt;br /&gt;
v.generalize input=step1 output=step2 method=douglas_reduction threshold=0 reduction=55&lt;br /&gt;
#displacement&lt;br /&gt;
v.generalize input=step2 output=step3 method=displacement alpha=0.01 beta=0.01 threshold=100 iterations=50&lt;br /&gt;
#remove small areas&lt;br /&gt;
v.generalize input=step3 output=step4 method=remove_small threshold=75&lt;br /&gt;
#network generalization&lt;br /&gt;
v.generalize input=step4 output=step5 method=network betweeness_thresh=5 closeness_thresh=0.0425&lt;br /&gt;
#smoothing&lt;br /&gt;
v.generalize input=step5 output=step6 method=chaiken threshold=1&lt;br /&gt;
#simplification&lt;br /&gt;
v.generalize input=step6 output=step7 method=douglas threshold=1&lt;br /&gt;
#remove temporary maps&lt;br /&gt;
g.remove vect=step1,step2,step3,step4,step5,step6&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result &amp;quot;step7&amp;quot; has 655 lines and 3545 vertices and the commands above have the following effect:&lt;br /&gt;
&lt;br /&gt;
[[Image:v.generalize.anim.gif|center|thumb|400px|caption text here (animation)]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
== AUTHORS ==&lt;br /&gt;
&lt;br /&gt;
* Daniel Bundala, Google Summer of Code 2007, Student&lt;br /&gt;
* Wolf Bergenheim, Mentor&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;br /&gt;
[[Category:Languages/id]]&lt;/div&gt;</summary>
		<author><name>Neteler</name></author>
	</entry>
</feed>