<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://grasswiki.osgeo.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=%E2%9A%A0%EF%B8%8FJentjr</id>
	<title>GRASS-Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://grasswiki.osgeo.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=%E2%9A%A0%EF%B8%8FJentjr"/>
	<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/wiki/Special:Contributions/%E2%9A%A0%EF%B8%8FJentjr"/>
	<updated>2026-05-26T07:46:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=R.basin&amp;diff=15993</id>
		<title>R.basin</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=R.basin&amp;diff=15993"/>
		<updated>2012-06-21T22:19:01Z</updated>

		<summary type="html">&lt;p&gt;⚠️Jentjr: /* Preparation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The module {{AddonCmd|r.basin}} has been designed to perform the delineation and the morphometric characterization of a given basin, on the basis of an elevation raster map and the coordinates of the outlet. &lt;br /&gt;
Please note that it is designed to work only in projected coordinates.&lt;br /&gt;
Here a tutorial based on NC sample dataset is presented.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
&lt;br /&gt;
As a first step, we set the computational region to match the elevation raster map:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
g.region rast=elevation@PERMANENT -ap&lt;br /&gt;
projection: 99 (Lambert Conformal Conic)&lt;br /&gt;
zone:       0&lt;br /&gt;
datum:      nad83&lt;br /&gt;
ellipsoid:  a=6378137 es=0.006694380022900787&lt;br /&gt;
north:      228500&lt;br /&gt;
south:      215000&lt;br /&gt;
west:       630000&lt;br /&gt;
east:       645000&lt;br /&gt;
nsres:      10&lt;br /&gt;
ewres:      10&lt;br /&gt;
rows:       1350&lt;br /&gt;
cols:       1500&lt;br /&gt;
cells:      2025000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the basin's delineation, a pair of coordinates is required. Usually coordinates belonging to the natural river network don't exactly match with the calculated stream network. What we should do is calculate the stream network first, and then find the coordinates on the calculated stream network closest to the coordinates belonging to the natural stream network.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Calculate flow accumulation map&lt;br /&gt;
r.watershed -a elevation=elevation@PERMANENT accumulation=accum&lt;br /&gt;
&lt;br /&gt;
# Extract the stream network&lt;br /&gt;
r.stream.extract elevation=elevation@PERMANENT accumulation=accum@testing threshold=20 stream_rast=stream_network stream_vect=streams&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We no longer need the accumulation map:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
g.remove rast=accum&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that we have the calculated stream network, we should choose a pair of coordinates for the outlet belonging to it. Let's choose:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
easting=636654.791181 northing=218824.126649&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We no longer need the stream network map:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
g.remove rast=stream_network&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Preparation for multiple basins' analysis ==&lt;br /&gt;
&lt;br /&gt;
If there are a lot of basins to be analysed, the coordinate pairs of the intersections between the calculated stream network and basins (outlet points) can be found by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Convert basins polygon vector boundaries to lines&lt;br /&gt;
v.type input=basinspoly output=basinsline type=boundary,line&lt;br /&gt;
&lt;br /&gt;
# Patch basins lines with stream network&lt;br /&gt;
v.patch input=basinsline,streams output=basins_streams&lt;br /&gt;
&lt;br /&gt;
# Find cross points at intersections&lt;br /&gt;
v.clean input=basins_streams output=basins_streams_clean error=crosspoints_err tool=break&lt;br /&gt;
&lt;br /&gt;
# Add categories to cross points vector&lt;br /&gt;
v.category input=crosspoints_err output=crosspoints&lt;br /&gt;
&lt;br /&gt;
# Add table to cross points vector with columns for category, x and y coordinates&lt;br /&gt;
v.db.addtable map=crosspoints columns=&amp;quot;cat integer,xcoor double precision, ycoor double precision&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Upload category to cross points attribute table&lt;br /&gt;
v.to.db map=crosspoints option=cat columns=cat&lt;br /&gt;
&lt;br /&gt;
# Upload x and y coordinates to cross points attribute table&lt;br /&gt;
v.to.db map=crosspoints option=coor columns=xcoor,ycoor&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point we can create a text file called ''crosspoints'' with the coordinates in this form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xcoor1 ycoor1&lt;br /&gt;
xcoor2 ycoor2&lt;br /&gt;
xcoor3 ycoor3&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can parse this coordinates file in order to create a new file called ''commands'' in which we'll have the r.basin commands for each sub-watershed, ready to be run in a GRASS session. Let's create a script in python for parsing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env python&lt;br /&gt;
&lt;br /&gt;
# Open the ''crosspoints'' text file to read the coordinates&lt;br /&gt;
fin = open(&amp;quot;crosspoints&amp;quot;,&amp;quot;r&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Create the ''commands'' text file&lt;br /&gt;
fout = open(&amp;quot;commands&amp;quot;,&amp;quot;w&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Read the ''crosspoints'' lines&lt;br /&gt;
linesout = (line.rstrip().split() for line in fin)&lt;br /&gt;
&lt;br /&gt;
# Build the r.basin command &lt;br /&gt;
# Put your threshold parameter instead of threshold=10000 and the name of your DEM instead of map=elevation&lt;br /&gt;
cmd = 'r.basin map=elevation prefix=bas%s easting=%s northing=%s threshold=10000\n'&lt;br /&gt;
&lt;br /&gt;
# Write the file ''commands''&lt;br /&gt;
fout.writelines(cmd % (n, easting, northing) for n,(easting,northing) in enumerate(linesout))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a Python script, it is supposed to run externally from GRASS GIS. Save this script as ''parsing.py'' in a separate folder on your Desktop, and put the file ''crosspoints'' in such folder. To run it, open a terminal and type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd yourfolder&lt;br /&gt;
python parsing.py&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now in the same folder you will find the file ''commands'', in which we have the r.basin commands to run in GRASS.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
We can run r.basin:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
r.basin map=elevation@PERMANENT prefix=out easting=636654.791181 northing=218824.126649 threshold=20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prefix parameter is a string given by the user in order to distinguish all the maps produced by every run of the program, i.e. every set of outlet's coordinates. Prefix must start with a letter.&lt;br /&gt;
&lt;br /&gt;
Threshold is the same parameter given in r.watershed and r.stream.extract. Physically, it means the number of cells that determine &amp;quot;where the river begins&amp;quot;. (This is an open issue for the hydrological science and a wide literature has been produced on the topic). Threshold value is usually determined by trials and errors. r.basin has a flag -a, which uses an authomatic value of threshold, corresponding to 1km^2. Such value comes from literature and is usually suitable for Italian territory, but could be definitely wrong for other territories.&lt;br /&gt;
In order to determine the threshold, see also {{AddonCmd|r.threshold}} and {{AddonCmd|r.stream.preview}}.&lt;br /&gt;
&lt;br /&gt;
The output of r.basin consists of: &lt;br /&gt;
&lt;br /&gt;
* Several morphometric parameters, which are printed in terminal and also stored in a csv file called out_elevation_parameters.csv, in the working directory;&lt;br /&gt;
* Maps;&lt;br /&gt;
* Plots.&lt;br /&gt;
&lt;br /&gt;
== Morphometric parameters ==&lt;br /&gt;
&lt;br /&gt;
The main parameters are:&lt;br /&gt;
&lt;br /&gt;
* The coordinates of the vertices of the '''rectangle containing the basin'''.&lt;br /&gt;
* The '''center of gravity''' of the basin: the coordinates of the pixel nearest to the center of gravity of the geometric figure resulting from the projection of the basin on the horizontal plane.&lt;br /&gt;
* The '''area''' of the basin: is the area of a single cell multiplied by the number of cells belonging to the basin.&lt;br /&gt;
* The '''perimeter''': is the length of the contour of the figure resulting by the projection of the basin on the horizontal plane.&lt;br /&gt;
[As a side note, a paper namely [http://en.wikipedia.org/wiki/How_Long_Is_the_Coast_of_Britain%3F_Statistical_Self-Similarity_and_Fractional_Dimension &amp;quot;How Long Is the Coast of Britain? Statistical Self-Similarity and Fractional Dimension&amp;quot;] points out that perimeter is affected by a fractal problem and the number is mostly meaningless taken by itself. Hence, perimeter should never be mixed with anything from another dataset or even the same data set at a different cell resolution; it is only good as a percentage comparison to its neighbors in the same dataset].&lt;br /&gt;
* '''Characteristic values of elevation''': the highest and the lowest altitude, the difference between them and the mean elevation calculated as the sum of the values of the cells divided by the number of the cells.&lt;br /&gt;
* The '''mean slope''', calculated averaging the slope map.&lt;br /&gt;
* The '''length of the directing vector''': the length of the vector linking the outlet to the center of gravity of the basin.&lt;br /&gt;
* The '''prevalent orientation''':  in GRASS the aspect categories represent the number degrees of east and they increase counterclockwise: (90deg is North, 180 is West, 270 is South 360 is East). The aspect value 0 is used to indicate undefined aspect in flat areas with slope=0. We instead calculate the orientation as the number of degree from north, increasing counterclockwise.&lt;br /&gt;
* The '''length of main channel''': is the length of the longest succession of segments that connect a source to the outlet of the basin.&lt;br /&gt;
* The '''mean slope of main channel''': it is calculated as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:R.basin1.gif]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where N is the topological diameter, i.e. the number of links in which the main channel can be divided on the basis of the junctions.&lt;br /&gt;
* The '''circularity ratio''': is the ratio between the area of the basin and the area of the circle having the same perimeter of the basin.&lt;br /&gt;
* The '''elongation ratio''': is the ratio between the diameter of the circle having the same area of the basin and the length of the main channel.&lt;br /&gt;
* The '''compactness coefficient''': is the ratio between the perimeter of the basin and the diameter of the circle having the same area of the basin.&lt;br /&gt;
* The '''shape factor''': is the ratio between the area of the basin and the square of the length of the main channel.&lt;br /&gt;
* The '''concentration time''' (Giandotti, 1934):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[[File:R.basin2.gif]]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where A is the area, L the length of the main channel and H the difference between the highest and the lowest elevation of the basin.&lt;br /&gt;
* The '''mean hillslope length''': is the mean of the distances calculated along the flow direction of each point non belonging to the river network from the point in which flows into the network.&lt;br /&gt;
* The '''magnitudo''': is the number of the branches of order 1 following the Strahler hierarchy.&lt;br /&gt;
* The '''max order''': is the order of the basin, following the Strahler hierarchy.&lt;br /&gt;
* The '''number of streams''': is the number of the branches of the river network.&lt;br /&gt;
* The '''total stream length''': is the sum of the length of every branches.&lt;br /&gt;
* The '''first order stream frequency''': is the ratio between the magnitudo and the area of the basin.&lt;br /&gt;
* The '''drainage density''': is the ratio between the total length of the river network and the area.&lt;br /&gt;
* The '''Horton ratios''' (Horton, 1945; Strahler, 1957).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
##################################&lt;br /&gt;
Morphometric parameters of basin :&lt;br /&gt;
##################################&lt;br /&gt;
Easting Centroid of basin : 635195.00&lt;br /&gt;
Northing Centroid of Basin : 220715.00&lt;br /&gt;
Rectangle containing basin N-W : 632870 , 222890&lt;br /&gt;
Rectangle containing basin S-E : 637000 , 218720&lt;br /&gt;
Area of basin [km^2] : 7.8559625&lt;br /&gt;
Perimeter of basin [km] : 16.8287990515&lt;br /&gt;
Max Elevation [m s.l.m.] : 151.7396&lt;br /&gt;
Min Elevation [m s.l.m.]: 94.82206&lt;br /&gt;
Elevation Difference [m]: 56.91754&lt;br /&gt;
Mean Elevation [m s.l.m.]: 127.6772&lt;br /&gt;
Mean Slope : 2.93&lt;br /&gt;
Length of Directing Vector [km] : 2.38880562659&lt;br /&gt;
Prevalent Orientation [degree from north, counterclockwise] :&lt;br /&gt;
0.913351005341&lt;br /&gt;
Compactness Coefficient : 5.32106255399&lt;br /&gt;
Circularity Ratio : 0.348580442132&lt;br /&gt;
Topological Diameter : 127.0&lt;br /&gt;
Elongation Ratio : 0.470961456397&lt;br /&gt;
Shape Factor : 1.16984953656&lt;br /&gt;
Concentration Time (Giandotti, 1934) [hr] : 3.52654267443&lt;br /&gt;
Length of Mainchannel [km] : 6.715361467&lt;br /&gt;
Mean slope of mainchannel [percent] : 0.957339&lt;br /&gt;
Mean hillslope length [m] : 8145.381&lt;br /&gt;
Magnitudo : 621.0&lt;br /&gt;
Max order (Strahler) : 5&lt;br /&gt;
Number of streams : 884&lt;br /&gt;
Total Stream Length [km] : 96.3436&lt;br /&gt;
First order stream frequency : 79.0482388377&lt;br /&gt;
Drainage Density [km/km^2] : 12.2637550778&lt;br /&gt;
Bifurcation Ratio (Horton) : 5.7374&lt;br /&gt;
Length Ratio (Horton) : 2.6902&lt;br /&gt;
Area ratio (Horton) : 5.6815&lt;br /&gt;
Slope ratio (Horton): 1.5533&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''hypsographic curve''' provides the distribution of the areas at different altitudes. Each point on the hypsographic curve has on the y-axis the altitude and on the x-axis the percentage of basin surface placed above that altitude. The '''ipsometric curve''' has the same shape but is dimensionless.&lt;br /&gt;
Quantiles of the ipsometric curve are displayed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tot. cells 78560.0&lt;br /&gt;
===========================&lt;br /&gt;
Ipsometric | quantiles&lt;br /&gt;
===========================&lt;br /&gt;
145 | 0.025&lt;br /&gt;
143 | 0.05&lt;br /&gt;
141 | 0.1&lt;br /&gt;
137 | 0.25&lt;br /&gt;
129 | 0.5&lt;br /&gt;
119 | 0.75&lt;br /&gt;
121 | 0.7&lt;br /&gt;
110 | 0.9&lt;br /&gt;
100 | 0.975&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The '''width function W(x)''' gives the area of the cells in the basin at a certain flow distance x from the outlet (distance-area function). Note that the distance is not intended in the euclidean sense, but it's calculated considering the hydrological path of the water.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tot. cells 78560.0&lt;br /&gt;
Tot. area 7856000.0&lt;br /&gt;
Max distance 6809.546521&lt;br /&gt;
===========================&lt;br /&gt;
Whidth Function | quantiles&lt;br /&gt;
===========================&lt;br /&gt;
784 | 0.05&lt;br /&gt;
1477 | 0.15&lt;br /&gt;
2137 | 0.3&lt;br /&gt;
2543 | 0.4&lt;br /&gt;
2933 | 0.5&lt;br /&gt;
3606 | 0.6&lt;br /&gt;
4169 | 0.7&lt;br /&gt;
5144 | 0.85&lt;br /&gt;
6105 | 0.95&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output of r.stream.stats is also displayed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
Summary:&lt;br /&gt;
Max order | Tot.N.str. | Tot.str.len. | Tot.area. | Dr.dens. | Str.freq. &lt;br /&gt;
  (num)   |    (num)   |     (km)     |   (km2)   | (km/km2) | (num/km2) &lt;br /&gt;
        5 |        884 |      96.3436 |    7.8339 |  12.2983 | 112.8429 &lt;br /&gt;
&lt;br /&gt;
Stream ratios with standard deviations:&lt;br /&gt;
 Bif.rt. | Len.rt. | Area.rt. | Slo.rt. | Grd.rt. &lt;br /&gt;
  5.7374 |  2.6902 |   5.6815 |  1.5533 |  1.7962&lt;br /&gt;
  3.1961 |  1.9514 |   5.2294 |  0.1250 |  0.7482&lt;br /&gt;
&lt;br /&gt;
Order | Avg.len |  Avg.ar  |  Avg.sl |  Avg.grad. | Avg.el.dif&lt;br /&gt;
 num  |   (km)  |  (km2)   |  (m/m)  |    (m/m)   |     (m)   &lt;br /&gt;
    1 |  0.0750 |   0.0069 |  0.0523 |     0.0384 |  3.1062&lt;br /&gt;
    2 |  0.1428 |   0.0311 |  0.0342 |     0.0277 |  4.1701&lt;br /&gt;
    3 |  0.4834 |   0.1732 |  0.0243 |     0.0205 |  9.0641&lt;br /&gt;
    4 |  2.4205 |   2.1885 |  0.0155 |     0.0134 | 24.1708&lt;br /&gt;
    5 |  1.1247 |   7.8339 |  0.0091 |     0.0046 |  5.1594&lt;br /&gt;
&lt;br /&gt;
Order | Std.len |  Std.ar  |  Std.sl |  Std.grad. | Std.el.dif&lt;br /&gt;
 num  |   (km)  |  (km2)   |  (m/m)  |    (m/m)   |     (m)   &lt;br /&gt;
    1 |  0.0600 |   0.0052 |  0.0398 |     0.0287 |  3.2301&lt;br /&gt;
    2 |  0.1244 |   0.0230 |  0.0250 |     0.0196 |  4.4835&lt;br /&gt;
    3 |  0.4554 |   0.1353 |  0.0132 |     0.0122 |  7.1065&lt;br /&gt;
    4 |  2.2874 |   2.3843 |  0.0046 |     0.0061 | 12.9175&lt;br /&gt;
    5 |  0.0000 |   0.0000 |  0.0000 |     0.0000 |  0.0000&lt;br /&gt;
&lt;br /&gt;
Order | N.streams | Tot.len (km) | Tot.area (km2)&lt;br /&gt;
    1 |       712 |      53.4067 |  4.8998&lt;br /&gt;
    2 |       137 |      19.5657 |  4.2562&lt;br /&gt;
    3 |        31 |      14.9849 |  5.3684&lt;br /&gt;
    4 |         3 |       7.2616 |  6.5655&lt;br /&gt;
    5 |         1 |       1.1247 |  7.8339&lt;br /&gt;
&lt;br /&gt;
Order | Bif.rt. | Len.rt. | Area.rt. | Slo.rt. | Grd.rt. | d.dens. | str.freq.&lt;br /&gt;
    1 |  5.1971 |  1.9040 |   0.0000 |  1.5311 |  1.3892 | 10.8998 | 145.3120&lt;br /&gt;
    2 |  4.4194 |  3.3847 |   4.5144 |  1.4046 |  1.3472 |  4.5970 | 32.1883&lt;br /&gt;
    3 | 10.3333 |  5.0075 |   5.5742 |  1.5691 |  1.5365 |  2.7913 |  5.7745&lt;br /&gt;
    4 |  3.0000 |  0.4646 |  12.6376 |  1.7083 |  2.9120 |  1.1060 |  0.4569&lt;br /&gt;
    5 |  0.0000 |  0.0000 |   3.5796 |  0.0000 |  0.0000 |  0.1436 |  0.1277&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Maps ==&lt;br /&gt;
&lt;br /&gt;
Since r.basin performs the delimitation of the river basin, all the maps produced are cropped over the basin. They are:&lt;br /&gt;
&lt;br /&gt;
* Raster maps&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
g.list rast&lt;br /&gt;
&lt;br /&gt;
out_elevation_accumulation              out_elevation_hillslope_distance&lt;br /&gt;
out_elevation_aspect                    out_elevation_horton&lt;br /&gt;
out_elevation_dist2out                  out_elevation_shreve&lt;br /&gt;
out_elevation_drainage                  out_elevation_slope&lt;br /&gt;
out_elevation_hack                      out_elevation_strahler&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;gallery perrow=3 widths=200&amp;gt;&lt;br /&gt;
&lt;br /&gt;
File:Out_elevation_accumulation.png|Flow accumulation&lt;br /&gt;
File:Out_elevation_aspect.png|Aspect&lt;br /&gt;
File:Out_elevation_dist2out.png|Distance to outlet (width function)&lt;br /&gt;
File:Out_elevation_drainage.png|Flow direction&lt;br /&gt;
File:Out_elevation_hack.png|Stream network ordered according to Hack&lt;br /&gt;
File:Out_elevation_hillslope_distance.png|Length of hillslopes&lt;br /&gt;
File:Out_elevation_horton.png|Stream network ordered according to Horton&lt;br /&gt;
File:Out_elevation_shreve.png|Stream network ordered according to Shreve&lt;br /&gt;
File:Out_elevation_slope.png|Slope&lt;br /&gt;
File:Out_elevation_strahler.png|Stream network ordered according to Strahler&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Vector maps&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
g.list vect&lt;br /&gt;
&lt;br /&gt;
out_elevation_basin       out_elevation_network&lt;br /&gt;
out_elevation_mainchannel out_elevation_outlet&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;gallery perrow=4 widths=200&amp;gt;&lt;br /&gt;
&lt;br /&gt;
File:Out_elevation_basin.png|Basin&lt;br /&gt;
File:Out_elevation_mainchannel.png|Main channel&lt;br /&gt;
File:Out_elevation_network.png|Stream network&lt;br /&gt;
File:Out_elevation_outlet.png|Outlet&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Plots ==&lt;br /&gt;
&lt;br /&gt;
Plots are stored in the working directory:&lt;br /&gt;
&lt;br /&gt;
* out_elevation_ipsographic.png&lt;br /&gt;
* out_elevation_ipsometric.png&lt;br /&gt;
* out_elevation_width_function.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
&amp;lt;gallery perrow=3 widths=200&amp;gt;&lt;br /&gt;
&lt;br /&gt;
File:Out_elevation_Ipsographic.png|Ipsographic curve&lt;br /&gt;
File:Out_elevation_Ipsometric.png|Ipsometric curve (Nondimensional ipsographic curve)&lt;br /&gt;
File:Out_elevation_width_function.png|Width function&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
[[R.stream.*]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* Di Leo Margherita, Working report: Extraction of morphometric parameters from a digital elevation model - Panama. North Carolina State University, 2010 ([http://dl.dropbox.com/u/1599323/Report_Panama.pdf PDF])&lt;br /&gt;
* Rodriguez-Iturbe I., Rinaldo A.; Fractal River Basins, Chance and Self-Organization. Cambridge Press, 2001.&lt;br /&gt;
* Di Leo M., Di Stefano M., Claps P., Sole A. Caratterizzazione morfometrica del bacino idrografico in GRASS GIS (Morphometric characterization of the catchment in GRASS GIS environment), Geomatics Workbooks n.9, 2010. ([http://geomatica.como.polimi.it/workbooks/n9/GW9-FOSS4Git_2010.pdf PDF]).&lt;br /&gt;
&lt;br /&gt;
[[Category: Documentation]]&lt;br /&gt;
[[Category: Hydrology]]&lt;/div&gt;</summary>
		<author><name>⚠️Jentjr</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=GRASS_messages_translation&amp;diff=15977</id>
		<title>GRASS messages translation</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=GRASS_messages_translation&amp;diff=15977"/>
		<updated>2012-06-19T19:37:47Z</updated>

		<summary type="html">&lt;p&gt;⚠️Jentjr: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Help page translations ==&lt;br /&gt;
&lt;br /&gt;
* For translations of full help (man) pages see [[Updating GRASS Documentation#Translations]]&lt;br /&gt;
&lt;br /&gt;
== GRASS messages translation project ==&lt;br /&gt;
&lt;br /&gt;
Many users prefer to use software in their mother tongue which is mostly not English. This requires that all GRASS software messages have to be translated to languages other than English. The GRASS Development Team is seeking translators. Please subscribe to the dedicated mailing list at&lt;br /&gt;
&lt;br /&gt;
     GRASS translations mailing list&lt;br /&gt;
     http://lists.osgeo.org/mailman/listinfo/grass-translations&lt;br /&gt;
&lt;br /&gt;
Translation related issues may be discussed there. This is an opportunity for non-programmers to contribute as messages can be easily translated. No programming skills required!&lt;br /&gt;
&lt;br /&gt;
* Join the [[GRASS_Translation_Team#Members_of_Translation_Team|team]]&lt;br /&gt;
&lt;br /&gt;
=== Wanted languages ===&lt;br /&gt;
&lt;br /&gt;
Simple Chinese, Swahili, Hindi, Greek, Tamil, Russian, Telugu, Português, ... Please join us!&lt;br /&gt;
&lt;br /&gt;
== How to change the language ==&lt;br /&gt;
&lt;br /&gt;
* see [[GRASS_messages_translation#Testing_different_languages|Testing different languages]] below.&lt;br /&gt;
&lt;br /&gt;
== How to create new translations ==&lt;br /&gt;
&lt;br /&gt;
* For terminology, please refer to the [[GRASS Translation Glossary]].&lt;br /&gt;
&lt;br /&gt;
=== Files ===&lt;br /&gt;
In GRASS, we have 4 types of .po files per language (see in the source code the directory locale/po/):&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;grasslibs_LANG.po&amp;lt;/tt&amp;gt;: messages from libraries&lt;br /&gt;
* &amp;lt;tt&amp;gt;grassmods_LANG.po&amp;lt;/tt&amp;gt;: messages from commands (&amp;quot;modules&amp;quot;)&lt;br /&gt;
* &amp;lt;tt&amp;gt;grassnviz_LANG.po&amp;lt;/tt&amp;gt;: messages from NVIZ Tcl/Tk graphical user interface (GRASS 6)&lt;br /&gt;
* &amp;lt;tt&amp;gt;grasstcl_LANG.po&amp;lt;/tt&amp;gt;: messages from Tcl/Tk graphical user interface (GRASS 6)&lt;br /&gt;
* &amp;lt;tt&amp;gt;grasswxpy_LANG.po&amp;lt;/tt&amp;gt;: messages from wxgrass/wxPython graphical user interface&lt;br /&gt;
&lt;br /&gt;
where &amp;quot;LANG&amp;quot; in the above file names is a two character code which indicates the language. It is based on the Alpha-2 code of [http://www.loc.gov/standards/iso639-2/php/English_list.php ISO 639-1] (right column). Example: &amp;lt;tt&amp;gt;grasswxpy_pl.po&amp;lt;/tt&amp;gt; for Polish.&lt;br /&gt;
&lt;br /&gt;
=== Continuing an existing translation ===&lt;br /&gt;
&lt;br /&gt;
The file(s) are there but partially outdated? Read on.&lt;br /&gt;
&lt;br /&gt;
First '''announce''' on the [http://lists.osgeo.org/mailman/listinfo/grass-translations GRASS translations mailing list] that you plan to continue the translation of a certain language. Why? Because sometimes people silently translate already and we need these efforts to be coordinated to avoid doing it twice...&lt;br /&gt;
&lt;br /&gt;
Then get these four .po files for your language and start. If a file is missing, just ask on the list to get it generated or see next section. To get these .po files (the files are in the directory locale/po/):&lt;br /&gt;
&lt;br /&gt;
* either [http://svn.osgeo.org/grass/grass/branches/releasebranch_6_4/locale/po/ download current .po files] directly from SVN (click on file name to download),&lt;br /&gt;
* or [http://trac.osgeo.org/grass/wiki/DownloadSource#GRASS6.4 download source code package] from SVN,&lt;br /&gt;
* or download the recent [http://grass.osgeo.org/grass64/source/snapshot/ source code snapshot],&lt;br /&gt;
* or ask on the [http://lists.osgeo.org/mailman/listinfo/grass-translations GRASS translations mailing list] for these files.&lt;br /&gt;
&lt;br /&gt;
Then edit the files with a .po file editor (poEDIT or kbabel or..., see below). Take care to maintain layout and special characters. And '''submit often''' - if you wait for weeks, the messages may already be outdated and your time wasted. Just keep in touch on the [http://lists.osgeo.org/mailman/listinfo/grass-translations GRASS translations mailing list]!&lt;br /&gt;
&lt;br /&gt;
=== Starting a new translation ===&lt;br /&gt;
&lt;br /&gt;
The language you want isn't yet there? Read on.&lt;br /&gt;
&lt;br /&gt;
Briefly, the steps to create new messages files are (if you find this too complicated, ask on the [http://lists.osgeo.org/mailman/listinfo/grass-translations GRASS translations mailing list] to get these files done for you!):&lt;br /&gt;
&lt;br /&gt;
# Get the latest source code development version from either the SVN repository or as SVN snapshot (see [http://grass.osgeo.org/download/index.php Download]).&lt;br /&gt;
# run: './configure --with-nls [... other parameters]' to configure the GRASS source code &lt;br /&gt;
# run: 'cd locale' to change into the translation directory&lt;br /&gt;
# run: 'make pot' to create grass*.pot template files (to extract original messages)&lt;br /&gt;
# run: copy these file from templates/ into po/; rename them to contain the two characters language code (see Alpha-2 code of [http://www.loc.gov/standards/iso639-2/php/English_list.php ISO 639-1]) and to .po extension; update the file headers either manually or with your .po editing software&lt;br /&gt;
  (Example: Polish language):&lt;br /&gt;
 	        mv ./templates/grasslibs.pot ./po/grasslibs_pl.po&lt;br /&gt;
 	        mv ./templates/grassmods.pot ./po/grassmods_pl.po&lt;br /&gt;
 	        mv ./templates/grassnviz.pot ./po/grassnviz_pl.po&lt;br /&gt;
 	        mv ./templates/grasstcl.pot ./po/grasstcl_pl.po&lt;br /&gt;
 	        mv ./templates/grasswxpy.pot ./po/grasswxpy_pl.po&lt;br /&gt;
&lt;br /&gt;
Now translate the messages in these po/*.po files (using poEDIT or other editor, see below)&lt;br /&gt;
&lt;br /&gt;
From time to time messages need to be updated from the originals. This is usually done by the GRASS translation manager.&lt;br /&gt;
&lt;br /&gt;
== Software to translate: .po file editors ==&lt;br /&gt;
&lt;br /&gt;
* [http://userbase.kde.org/Lokalize Lokalize]: (previously KBabel) is a set of tools for editing and managing gettext PO files, cross-platform, comes with KDE SC (works also under MS-Windows)&lt;br /&gt;
* [http://www.poedit.net/download.php poEdit]: poEdit is  gettext catalogs (.po files) editor (works also under MS-Windows)&lt;br /&gt;
* [http://translate.sourceforge.net/wiki/virtaal/index Virtaal] Virtaal is cross-platform graphical translation tool with terminology help from [http://open-tran.eu Open-Tran.eu]&lt;br /&gt;
* [https://www.transifex.net/projects/p/grass6/ Web based solution Transifex] (''help needed to revive'')&lt;br /&gt;
* [http://www.omegat.org/ Java based solution OmegaT]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''How to use Transifex to translate messages online in a browser:'''&lt;br /&gt;
* (''currently offline due to 2011 transifex website transition. please contact the translations mailing list (or Markus N) if you'd like to help with that'')&lt;br /&gt;
&lt;br /&gt;
[[Image:Transifex register signin.png|center|450px|Register and sign in]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Transifex edit online.png|center|450px|Click to edit online]]&lt;br /&gt;
&lt;br /&gt;
== Testing different languages ==&lt;br /&gt;
&lt;br /&gt;
Testing different languages requires that the respective language environment and, if needed, fonts are installed.&lt;br /&gt;
Check what languages are currently installed on your system with:&lt;br /&gt;
  locale -a&lt;br /&gt;
&lt;br /&gt;
To change to a certain language environment (locale), do the following steps (here, example for Unix style environment):&lt;br /&gt;
&lt;br /&gt;
   1. Define/check language settings:&lt;br /&gt;
     echo $LANG&lt;br /&gt;
     echo $LANGUAGE&lt;br /&gt;
     echo $LC_MESSAGES&lt;br /&gt;
  &lt;br /&gt;
   2. Change it (example for to Japanese):&lt;br /&gt;
    a) bash shell:&lt;br /&gt;
         export LANG=ja_JP.UTF-8&lt;br /&gt;
         export LANGUAGE=ja_JP.UTF-8&lt;br /&gt;
         export LC_MESSAGES=ja_JP.UTF-8&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
    b) (t)csh shell:&lt;br /&gt;
         setenv LANG ja_JP.UTF-8&lt;br /&gt;
         setenv LANGUAGE ja_JP.UTF-8&lt;br /&gt;
         setenv LC_MESSAGES ja_JP.UTF-8&lt;br /&gt;
&lt;br /&gt;
Now launch GRASS in this terminal. If you launch it from an icon, you have to change the LOCALE in the computer setup program instead.&lt;br /&gt;
&lt;br /&gt;
Other common languages useful for testing are &amp;lt;tt&amp;gt;de_DE&amp;lt;/tt&amp;gt; for German, &amp;lt;tt&amp;gt;fr_FR&amp;lt;/tt&amp;gt; for French, or &amp;quot;C&amp;quot; for none (effectively &amp;lt;tt&amp;gt;en_US&amp;lt;/tt&amp;gt;, which for GRASS is the base language).&lt;br /&gt;
&lt;br /&gt;
=== Creating startup scripts for different languages ===&lt;br /&gt;
&lt;br /&gt;
GRASS in English language, save as &amp;quot;grass64eng&amp;quot; (executable flag set, store in path):&lt;br /&gt;
      #!/bin/sh&lt;br /&gt;
      export LANG=en_US&lt;br /&gt;
      export LANGUAGE=en_US&lt;br /&gt;
      export LC_MESSAGES=en_US&lt;br /&gt;
      exec grass64 &amp;quot;$@&amp;quot;&lt;br /&gt;
&lt;br /&gt;
GRASS in Japanese language, save as &amp;quot;grass64ja&amp;quot; (executable flag set, store in path):&lt;br /&gt;
      #!/bin/sh&lt;br /&gt;
      export LANG=ja_JA.UTF-8&lt;br /&gt;
      export LANGUAGE=ja_JA.UTF-8&lt;br /&gt;
      export LC_MESSAGES=ja_JA.UTF-8&lt;br /&gt;
      grass64 &amp;quot;$@&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Coordination among translators ==&lt;br /&gt;
&lt;br /&gt;
If several translators work on the same language files, obviously some coordination is needed. Please announce work via the &amp;quot;translations&amp;quot; mailing list at http://lists.osgeo.org/mailman/listinfo/grass-translations &lt;br /&gt;
&lt;br /&gt;
Also the translation manager is listening there to the upload the changed files into the GRASS source code repository.&lt;br /&gt;
&lt;br /&gt;
== Best practices ==&lt;br /&gt;
&lt;br /&gt;
* Italiano: [http://tp.linux.it/buona_traduzione.html Regole per la buona traduzione]&lt;br /&gt;
&lt;br /&gt;
== Installation of language packages ==&lt;br /&gt;
&lt;br /&gt;
Example: Chinese&lt;br /&gt;
&lt;br /&gt;
* Mandriva: urpmi locales-zh kde-l10n-zh_CN fonts-ttf-default-zh_CN&lt;br /&gt;
&lt;br /&gt;
[[Category: Development]]&lt;br /&gt;
[[Category: Documentation]]&lt;br /&gt;
[[Category: FAQ]]&lt;/div&gt;</summary>
		<author><name>⚠️Jentjr</name></author>
	</entry>
</feed>