[GRASS-SVN] r47862 -
grass/branches/develbranch_6/raster3d/r3.out.vtk
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Aug 23 17:55:19 EDT 2011
Author: neteler
Date: 2011-08-23 14:55:19 -0700 (Tue, 23 Aug 2011)
New Revision: 47862
Modified:
grass/branches/develbranch_6/raster3d/r3.out.vtk/description.html
grass/branches/develbranch_6/raster3d/r3.out.vtk/main.c
grass/branches/develbranch_6/raster3d/r3.out.vtk/parameters.c
grass/branches/develbranch_6/raster3d/r3.out.vtk/writeVTKData.c
Log:
Milena Nowotarska: msg cleanup; HTML cleanup
Modified: grass/branches/develbranch_6/raster3d/r3.out.vtk/description.html
===================================================================
--- grass/branches/develbranch_6/raster3d/r3.out.vtk/description.html 2011-08-23 21:55:06 UTC (rev 47861)
+++ grass/branches/develbranch_6/raster3d/r3.out.vtk/description.html 2011-08-23 21:55:19 UTC (rev 47862)
@@ -1,76 +1,80 @@
-<H2>DESCRIPTION</H2>
+<h2>DESCRIPTION</h2>
-Outputs <I>3D raster</I> maps into <I>VTK-ASCII</I> format. <I>Maps</I> are
-valid 3D raster maps in the current mapset. <I>output</I> is the name of
-a VTK-ASCII file which will be written in the current working directory.
-If <I>output</I> is not specified then <B>stdout</B> is used.
-The module is sensitive to region settings (set with <em>g.region</em>).
+The module <em>r3.out.vtk</em> outputs 3D raster maps into VTK-ASCII format.
+Maps are valid 3D raster maps in the current mapset search path. The
+<em>output</em> parameter is the name of a VTK-ASCII file which will be
+written in the current working directory. If <em>output</em> is not
+specified then standard output (stdout) is used. The module is sensitive
+to region settings (set with <em>g.region</em>).
-<H2>NOTES</H2>
-This filter generates <I>structured points</I> with <I>celldata</I>
-(default) or <I>pointdata</I>. If top and bottom surfaces are requested
-a <I>unstructured grid</I> with <I>celldata</I> or a <I>structured grid</I>
-with <I>pointdata</I> is generated.
+<h2>NOTES</h2>
+This module generates <i>structured points</i> with <i>celldata</i>
+(default) or <i>pointdata</i>. If top and bottom surfaces are requested
+an <i>unstructured grid</i> with <i>celldata</i> or a <i>structured grid</i>
+with <i>pointdata</i> is generated.
This data is put in a simple VTK-ASCII file. Neither XML nor
-binary output are supported. It is possible to choose more then one G3D map
-to be written in the VTK-ASCII file. Each <I>celldata</I> is named as the
-3D raster map it represents. You can visualize this file with the
-<EM><A HREF="http://www.vtk.org">VTK Toolkit</A></EM>,
-<EM><A HREF="http://www.paraview.org">Paraview</A></EM> and
-<EM><A HREF="http://mayavi.sourceforge.net">MayaVi</A></EM> which are based on VTK.
-If you have a 3D raster map with partly no data, use the threshold filter in paraview to
-visualize the valid data. Just filter all data which is greater/lesser than the
-chosen null value in the VTK-ASCII file.
+binary output are supported. It is possible to choose more then one 3D raster
+map
+to be written in the VTK-ASCII file. Each <i>celldata</i> is named as the
+3D raster map it represents. The user can visualize this file with the
+<em><a href="http://www.vtk.org">VTK Toolkit</a></em>,
+<em><a href="http://www.paraview.org">ParaView</a></em> and
+<em><a href="http://mayavi.sourceforge.net">MayaVi</a></em> which are based on
+VTK. In case of 3D raster map with partially no data, the threshold filter in
+ParaView can be used to visualize the valid data. Just filter all data which is
+greater/lesser than the chosen null value in the VTK-ASCII file.
-<BR><BR>
-The top and bottom region settings are expected in meters.
-If a Latitude-Longitude (LL) coordinates are used, the elevation value for each voxel
-will be converted into degree.
-<BR><BR>
-The <I>input</I>, <I>rgbmaps</I> and <I>vectormaps</I> are optional,
-so only the geometry can be exported.
-<BR><BR>
-If you use <I>top</I> and <I>bottom</I> and the 2D and 3D region settings are different,
-the 2D resolution will be adjust to the 3D resolution. The elevation maps are expected
-in meters. If LL coordinates are used, the elevation will automatically converted into degree.
-If the surface and bottom maps are in a different unit than meters, use the scale parameter
-to convert them into meters.
-<BR><BR>
+<p>
+The top and bottom region values are expected in meters.
+If a Latitude-Longitude (LL) coordinates are used, the elevation value for each
+voxel will be converted into degrees.
+
+<p>
+The <em>input</em>, <em>rgbmaps</em> and <em>vectormaps</em> parameters are
+optional, so only the geometry can be exported.
+
+<p>
+If you use <i>top</i> and <i>bottom</i> and the 2D and 3D region values are
+different, the 2D resolution will be adjust to the 3D resolution. The elevation
+maps are expected in meters. If LL coordinates are used, the elevation will
+automatically converted into degree.
+If the surface and bottom maps are in a different unit than meters, use the
+scale parameter to convert them into meters.
+
+<p>
The RGB voxel data can be created from 2D raster maps (Landsat TM images)
-with <EM><A HREF="r.to.rast3.html">r.to.rast3</A></EM>. The values of the RGB maps
-must be within 0 and 255. If not, the values are automatically set
+with <em><A HREF="r.to.rast3.html">r.to.rast3</a></em>. The values of the RGB
+maps must be within 0 and 255. If not, the values are automatically set
to 0 and warnings will be printed to stderr.
-<BR><BR>
-The vector data is created from three 3D raster maps. Each map represents a vector component.
-So x, y and z components are required in this order. This data can be visualized with Glyph3d or
-StreamTracer filters within Paraview.
-<br>
-<br>
-If the <em>-c</em> flag is used and the data should be visualised together with other
-data exported via <em>*.out.vtk</em> modules, be sure the <em>-c</em> flag was also
-set in these modules. But this will only work with data from the SAME location (the
-reference point for the coordinates transformation is based on the center point of
-the default region).
-<H3>Difference between point- and celldata</H3>
+<p>
+The vector data is created from three 3D raster maps. Each map represents a
+vector component.
+So x, y and z components are required in this order. This data can be visualized
+with Glyph3d or StreamTracer filters within Paraview.
+<p>
+If the <em>-c</em> flag is used and the data should be visualised together with
+other data exported via <em>*.out.vtk</em> modules, be sure the <em>-c</em> flag
+was also set in these modules. But this will only work with data from the SAME
+location (the reference point for the coordinates transformation is based on the
+center point of the default region).
+
+<h3>Difference between point- and celldata</h3>
+
<em>r3.out.vtk</em> can export 3D raster maps with different representations.
<ul>
- <li>
- <I>pointdata</I> -- the cells/values are represented by the center of the cell.
- Instead of cells, points are created. Each point can hold different values,
- but the user can only visualize one value at a time.
- </li>
- <li>
- <I>celldata</I>
- The cells are created with the same hight, width and depth as in GRASS. Each cell
- can hold different values, but the user can only visualize one value at a time.
- </li>
+<li> <I>pointdata</I> -- the cells/values are represented by the center of the
+cell. Instead of cells, points are created. Each point can hold different
+values, but the user can only visualize one value at a time. </li>
+<li> <I>celldata</I> The cells are created with the same hight, width and depth
+as in GRASS. Each cell can hold different values, but the user can only
+visualize one value at a time. </li>
</ul>
-<H2>EXAMPLE</H2>
+<h2>EXAMPLE</h2>
-<H3>Simple Spearfish example</H3>
+<h3>Simple Spearfish example</h3>
<div class="code"><pre>
g.region -d
@@ -87,7 +91,7 @@
paraview --data=/tmp/out.vtk
</pre></div>
-<H3>Spearfish example with RGB data</H3>
+<h3>Spearfish example with RGB data</h3>
<div class="code"><pre>
#set the region
@@ -111,13 +115,14 @@
r.to.rast3 input=SatLandsatTM_IR2 output=SatLandsatTM_IR2
#export of volume to VTK:
-r3.out.vtk -s rgbmaps=SatLandsatTM_IR1,SatLandsatTM_IR2,SatLandsatTM_Red input=map3d top=elevation.10m bottom=bottom output=/tmp/out.vtk
+r3.out.vtk -s rgbmaps=SatLandsatTM_IR1,SatLandsatTM_IR2,SatLandsatTM_Red
+input=map3d top=elevation.10m bottom=bottom output=/tmp/out.vtk
# visualize in paraview or other VTK viewer:
paraview --data=/tmp/out.vtk
</pre></div>
-<H3>Spearfish example with vector data</H3>
+<h3>Spearfish example with vector data</h3>
<div class="code"><pre>
# set the region
@@ -137,7 +142,8 @@
# export the stuff data to VTK:
-r3.out.vtk -s vectormaps=x_part,y_part,z_part input=map3d top=elevation.10m bottom=bottom output=/tmp/out.vtk
+r3.out.vtk -s vectormaps=x_part,y_part,z_part input=map3d top=elevation.10m
+bottom=bottom output=/tmp/out.vtk
# visualize in paraview or other VTK viewer:
paraview --data=/tmp/out.vtk
@@ -145,7 +151,7 @@
</pre></div>
-<H3>Slovakia3d example</H3>
+<h3>Slovakia3d example</h3>
<div class="code"><pre>
#reduce resolution:
@@ -153,7 +159,8 @@
r.mapcalc "bottom=100"
#export of volume to VTK:
-r3.out.vtk -s in=precip3d.500z50 top=dem500 bottom=bottom out=/tmp/slovakia3d.vtk
+r3.out.vtk -s in=precip3d.500z50 top=dem500 bottom=bottom
+out=/tmp/slovakia3d.vtk
# visualize in paraview or other VTK viewer:
paraview --data=/tmp/slovakia3d.vtk
@@ -161,14 +168,13 @@
# set Actor Control z to 10
</pre></div>
+<h2>SEE ALSO</h2>
-<H2>SEE ALSO</H2>
+<em><A HREF="r.out.vtk.html">r.out.vtk</a></em>,
+<em><A HREF="r3.out.ascii.html">r3.out.ascii</a></em>,
+<em><A HREF="g.region.html">g.region</a></em>
-<EM><A HREF="r.out.vtk.html">r.out.vtk</A></EM><br>
-<EM><A HREF="r3.out.ascii.html">r3.out.ascii</A></EM><br>
-<EM><A HREF="g.region.html">g.region</A></EM><br>
-
-<H2>AUTHOR</H2>
+<h2>AUTHOR</h2>
Soeren Gebbert
<p><i>Last changed: $Date$</i>
Modified: grass/branches/develbranch_6/raster3d/r3.out.vtk/main.c
===================================================================
--- grass/branches/develbranch_6/raster3d/r3.out.vtk/main.c 2011-08-23 21:55:06 UTC (rev 47861)
+++ grass/branches/develbranch_6/raster3d/r3.out.vtk/main.c 2011-08-23 21:55:19 UTC (rev 47862)
@@ -89,7 +89,7 @@
{
int fd;
- G_debug(3, "Open Raster file %s in Mapset %s", name, mapset);
+ G_debug(3, "Open raster file %s in mapset %s", name, mapset);
/* open raster map */
@@ -116,6 +116,7 @@
if (!param.top->answer || !param.bottom->answer)
G3d_fatalError(_("You have to specify top and bottom map"));
+ G3d_fatalError(_("Specify top and bottom map"));
mapset = NULL;
name = NULL;
@@ -140,7 +141,7 @@
if (param.input->answers != NULL) {
for (i = 0; param.input->answers[i] != NULL; i++) {
if (NULL == G_find_grid3(param.input->answers[i], ""))
- G3d_fatalError(_("Requested 3d raster map <%s> not found"),
+ G3d_fatalError(_("3D raster map <%s> not found"),
param.input->answers[i]);
}
}
@@ -150,11 +151,11 @@
for (i = 0; i < 3; i++) {
if (param.rgbmaps->answers[i] != NULL) {
if (NULL == G_find_grid3(param.rgbmaps->answers[i], ""))
- G3d_fatalError(_("Requested g3d RGB map <%s> not found"),
+ G3d_fatalError(_("3D raster map <%s> not found"),
param.rgbmaps->answers[i]);
}
else {
- G3d_fatalError(_("Please provide three g3d RGB maps"));
+ G3d_fatalError(_("Please provide three RGB 3D raster maps"));
}
}
}
@@ -164,18 +165,18 @@
for (i = 0; i < 3; i++) {
if (param.vectormaps->answers[i] != NULL) {
if (NULL == G_find_grid3(param.vectormaps->answers[i], ""))
- G3d_fatalError(_("Requested g3d vector map <%s> not found"),
+ G3d_fatalError(_("3D vector map <%s> not found"),
param.vectormaps->answers[i]);
}
else {
- G3d_fatalError(_("Please provide three g3d vector maps [x,y,z]"));
+ G3d_fatalError(_("Please provide three G3D vector maps [x,y,z]"));
}
}
}
if (param.input->answers == NULL && param.rgbmaps->answers == NULL &&
param.vectormaps->answers == NULL) {
- G_warning(_("No g3d data, RGB or xyz-vector maps are provided! Will only write the geometry."));
+ G_warning(_("No 3D raster data, RGB or xyz-vector maps are provided. Will only write the geometry"));
}
return;
@@ -195,7 +196,7 @@
/*Loop over all input maps! */
for (i = 0; i < 3; i++) {
- G_debug(3, _("Open rgb 3d raster map %s"),
+ G_debug(3, "Open RGB 3D raster map <%s>",
param.rgbmaps->answers[i]);
maprgb = NULL;
@@ -206,9 +207,9 @@
®ion, G3D_TILE_SAME_AS_FILE,
G3D_USE_CACHE_DEFAULT);
if (maprgb == NULL) {
- G_warning(_("Error opening 3d raster map <%s>"),
+ G_warning(_("Unable to open 3D raster map <%s>"),
param.rgbmaps->answers[i]);
- fatal_error(_("No RGB Data will be created."), in);
+ fatal_error(_("No RGB Data will be created"), in);
}
/*if requested set the Mask on */
@@ -251,7 +252,7 @@
}
/* Close the 3d raster map */
if (!G3d_closeCell(maprgb)) {
- fatal_error(_("Error closing g3d rgb map."), in);
+ fatal_error(_("Unable to close 3D raster map"), in);
}
/*Set the pointer to null so we noe later that these files are already closed */
@@ -279,7 +280,7 @@
/*Loop over all input maps! */
for (i = 0; i < 3; i++) {
- G_debug(3, "Open vector 3d raster map %s",
+ G_debug(3, "Open vector 3D raster map <%s>",
param.vectormaps->answers[i]);
mapvect = NULL;
@@ -290,9 +291,9 @@
""), ®ion,
G3D_TILE_SAME_AS_FILE, G3D_USE_CACHE_DEFAULT);
if (mapvect == NULL) {
- G_warning(_("Error opening 3d raster map <%s>"),
+ G_warning(_("Unable to open 3D raster map <%s>"),
param.vectormaps->answers[i]);
- fatal_error(_("No vector data will be created."), in);
+ fatal_error(_("No vector data will be created"), in);
}
/*if requested set the Mask on */
@@ -336,7 +337,7 @@
/* Close the 3d raster map */
if (!G3d_closeCell(mapvect)) {
- fatal_error(_("Error closing g3d vector map."), in);
+ fatal_error(_("Unable to close 3D raster map"), in);
}
/*Set the pointer to null so we noe later that these files are already closed */
if (i == 0)
@@ -505,7 +506,7 @@
if (param.input->answers != NULL) {
for (i = 0; param.input->answers[i] != NULL; i++) {
- G_debug(3, "Open 3d raster map %s", param.input->answers[i]);
+ G_debug(3, "Open 3D raster map <%s>", param.input->answers[i]);
/*Open the map */
in->map =
@@ -514,7 +515,7 @@
®ion, G3D_TILE_SAME_AS_FILE,
G3D_USE_CACHE_DEFAULT);
if (in->map == NULL) {
- G_warning(_("Error opening 3d raster map <%s>"),
+ G_warning(_("Unable to open 3D raster map <%s>"),
param.input->answers[i]);
fatal_error(" ", in);
}
@@ -543,7 +544,7 @@
/* Close the 3d raster map */
if (!G3d_closeCell(in->map)) {
in->map = NULL;
- fatal_error(_("Error closing 3d raster map, the VTK file may be incomplete."),
+ fatal_error(_("Unable to close 3D raster map, the VTK file may be incomplete"),
in);
}
@@ -558,7 +559,7 @@
/*Close the output file */
if (param.output->answer && fp != NULL)
if (fclose(fp))
- fatal_error(_("Error closing VTK-ASCII file"), in);
+ fatal_error(_("Unable to close VTK-ASCII file"), in);
/*close all open maps and free memory */
release_input_maps_struct(in);
Modified: grass/branches/develbranch_6/raster3d/r3.out.vtk/parameters.c
===================================================================
--- grass/branches/develbranch_6/raster3d/r3.out.vtk/parameters.c 2011-08-23 21:55:06 UTC (rev 47861)
+++ grass/branches/develbranch_6/raster3d/r3.out.vtk/parameters.c 2011-08-23 21:55:19 UTC (rev 47862)
@@ -79,7 +79,7 @@
param.rgbmaps->multiple = YES;
param.rgbmaps->guisection = "Advanced options";
param.rgbmaps->description =
- _("Three (r,g,b) 3d raster maps to create rgb values [redmap,greenmap,bluemap]");
+ _("Three (R,G,B) 3D raster maps to create RGB values [redmap,greenmap,bluemap]");
param.vectormaps = G_define_option();
param.vectormaps->key = "vectormaps";
@@ -89,7 +89,7 @@
param.vectormaps->multiple = YES;
param.vectormaps->guisection = "Advanced options";
param.vectormaps->description =
- _("Three (x,y,z) 3d raster maps to create vector values [xmap,ymap,zmap]");
+ _("Three (x,y,z) 3D raster maps to create vector values [xmap,ymap,zmap]");
param.elevscale = G_define_option();
@@ -114,7 +114,7 @@
param.mask = G_define_flag();
param.mask->key = 'm';
param.mask->guisection = "Advanced options";
- param.mask->description = _("Use g3d mask (if exists) with input maps");
+ param.mask->description = _("Use 3D raster mask (if exists) with input maps");
param.origin = G_define_flag();
param.origin->key = 'o';
Modified: grass/branches/develbranch_6/raster3d/r3.out.vtk/writeVTKData.c
===================================================================
--- grass/branches/develbranch_6/raster3d/r3.out.vtk/writeVTKData.c 2011-08-23 21:55:06 UTC (rev 47861)
+++ grass/branches/develbranch_6/raster3d/r3.out.vtk/writeVTKData.c 2011-08-23 21:55:19 UTC (rev 47862)
@@ -128,11 +128,11 @@
status++;
if (!G_get_raster_row(in->top, rast_top, y, in->topMapType))
- fatal_error(_("Could not get top raster row \n"), in);
+ fatal_error(_("Unable to read top raster row \n"), in);
if (!G_get_raster_row
(in->bottom, rast_bottom, y, in->bottomMapType))
- fatal_error(_("Could not get bottom raster row \n"), in);
+ fatal_error(_("Unable to read bottom raster row \n"), in);
for (x = 0, ptr_top = rast_top, ptr_bottom = rast_bottom;
x < cols;
@@ -331,7 +331,7 @@
}
G_debug(3,
- _("write_vtk_data: Writing Celldata %s with rows %i cols %i depths %i to vtk-ascii file"),
+ "write_vtk_data: Writing Celldata <%s> with rows <%i> cols <%i> depths <%i> to VTK-ASCII file",
varname, rows, cols, depths);
fprintf(fp, "SCALARS %s float 1\n", varname);
@@ -389,7 +389,7 @@
int typeIntern[3];
void *maprgb = NULL;
- G_debug(3, _("write_vtk_rgb_data: writing rgb data"));
+ G_debug(3, "write_vtk_rgb_data: Writing RGB data");
rows = region.rows;
cols = region.cols;
@@ -426,7 +426,7 @@
0.0);
/*Test of value range, the data should be 1 byte gray values */
if (value > 255 || value < 0) {
- G_warning(_("Wrong 3d raster map values! Values should in between 0 and 255!\n"));
+ G_warning(_("Wrong 3D raster map values: Values should in between 0 and 255\n"));
fprintf(fp, "0 ");
}
else {
@@ -459,7 +459,7 @@
0.0);
/*Test of value range, the data should be 1 byte gray values */
if (value > 255 || value < 0) {
- G_warning(_("Wrong 3d raster map values! Values should in between 0 and 255!\n"));
+ G_warning(_("Wrong 3D raster map values: Values should in between 0 and 255\n"));
fprintf(fp, "0 ");
}
else {
@@ -489,7 +489,7 @@
int typeIntern[3];
void *mapvect = NULL;
- G_debug(3, _("write_vtk_vector_data: writing vector data"));
+ G_debug(3, "write_vtk_vector_data: Writing vector data");
rows = region.rows;
cols = region.cols;
More information about the grass-commit
mailing list