.. include:: ../macros.hrst .. include:: ../abbreviations.hrst .. index:: Surfaces display .. index:: Lines display .. _chapter:SurfacesLines: Surfaces and Lines ################## Besides the visualization of block models and sampling sets, |ATGV| is able to visualize all kinds of geometric items that also |ParaView| would handle. For the purpose of geodata visualization, it is often desirable to add items like: - **Topography**, including a projected *aearial photo*, a *geological map*, a *topographic map* or any other kind of mapping. - **Boundary lines** (closed polylines) like lease or any other aereal boundary, or any kind of other **polylines** showing important features. .. admonition:: **Note** :class: tip The following will give only a small impression of the possibilities to show additional geometries with |ATGV|. Please have a look into the |ParaView| documentations for further instructions: :ref:`chapter:FirstSteps`. .. index:: Triangulated Surfaces Triangulated Surfaces ===================== Reading from File ----------------- The native file format for triangulated surfaces in VTK is a *polydata file* (with .vtp extension). With |ATGV| comes the additional possibility to read them also from .dxf files, and from |ParaView| comes the ability to read even more formats. .. index:: Triangulated Surface from GeoTIFF file Reading from GeoTIFF File ------------------------- |ATGV| is able to read a topography from a TIFF file if it contains rastered altitude values in GeoTIFF format. The displayed output will be a triangulated surface that is automatically generated and optionally reduced (decimated) from the input raster data. Regarding the reduction options see :numref:`sec:Decimate`. .. index:: Triangulated Surface from points .. index:: Points from coordinate table Generating from Points ---------------------- If a series of surface point coordinates (x, y, z) are available, a surface can be triangulated between them with |ATGV|. The starting point could be a CSV file with a table like in :numref:`tab:TopoPoints`. .. table:: Topo points example :name: tab:TopoPoints :widths: auto +---------+---------+-------+ | x | y | z | +=========+=========+=======+ | 10200 | 24300 | 190 | +---------+---------+-------+ | 10200 | 24310 | 192 | +---------+---------+-------+ | 10200 | 24320 | 195 | +---------+---------+-------+ | 10200 | 24330 | 199 | +---------+---------+-------+ | 10200 | 24340 | 205 | +---------+---------+-------+ | 10200 | 24350 | 212 | +---------+---------+-------+ | 10200 | 24360 | 215 | +---------+---------+-------+ | 10200 | 24370 | 217 | +---------+---------+-------+ | 10200 | 24380 | 218 | +---------+---------+-------+ | 10200 | 24390 | 217 | +---------+---------+-------+ | 10200 | 24400 | 214 | +---------+---------+-------+ | 10210 | 24300 | 191 | +---------+---------+-------+ | 10210 | 24310 | 192 | +---------+---------+-------+ | etc. | | | +---------+---------+-------+ In |ATGV|, open the points CSV file and choose the **CSV Reader** for loading the data into a table as in :numref:`fig:SelectCsvReader`. .. figure:: ../images/select_csvreader.png :name: fig:SelectCsvReader :width: 40% :align: center The *CSV Reader* reads a CSV file and displays it as a table in a *SpreadSheet View*. On pressing :guilabel:`Apply`, a *SpreadSheet View* will open and show the points table as in :numref:`fig:TopoPointsTable`. .. figure:: ../images/topopointstable.png :name: fig:TopoPointsTable :width: 40% :align: center Point coordinates displayed in a *SpreadSheet View*. Next, these tabular data need to be converted into geometric points in space by applying the **Table to Points** filter. .. admonition:: **Did you know?** :class: tip A quick way to get that **Table to Points** filter is through :guilabel:`Filters` |RIGHTARR| :guilabel:`Search...` and starting to type the word *Table*: The filter will immediately appear in the list and with a click and pressing :guilabel:`Enter` it is attached to the *filter pipeline*. .. index:: Table to Points filter In the appearing **Properties** panel of the **Table to Points** filter, table columns for the x, y and z coordinates need to be specified, see :numref:`fig:TableToPointsProperties`. .. figure:: ../images/tabletopoints_properties.png :name: fig:TableToPointsProperties :width: 40% :align: center The **Properties** panel of the *Tables to Points* filter. .. admonition:: **Hint** :class: tip Before pressing :guilabel:`Apply`, make sure that a *render view* (3D view) is activated: Only then you will see the new points immediately, while otherwise they will be displayed in the *SpreadSheet View* that was previously showing the table data. .. figure:: ../images/topopoints.png :name: fig:TopoPoints :width: 40% :align: center Display of points in an *AthosGEO Table View*. .. index:: Delaunay 2D filter .. index:: Triangulate surface between points .. index:: Triangulate filter With this we have free points in space as shown in :numref:`fig:TopoPoints` and the next step would be to triangulate a topo surface between them using the **Delaunay 2D** filter. .. admonition:: **Note** :class: tip Two other filters look like they would do the same or similar things, but this is not true: - The **Triangulate** filter does not triangulate a surfass between points, but converts surfaces that are made up of face elements (cells) that are more complex than simple triangles (like quads, polygons or triangle strips) into plain triangulated surfaces. This is a requirement for certain other filters that cannot handle these more complex surface elements. - The **Delaunay 3D** filter might look like the adequate filter for our purpose, because we want to generate a surface in 3D space. However, This filter actually does not generate triangles, but tetrahedra, filling the void space inside a shell. The **Properties** of the *Delaunay 2D* filter is shown in :numref:`fig:Delaunay2DProperties`. xx .. figure:: ../images/delaunay2d_properties.png :name: fig:Delaunay2DProperties :width: 40% :align: center The **Properties** panel of the *Delaunay 2D* filter that will triangulate a surface between a set of points. Select the **XY Plane** option for generating a topo surface. The **Tolerance** is the distance between points below which are considered identical and merged. For a topo with coordinates in meters, the default value might be too small, so better increase it to something like 0.01. After pressing :guilabel:`Apply`, a surface will appear as shown in :numref:`fig:SurfaceFromPoints`. .. figure:: ../images/surfacefrompoints.png :name: fig:SurfaceFromPoints :width: 40% :align: center A triangulated surface generated from input points using the *Delaunay 2D* filter. At this point, a new triangulated surface is often too finegrained, with too many points and triangles to best represent the topo surface. A clever way to reduce the number of triangles in order to optimize the representation is described in :numref:`sec:Decimate`. .. index:: Decimate filter (for triangulated surfaces) .. _sec:Decimate: Reduction of Triangulated Surfaces ---------------------------------- The **Decimate** filter (to be found at :guilabel:`Filters` |RIGHTARR| :guilabel:`Geometry`) allows to reduce the number of triangles in a triangulated surface in an intelligent way, preserving morphologic features as much as possible within the limits of the selected parameters, see :numref:`fig:DecimateProperties`. .. figure:: ../images/decimate_properties.png :name: fig:DecimateProperties :width: 40% :align: center The **Properties** panel of the *Decimate* filter allow to finetune the resulting output triangulation. .. admonition:: **Did you know?** :class: tip The **Decimate** filter works only for surfaces that are plain triangulated surfaces without any other surface elements, like quads, polygons etc. If this is not true for a given surface, the **Triangulate** filter needs to be applied first. The two most important **Properties** of the *Decimate* filter are: - **Target Reduction:** A value of 0.9 means that the number of triangles should be reduced by 90% if this is possible while respecting the other constraints of the reduction. If the reduction looks too extreme, reduce this value to retain more triangles. - **Feature Angle:** Any common edge between two triangles where the angle between the triangles is more than the feature angle, must not be removed. So if the result of a decimation looks like retaining morphologic features not good enough, reduce that angle, or vice versa. **Example:** The result of reducing the surface shown in :numref:`fig:SurfaceFromPoints` with the *Decimate* filter default properties as shown in :numref:`fig:DecimateProperties` will produce a result as shown in :numref:`fig:DecimateSurfaceDefault`. Visually, a much less radical reduction with *Target Reduction* of only **0.3** and a *Feature Angle* of **10** seems to generate a better result, as shown in :numref:`fig:DecimateSurfaceOptimized`. .. figure:: ../images/decimatesurface_default.png :name: fig:DecimateSurfaceDefault :width: 40% :align: center The surface shown in :numref:`fig:SurfaceFromPoints` after application of the *Decimate* filter with default properties. .. figure:: ../images/decimatesurface_optimized.png :name: fig:DecimateSurfaceOptimized :width: 40% :align: center The surface shown in :numref:`fig:SurfaceFromPoints` after application of the *Decimate* filter with a much more optimum set of properties (*Target Reduction* = 0.3, *Feature Angle* = 10). The optimum set of properties for the *Decimate* filter will depend on the input triangulated surface and the requirements of retaining morphologic features with higher or lower precision. .. index:: Decimate Polyline filter Reduction of Polylines ---------------------- The **Decimate Polyline** filter will reduce the number of points definint a polyline in such a way that the geometry will be affected as little as possible. Writing Triangulated Surfaces and Polylines ------------------------------------------- The native VTK format for triangulated surfaces and polylines is a *Polydata File*, with **.vtp** extension. Writing them to **.dxf** file is an extension of |ATGV| to allow data exchange with softwares that prefer such a format. A number of other formats are already supported by |ParaView|. .. index:: Projected Maps and Images .. _sec:ProjectedMaps: Projected Maps ============== .. index:: Georeferencing images .. index:: ESRI world files for georeferencing images .. index:: GeoTIFF for georeferenced images Georeferencing -------------- Topo surfaces are having coordinates from their points, but images with maps or aerial photos need to be xplicitly georeferenced in order to be correctly projected onto a topo. Two systems are recognized in |ATGV|: - `ESRI worldfiles `_ are small plain text files describing the positioning of the image relative to a geographical reference grid. If they exist, |ATGV| will find and use them.x - In the case of `GeoTIFF `_, the georeferencing information is incorporated within the image file itself. If a TIFF image file contains such information, |ATGV| will use it. .. index:: Texture Georeferenced filter The *Texture Georeferenced* Filter |icontexturegeoref| ------------------------------------------------------ .. |icontexturegeoref| image:: ../images/pqTextureGeoref24.png The **Texture Georeferenced** filter asks for the name of a georeferenced texture (image) file, as specified above. Next, select the **Topo with Map Texture** representation, instead of the common **Surface** or **Surface with Edges** representations. The example topo with a projected example map :numref:`fig:MapDisplay` would look like shown in :numref:`fig:TopoWithMapDisplay`. +--------------------------------------+----------------------------------------------+ | .. figure:: ../images/mapdisplay.png | .. figure:: ../images/topowithmapdisplay.png | | :name: fig:MapDisplay | :name: fig:TopoWithMapDisplay | | :width: 100% | :width: 100% | | :align: center | :align: center | | | | | The **map** to be projected on | An example **topo** with the projected | | the **topo** | example **map**. | +--------------------------------------+----------------------------------------------+ .. admonition:: **Hints** :class: tip The **Texture Georeferenced** filter actually adds the full texture file name and path to the *Field Data* of the triangulated surface (topo). That means, if the output of that filter would be saved to a ***.vtp** file, also that texture file name will be saved. If now that ***.vtp** file is loaded back to |ATGV|, if the representation is then switched again to **Topo with Map Texture**, and if finally the **texture file** is still present in the same path, the topo projection will be back even without applying the **Texture Georeferenced** filter again. Textures with Transparency -------------------------- By default, the **Ignore Alpha** property of the **Texture Georeferenced** is **on**, meaning: If a texture map file has an alpha channel, care will be taken that the entire texture map is interpreted as being **opaque**. If that property is **off**, an alpha channel will be respected, with dramatic effects: It does not only affect texturing of the topo surface, but it makes the topo surface itself **fully or partially transparent**. +---------------------------------------+-----------------------------------------------+ | .. figure:: ../images/mapdisplay2.png | .. figure:: ../images/topowithmapdisplay2.png | | :name: fig:MapDisplay2 | :name: fig:TopoWithMapDisplay2 | | :width: 100% | :width: 100% | | :align: center | :align: center | | | | | This example **map** is | The effect is like **clipping** the topo | | **fully transparent** in the | along the boundary of the range of | | areas that are not of interest | interest | +---------------------------------------+-----------------------------------------------+ +---------------------------------------+-----------------------------------------------+ | .. figure:: ../images/mapdisplay3.png | .. figure:: ../images/topowithmapdisplay3.png | | :name: fig:MapDisplay3 | :name: fig:TopoWithMapDisplay3 | | :width: 100% | :width: 100% | | :align: center | :align: center | | | | | This example **map** has a | The effect is a textured topo surface | | **transparency gradient** from | with **varying transparency** (The | | the upper left to the lower | underlying sphere becomes increasingly | | right corner | visible) | +---------------------------------------+-----------------------------------------------+ .. index:: Lines, Polylines, Polygons .. index:: Polylines, Polygons Lines, Polylines and Polygons ============================= Reading from File ----------------- The native file format for lines, polylines and polygons in VTK is a *polydata file* (with .vtp extension). With |ATGV| comes the additional possibility to read them also from .dxf files, and from |ParaView| comes the ability to read even more formats. .. index:: Generating polylines or polygons manually .. index:: Polyline or polygon generation manually Manually Generating Polylines or Polygons ----------------------------------------- With |ATGV| it is possible to manually digitize lines, polylines and polygons using the **Poly Line Source**. It can be found at :guilabel:`Sources` |RIGHTARR| :guilabel:`Geometric Shapes`. With this, a **Properties** panel will appear as shown in :numref:`fig:PolyLineSourceProperties`. .. figure:: ../images/polylinesourceproperties.png :name: fig:PolyLineSourceProperties :width: 40% :align: center The **Poly Line Source** *Properties* panel explains the different steps to manually digitize a *polyline*. If the **Closed** checkbox is checked, the polyline will be automatically closed, generating a *polygon*. With the :guilabel:`+`, :guilabel:`-` and :guilabel:`x` buttons, single points can be added or removed, or the entire list will be cleared. With a map in the background, a drawn polygon can be digitized as a geometric *polygon* object for further processing or activities, as shown in :numref:`fig:PolyLineSourceSpline`. .. figure:: ../images/polylinesourcespline.png :name: fig:PolyLineSourceSpline :width: 40% :align: center The yellow *spline* was manually adapted to the *red outline* in the example map. .. admonition:: **Hints** :class: tip - Make sure that the projection is **parallel**, and this can be achieved by unchecking the *Camera Parallel Projection* checkbox in the *View* panel. - Make sure that the view is exactly vertical, which can be achieved by pressing the :guilabel:`-Z` button in the toolbar. - It is possible that the *spline* disappears behind the topo surface because the *Z coordinate* is too low. It is not possible to directly change the Z coordinate in the *Properties* panel, so some tricks need to be applied. One possibility: - After activating the *Poly Line Source* and ensuring the *parallel projection*, rotate to a side view, e.g. by pressing :guilabel:`+Y` in the tool bar. - Move the mouse to the *highest point* in the model (maybe a zoom in is required for the precision) and press both the :guilabel:`1` and the :guilabel:`2` buttons, one after the other, in order to bring both the start and the end point to that elevation. - Press the :guilabel:`-Z` button to change to the top view. Start and end point are now coinciding, but visible, at the highest possible elevation. - Now move the start and end points to where they should be: the *Z coordinate* will remain at the elevation of the top point of the topo, and the same is true for all points that are added from now on. At the end, do not forget to press the :guilabel:`Apply` button, because the *spline* that can be manipulated with with the mouse, is not yet the *geometric object* (polyline, polygon) that can be visualized, saved or otherwise further processed.