TIN with breaklines: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
(Created page with "<h2> TIN<br /> </h2> <p><br /> </p><p>Triangular irregular networks (TIN) are widely spread in GIS community (in ESRI software, other commercial GIS and CAD) to represent su...")
 
m (→‎TIN: eg->ie)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<h2> TIN<br />  </h2>
== TIN ==
<p><br />
 
</p><p>Triangular irregular networks (TIN) are widely spread in GIS community (in ESRI software, other commercial GIS and CAD) to represent surface morphology.  
Triangular irregular networks (TIN) are widely spread in GIS community (in ESRI software, other commercial GIS and CAD) to represent surface morphology. They have traditionally not been present in GRASS due to GRASS's strong raster support and more advanced interpolation techniques.
</p><p>The most common way of TIN construction is Delaunay triangulation. GRASS has module &lt;v.delaunay&gt; to do this task, but it don't work with "breaklines", e.g. with constrained Delaunay triangulation.  
 
</p><p><br />
See the [[TIN]] and [[Contour lines to DEM]] wiki pages for further discussion.
</p>
 
<h2> &lt;v.triangle&gt; module<br />  </h2>
The most common way of TIN construction is Delaunay triangulation. GRASS has the {{Cmd|v.delaunay}} module to do this task, but it doesn't work with "breaklines", i.e. with constrained Delaunay triangulation.
<p>Add-on module &lt;a rel="nofollow" class="external text" href="https://raw.github.com/amuriy/GRASS-scripts/master/v.triangle"&gt;v.triangle&lt;/a&gt; was written as attempt to close this gap. It's simply a "front-end" to the famous &lt;a rel="nofollow" class="external text" href="http://www.cs.cmu.edu/~quake/triangle.html"&gt;Triangle&lt;/a&gt; utility of J.R. Shewchuk. &lt;Triangle&gt; makes exact Delaunay triangulations, constrained Delaunay triangulations, conforming Delaunay triangulations and high-quality triangular meshes. On GIS terminology, it produces 2D TIN, optionally with "breaklines".  
 
</p><p>Module is a shell script that implements the main &lt;Triangle&gt; options and use it as "filter" to produce 2D TIN from the vector points/lines data.<br />
== &lt;v.triangle&gt; module ==
</p><p><br />
 
</p>
Add-on module [https://raw.github.com/amuriy/GRASS-scripts/master/v.triangle v.triangle] was written as attempt to close this gap. It's simply a "front-end" to the famous utility [http://www.cs.cmu.edu/~quake/triangle.html Triangle] of J.R. Shewchuk, which makes exact Delaunay triangulations, constrained Delaunay triangulations, conforming Delaunay triangulations and high-quality triangular meshes. On GIS terminology, it produces 2D TIN, optionally with "breaklines".  
<blockquote><u><b>Usage:</b></u><br /> <b>v.triangle</b> [-cdqalysif] <i>points</i>=name [<i>lines</i>=name] <i>tin</i>=name<br /> [<i>max_area</i>=name] [<i>min_angle</i>=name] [<i>steiner_points</i>=name] [<i>save</i>=name]<br /><br /></blockquote><blockquote><u><b>Flags:</b></u><br /> -c Conforming constrained Delaunay triangulation without angle or area constraints<br /> -d Conforming Delaunay triangulation<br /> -q Quality mesh generation (all angles are between 20 and 140 degrees)<br /> -a Imposes a maximum triangle area constraint<br /> -l Uses only vertical cuts in the divide-and-conquer algorithm<br /> -y Prohibits the insertion of Steiner points on the mesh boundary<br /> -s Specifies the maximum number of added Steiner points<br /> -i Uses the incremental algorithm for Delaunay triangulation, rather than the divide-and-conquer algorithm<br /> -f Uses Steven Fortune's sweepline algorithm for Delaunay triangulation, rather than the divide-and-conquer algorithm<br /> --o Allow output files to overwrite existing files<br /> --v Verbose module output<br /> --q Quiet module output <br /></blockquote><blockquote><u><b>Parameters:</b></u><br /> <i>points</i> Input vector map containing points<br /> <i>lines</i> Input vector map containing breaklines<br /> <i>tin</i> Name of output vector map (TIN)<br /> <i>max_area</i> Maximum triangle area (use with "-a" flag)<br /> <i>min_angle</i> Minimum mesh angle (use with "-q" flag)<br /> <i>steiner_points</i> Specifies the maximum number of Steiner points that may be inserted into the mesh (use with "-s" flag)<br /> <i>save</i> Path to save &lt;Triangle&gt; working files (*.node,*.poly,*.edge,*.ele). By default uses current location directory<br /> </blockquote>
 
<p><br />
* ''Legal Note: '''Triangle''' is not free for commercial use and therefore must not be distributed with GRASS.''
</p>
 
<h2> Example<br />  </h2>
The module is a shell script that implements the main &lt;Triangle&gt; options and use it as "filter" to produce 2D TIN from the vector points/lines data. To use script you must to compile &lt;Triangle&gt; first and add it to system $PATH.
<p>The following example was produced using ESRI sample data (masspoints and breaklines) to compare ArcView 3D Analyst TIN and &lt;Triangle&gt; TIN.<br />
 
</p><p>The command used: <i><b>v.triangle -c points=pts lines=lines tin=tin</b></i><br />
 
</p><p><br />
<u>'''Usage:'''</u><br> '''v.triangle''' [-cdqalysif] ''points''=name [''lines''=name] ''tin''=name<br> [''max_area''=name] [''min_angle''=name] [''steiner_points''=name] [''save''=name]
</p>
 
<div class="center"><div class="floatnone">&lt;a href="/wiki/File:ArcView_GRASS_TIN_breaklines_l.png" class="image"&gt;&lt;img alt="ArcView GRASS TIN breaklines l.png" src="/grass-wiki/images/ArcView_GRASS_TIN_breaklines_l.png" width="1481" height="716" /&gt;&lt;/a&gt;</div></div>
<u>'''Flags:'''</u><br> '''-c'''&nbsp; Conforming constrained Delaunay triangulation without angle or area constraints<br> '''-d'''&nbsp; Conforming Delaunay triangulation<br> '''-q'''&nbsp; Quality mesh generation (all angles are between 20 and 140 degrees)<br> '''-a'''&nbsp; Imposes a maximum triangle area constraint<br> '''-l'''&nbsp; Uses only vertical cuts in the divide-and-conquer algorithm<br> '''-y'''&nbsp; Prohibits the insertion of Steiner points on the mesh boundary<br> '''-s&nbsp;''' Specifies the maximum number of added Steiner points<br> '''-i&nbsp;''' Uses the incremental algorithm for Delaunay triangulation, rather than the divide-and-conquer algorithm<br> '''-f'''&nbsp; Uses Steven Fortune's sweepline algorithm for Delaunay triangulation, rather than the divide-and-conquer algorithm<br> '''--o'''&nbsp; Allow output files to overwrite existing files<br> '''--v'''&nbsp; Verbose module output<br> '''--q&nbsp;''' Quiet module output
<p><br />
 
</p><p><br /> [[sv:Main Page/sv|Main Page/sv]]
<u>'''Parameters:'''</u><br> '''''points''''' &nbsp; Input vector map containing points<br> '''''lines'''''&nbsp; Input vector map containing breaklines<br> '''''tin'''''&nbsp; Name of output vector map (TIN)<br> '''''max_area''''' &nbsp; Maximum triangle area (use with "-a" flag)<br> '''''min_angle'''''&nbsp; Minimum mesh angle (use with "-q" flag)<br> '''''steiner_points'''''&nbsp; Specifies the maximum number of Steiner points that may be inserted into the mesh (use with "-s" flag)<br> '''''save''''' &nbsp; Path to save &lt;Triangle&gt; working files (*.node,*.poly,*.edge,*.ele,*.off). By default uses current location directory
</p><p>&lt;a href="/grass-wiki/index.php?title=Sv:Main_Page/sv&amp;action=edit&amp;redlink=1" class="new" title="Sv:Main Page/sv (страница не существует)"&gt;sv:Main Page/sv&lt;/a&gt;
 
</p><p><br />
== Example ==
</p><p><br />
 
</p><p>&lt;a href="/grass-wiki/index.php?title=/grass-wiki/index.php%3Ftitle%3DSv:Main_Page/sv%26action%3Dedit%26redlink%3D1&amp;action=edit&amp;redlink=1" class="new" title="/grass-wiki/index.php?title=Sv:Main Page/sv&amp;action=edit&amp;redlink=1 (страница не существует)"&gt;sv:Main Page/sv&lt;/a&gt;
The following example was produced using ESRI sample data (masspoints and breaklines) to compare TIN's made in using ArcView 3D Analyst and Triangle.
</p><p>[[Category:Pages_with_broken_file_links|Pages_with_broken_file_links]] &lt;a href="/grass-wiki/index.php?title=Sv:Main_Page/sv&amp;action=edit&amp;redlink=1" class="new" title="Sv:Main Page/sv (страница не существует)"&gt;sv:Main Page/sv&lt;/a&gt;
 
</p>
The command used:
v.triangle -c points=pts lines=lines tin=tin
 
[[File:ArcView_GRASS_TIN_breaklines.png]]

Latest revision as of 10:03, 6 April 2013

TIN

Triangular irregular networks (TIN) are widely spread in GIS community (in ESRI software, other commercial GIS and CAD) to represent surface morphology. They have traditionally not been present in GRASS due to GRASS's strong raster support and more advanced interpolation techniques.

See the TIN and Contour lines to DEM wiki pages for further discussion.

The most common way of TIN construction is Delaunay triangulation. GRASS has the v.delaunay module to do this task, but it doesn't work with "breaklines", i.e. with constrained Delaunay triangulation.

<v.triangle> module

Add-on module v.triangle was written as attempt to close this gap. It's simply a "front-end" to the famous utility Triangle of J.R. Shewchuk, which makes exact Delaunay triangulations, constrained Delaunay triangulations, conforming Delaunay triangulations and high-quality triangular meshes. On GIS terminology, it produces 2D TIN, optionally with "breaklines".

  • Legal Note: Triangle is not free for commercial use and therefore must not be distributed with GRASS.

The module is a shell script that implements the main <Triangle> options and use it as "filter" to produce 2D TIN from the vector points/lines data. To use script you must to compile <Triangle> first and add it to system $PATH.


Usage:
v.triangle [-cdqalysif] points=name [lines=name] tin=name
[max_area=name] [min_angle=name] [steiner_points=name] [save=name]

Flags:
-c  Conforming constrained Delaunay triangulation without angle or area constraints
-d  Conforming Delaunay triangulation
-q  Quality mesh generation (all angles are between 20 and 140 degrees)
-a  Imposes a maximum triangle area constraint
-l  Uses only vertical cuts in the divide-and-conquer algorithm
-y  Prohibits the insertion of Steiner points on the mesh boundary
-s  Specifies the maximum number of added Steiner points
-i  Uses the incremental algorithm for Delaunay triangulation, rather than the divide-and-conquer algorithm
-f  Uses Steven Fortune's sweepline algorithm for Delaunay triangulation, rather than the divide-and-conquer algorithm
--o  Allow output files to overwrite existing files
--v  Verbose module output
--q  Quiet module output

Parameters:
points   Input vector map containing points
lines  Input vector map containing breaklines
tin  Name of output vector map (TIN)
max_area   Maximum triangle area (use with "-a" flag)
min_angle  Minimum mesh angle (use with "-q" flag)
steiner_points  Specifies the maximum number of Steiner points that may be inserted into the mesh (use with "-s" flag)
save   Path to save <Triangle> working files (*.node,*.poly,*.edge,*.ele,*.off). By default uses current location directory

Example

The following example was produced using ESRI sample data (masspoints and breaklines) to compare TIN's made in using ArcView 3D Analyst and Triangle.

The command used:

v.triangle -c points=pts lines=lines tin=tin