[GRASS-SVN] r59278 - grass-addons/grass7/vector/v.civil/v.civil.road

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Mar 17 19:20:57 PDT 2014


Author: jfc
Date: 2014-03-17 19:20:57 -0700 (Mon, 17 Mar 2014)
New Revision: 59278

Added:
   grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_10.png
   grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_11.png
   grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_12.png
   grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_13.png
   grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_14.png
   grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_5.png
   grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_6.png
   grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_7.png
   grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_8.png
   grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_9.png
Modified:
   grass-addons/grass7/vector/v.civil/v.civil.road/v.civil.road.html
   grass-addons/grass7/vector/v.civil/v.civil.road/v.civil.road.py
Log:
v.civil.road: fix some bugs, changes in tables and help updated

Modified: grass-addons/grass7/vector/v.civil/v.civil.road/v.civil.road.html
===================================================================
--- grass-addons/grass7/vector/v.civil/v.civil.road/v.civil.road.html	2014-03-17 17:38:14 UTC (rev 59277)
+++ grass-addons/grass7/vector/v.civil/v.civil.road/v.civil.road.html	2014-03-18 02:20:57 UTC (rev 59278)
@@ -1,6 +1,6 @@
-<h2>DESCRIPTION</h2>
+<!-- <h2>DESCRIPTION</h2> -->
 
-<em>v.civil.road</em> generates a topography edge for design roads, channels
+<em>v.civil.road</em> generates a alignment for design roads, channels
 and ports.
 <p>
 Applications:
@@ -13,38 +13,38 @@
 
 <h2>USAGE</h2>
 
-To run the program for the fist time, a map with one horizontal polygon, is
-required. If a table in layer 1 exist, this will no be overwritten, this layer is
-free for store information about the edge by the user.
+To run the program for the first time, a map with one horizontal polygon, is
+required. If a table exist in layer 1, this will no be overwritten. This layer
+is for store information about the road by the user.
 
 <p>
 There are three options for run the program, Create/Update polygon, Update
-solution and Insert point in edge.
+solution and Insert point in the central axis.
 
 
 <p>
-The <em>-n</em> flag (Create/Update new polygon), four tables will be add to
+The flag <em>-n</em>  (Create/Update new polygon), four tables will be add to
 the polygon map, where the parameter of the road will be stored. This
-flag must be selected for create a new polygon for the fist time or if the
+flag must be selected for create a new polygon for the first time or if the
 vertices/nodes of the polygon are moved or added another ones.
 
 <p>
-The <em>-u</em> flag "Update solution" will write the selected maps, with the
+The flag <em>-u</em> "Update solution" will write the selected maps, with the
 parameters included in the tables of the polygon.
 
 <p>
 The name of the outs maps, are given by default. If the out name map is
 preceded with character "_", this name will be added to the polygon name map.
-This is useful for change of edges quickly.
+This is useful for change of axis quickly.
 
 <p>
 The <em>-i</em> flag (Insert points), new points for defining the road,
 can be added to the layers _Vertical, _Section and _Trans, referencing by pk.
 
 <p>
-The user must select the layer and give a list with the pks. The options
-of the fist pk where the new will be inserted, will be copied in the new one.
+The user must select the layer and give a list with the pks.
 
+<p>
 The <em>Interval in straights</em> and <em>Interval in curves</em> options
 define the resolution of the straight lines and the curves respectively.
 
@@ -55,25 +55,25 @@
 
 <h3>Plan</h3>
 
-
 <p>
-The <em>-y</em> flag write a 3D edge (contains the plant and vertical alignment), with
-the name in <em>plantpoly</em> option (default: <em>NameEdge</em>_plantpoly).
+The <em>-y</em> flag write a 3D central axis (contains the plant and vertical
+alignment), with the name in <em>plantpoly</em> option (default:
+<em>NameRoad</em>_poly).
 
 <p>
 The <em>-h</em> flag write the horizontal alignment, with the name
 in <em>plant</em> option. The map created, contains the segments of the
 alignment and its information is stored in three tables/layers.
-(default: <em>NameEdge</em>_plan).
+(default: <em>NameRoad</em>_plan).
 
 <p>
 The <em>-k</em> flag write pk marks in horizontal, with the name in
-<em>pks</em> option.(default: <em>NameEdge</em>_Pks).
+<em>pks</em> option.(default: <em>NameRoad</em>_Pks).
 
 <p>
 The <em>pkopt</em> option define the distance between normal marks (npk),
 distance between principal marks (mpk), longitude of normal marks and
-longitude of princicipal marks.
+longitude of principal marks.
 
 <p>
 The <em>-d</em> flag write the displaced platform lines in horizontal,
@@ -90,82 +90,85 @@
 <p>
 The <em>-v</em> flag write the vertical alignment in horizontal, with the name
 in <em>raised</em> option. The map created, contains the segments of the
-alignment and its information is stored in three tables.(default: <em>NameEdge</em>_Vert)
+alignment and its information is stored in three tables.(default:
+<em>NameRoad</em>_Vert)
 
 <p>
-The <em>-l</em> flag write the raised of the edge (vertical alignment), the
+The <em>-l</em> flag write the raised of the central axis (vertical alignment),
+the
 terrain profile in a longitudinal profile map, and vertical polygon with the
 names given in <em>LPras</em> ,<em>LPterrain</em> and <em>LPejeref</em> options
-(default: <em>NameEdge</em>_LP_Ras, <em>NameEdge</em>_LP_terrain and
-<em>NameEdge</em>_LP_Edge).
+(default: <em>NameRoad</em>_LP_Ras, <em>NameRoad</em>_LP_terrain and
+<em>NameRoad</em>_LP_Polygon).
 
 <p>
-The <em>-m</em> flag write the coordinates edges and the profile guitar in the
-longitudinal profile with its marks, with the names given in <em>LPedgeX</em>,
-<em>LPedgeX_marks</em>, <em>LPedgeY</em> and <em>LPedgeY_marks</em> options
-(default: <em>NameEdge</em>_LP_EdgeX, <em>NameEdge</em>_LP_EdgeXmarks,
-<em>NameEdge</em>_LP_EdgeY and <em>NameEdge</em>_LP_EdgeYmarks).
+The <em>-m</em> flag write the coordinates axis and the profile guitar in the
+longitudinal profile with its marks, with the names given in <em>LPaxisX</em>,
+<em>LPaxisX_marks</em>, <em>LPaxisY</em> and <em>LPaxisY_marks</em> options
+(default: <em>NameRoad</em>_LP_AxisX, <em>NameRoad</em>_LP_AxisXmarks,
+<em>NameRoad</em>_LP_AxisY and <em>NameRoad</em>_LP_AxisYmarks).
 
 <p>
-With the option <em>LPScale</em>, the vertical scale of the longitudinal profile can be
-given.
+With the option <em>LPScale</em>, the vertical scale of the longitudinal
+profile can be given.
 
 <p>
-The <em>LPopt</em> option give the longitude of marks, distance between marks in edge x
-and y, and distance between lines of the guitar.
+The <em>LPopt</em> option give the longitude of marks, distance between marks
+in axis x and y, and distance between lines of the guitar.
 
 
 <h3>Cross</h3>
 
 <p>
-The <em>-c</em> flag write the projection of cross section in horizontal, with the name
-in <em>cross</em> option, and with the lines selected in <em>cross_opt</em> option.
+The <em>-c</em> flag write the projection of cross section in horizontal, with
+the name in <em>cross</em> option, and with the lines selected in
+<em>cross_opt</em> option.
 
 <p>
-The <em>-r</em> flag write a map with points of intersection of displaced lines with
-cross-section lines, in horizontal, with the name in <em>crossdispl</em> option. The
-lines that will be crossed are selected in <em>displ_opt</em>
+The <em>-r</em> flag write a map with points of intersection of displaced lines
+with cross-section lines, in horizontal, with the name in <em>crossdispl</em>
+option. The lines that will be crossed are selected in <em>displ_opt</em>
 
 
 <p>
 The <em>-f</em> flag write the raised of cross-section (cross alignment) and the
-terrain profile in a traversal profile map with the
-names given in <em>LTras</em> and <em>LTterrain</em> options
-(default: <em>NameEdge</em>_TP_Ras and <em>NameEdge</em>_TP_terrain
+terrain profile in a traversal profile map with the names given in
+<em>LTras</em> and <em>LTterrain</em> options (default: <em>NameRoad</em>_TP_Ras
+and <em>NameRoad</em>_TP_terrain
 
 <p>
-The <em>-m</em> flag write the coordinates edges and the profile guitar in the
-longitudinal profile with its marks, with the names given in <em>LTedgeX</em> and
-<em>LTedgeY</em> options (default: <em>NameEdge</em>_TP_EdgeX and
-<em>NameEdge</em>_TP_EdgeY ).
+The <em>-m</em> flag write the coordinates axis and the profile guitar in the
+longitudinal profile with its marks, with the names given in <em>LTaxisX</em>
+and <em>LTaxisY</em> options (default: <em>NameRoad</em>_TP_AxisX and
+<em>NameRoad</em>_TP_AxisY ).
 
 <p>
-With the option <em>LTScale</em>, the vertical scale of the longitudinal profile can be
-given.
+With the option <em>LTScale</em>, the vertical scale of the longitudinal
+profile can be given.
 
 <p>
-The <em>LTopt</em> option give the longitude of marks, distance between marks in edge x
-and y, and distance between lines of the guitar.
+The <em>LTopt</em> option give the longitude of marks, distance between marks
+in axis x and y, and distance between lines of the guitar.
 
 <p>
 The <em>LTopt2</em> option give the number of rows of cross-section to display,
-distance between cross-section in edge x and y.
+distance between cross-section in axis x and y.
 
 
 <h3>Terrain</h3>
 
 
 <p>
-The <em>-t</em> flag write the projection of edge on a DEM (3D line of terrain)
-in horizontal, with the name in <em>outtlong</em> option.
+The <em>-t</em> flag write the Dem profile of the central axis, with the name
+in <em>outtlong</em> option.
 
 <p>
-The <em>-q</em> flag write the projection of transects lines on a DEM (3D lines of terrain)
-in horizontal, with the name in <em>outtcross</em> option.
+The <em>-q</em> flag write the projection of transects lines on a DEM (3D lines
+of terrain) in horizontal, with the name in <em>outtcross</em> option.
 
 <p>
 The <em>-s</em> flag write the slope soil lines calculated with the last
-displaced lines (perpendicular to the edge) in horizontal, with the name
+displaced lines (perpendicular to the central axis), with the name
 in <em>outslope</em> option
 
 <p>
@@ -173,16 +176,18 @@
 displaced lines in horizontal, with the name in <em>outslopeareas</em> option
 
 <p>
-The <em>-p</em> flag write a 3D points map of lines selected in <em>pts_opt</em> option
+The <em>-p</em> flag write a 3D points map of lines selected in
+<em>pts_opt</em> option
 in horizontal, with the name in <em>outpoints</em> option
 
 <p>
-The <em>-b</em> flag write a 3D lines map of lines selected in <em>break_opt</em> option
-in horizontal, with the name in <em>outbreak</em> option
+The <em>-b</em> flag write a 3D lines map of lines selected in
+<em>break_opt</em> option in horizontal, with the name in <em>outbreak</em>
+option
 
 <p>
-The <em>-o</em> flag write a hull area map of lines selected in <em>hull_opt</em> option
-in horizontal, with the name in <em>outhull</em> option
+The <em>-o</em> flag write a hull area map of lines selected in
+<em>hull_opt</em> option in horizontal, with the name in <em>outhull</em> option
 
 
 <h2>Tables</h2>
@@ -192,90 +197,90 @@
 alignment, profile (vertical alignment), platforms definition and cross-section.
 
 <p>
-There are maps in horizontal
-alignment for display in plan, maps in vertical alignment that requires a
-new display for visualization in profile view, and maps in cross-section that
-requires a new display for visualization in profile cross-section view.
+There are maps in horizontal alignment for display in plan, maps in vertical
+alignment that requires a new display for visualization in profile view, and
+maps in cross-section that requires a new display for visualization in profile
+cross-section view.
 
 <p>
-The tables stored in the edge map are:
+The tables stored in the polygon map are:
 
 <h3>Layer 1:</h3>
 <p>
-Created with only cat column (if not exist), is for free use to add columns with information
-of the edge.
+Created with only cat column (if not exist), is for free use to add columns
+with information of the road.
 
 
 
 <h3>Layer 2:</h3>
 <p>
-<b>"NameEdge"_Horizontal</b>, for insert the parameters of the horizontal
+<b>"NameRoad"_Horizontal</b>, for insert the parameters of the horizontal
 alignment. This layer have all vertices and nodes of the horizontal polygon.
 No more points can be added to this layer with the insert point option.
 
 <p>
-The columns for editing by the user are:
+The columns are:
 
-	<ul>
-		<li><b>radio</b>: radio of curve
-			<p>+ for clockwise</p>
-			<p>- for anticlockwise</p>
-		</li>
-		<li><b>a_in</b>: Parameter A of input Clothoid</li>
-		<li><b>a_out</b>: Parameter A of output Clothoid</li>
-		<li><b>widening</b>: Widening of curve (where this widening is growing
-		in the clothoid, only in mode exact)</li>
-	</ul>
+<ul>
+    <li><b>radio</b>: radio of curve
+	<p>+ for clockwise</p>
+	<p>- for anticlockwise</p>
+    </li>
+    <li><b>a_in</b>: Parameter A of input Clothoid</li>
+    <li><b>a_out</b>: Parameter A of output Clothoid</li>
+    <li><b>widening</b>: Widening of curve (where this widening is growing
+	in the clothoid, only in mode exact)</li>
+</ul>
 
 
 
 <h3>Layer 3:</h3>
 
 <p>
-<b>"NameEdge"_Vertical</b>, for insert the parameters of the vertical
+<b>"NameRoad"_Vertical</b>, for insert the parameters of the vertical
 alignment.This layer are created with the first an last vertices of the
 horizontal polygon. New point can be added by the flag i (Insert point),
-or with edit gui. The added points, are inserted in the edge referencing by pk.
+or with edit gui. The added points, are inserted in the central axis
+referencing by pk.
 
 <p>
-The columns for editing by the user are:
+The columns are:
 
-	<ul>
-		<li><b>pk</b>: kilometric point of the edge</li>
-		<li><b>elev</b>: Elevation of the vertice of the vertical alignment</li>
-		<li><b>kv</b>: Parameter Kv of the vertical alignment</li>
-		<li><b>l</b>: Leng of parabolic curve (no yet implemented)</li>
-		<li><b>B</b>: Height of vertice of vertical polygon to the parabolic
+<ul>
+    <li><b>pk</b>: kilometric point of the central axis</li>
+    <li><b>elev</b>: Elevation of the vertice of the vertical alignment</li>
+    <li><b>kv</b>: Parameter Kv of the vertical alignment</li>
+    <li><b>l</b>: Leng of parabolic curve (no yet implemented)</li>
+    <li><b>B</b>: Height of vertice of vertical polygon to the parabolic
 		curve (no yet implemented)</li>
-	</ul>
+</ul>
 
 
 <h3>Layer 4: </h3>
 
-<b>"NameEdge"_Section</b>, for insert the parameters of the platform.
+<b>"NameRoad"_Section</b>, for insert the parameters of the platform.
 This layer are created with the first an last vertices of the horizontal
 polygon. New point can be added by the flag i (Insert point), or with edit
-gui. The added points, are inserted in the edge referencing by pk.
+gui. The added points, are inserted in the central axis referencing by pk.
 <p>
 The columns for editing by the user are:
 
-	<ul>
-		<li><b>pk</b>: kilometric point of the edge</li>
-		<li><b>sec_left, sec_right</b>: For defining left and right platform
-		lines (distance and height to the edge), separated by ";" </li>
-		<li><b>type_left, type_right</b>: Types of left and right lines
-		(types are: l,e,r,0). You can enter	the type of multiple lines
-		separated by ";"
-			<b>l</b>: linear approximation between definition points.
-			<b>e</b>: displaced edge, mode exact.
-			<b>c</b>: ellipse between definition points.
-			<b>rR,A</b>: circle between definition points ((x-A)^2+y^2=R^2))</li>
+<ul>
+    <li><b>pk</b>: kilometric point of the central axis</li>
+    <li><b>sec_left, sec_right</b>: For defining left and right platform lines
+        (distance and height to the central axis), separated by ";" </li>
+    <li><b>type_left, type_right</b>: Types of left and right lines
+        (types are: l,e,r,0). You can enter the type of multiple lines
+        separated by ";"
+	<b>l</b>: linear approximation between definition points.
+	<b>e</b>: displaced lines, mode exact.
+	<b>c</b>: ellipse between definition points.
+	<b>rR,A</b>: circle between definition points ((x-A)^2+y^2=R^2))</li>
 
-		<li><b>cut_left, cut_right</b>: Cut slope left and right </li>
-		<li><b>fill_left, fill_right</b>: Fill slope left and right </li>
-		<li><b>superelev_left,superelev_right</b>: Superelevation left and right
-		lanes (no yet implemented)</li>
-	</ul>
+    <li><b>cut_left, cut_right</b>: Cut slope left and right </li>
+    <li><b>fill_left, fill_right</b>: Fill slope left and right </li>
+</ul>
+
 <p>
 Between two points, if the second input distance equal zero, the line will be
 stopped. If the second input distance equal -1, this point will not be processed
@@ -285,79 +290,340 @@
 
 <h3>Layer 5:</h3>
 <p>
-<b>"NameEdge"_Tran</b>s, for insert the parameters of transects to the edge. This layer
-are created with the first an last vertices of the horizontal polygon. New point can be added by the flag
-i (Insert point), or with edit gui. The added points, are inserted in the edge referencing by pk
+<b>"NameRoad"_Trans</b>, for insert the parameters of transects to the central
+axis.
+This layer are created with the first an last vertices of the horizontal
+polygon. New point can be added by the flag i (Insert point), or with edit gui.
+The added points, are inserted in the central axis referencing by pk.
 <p>
 The columns for editing by the user are:
 
 <ul>
-	<li><b>pk</b>: kilometric point of the edge</li>
-	<li><b>dist_left,dist_right</b>: Distance left and right from the edge</li>
-	<li><b>npk</b>: Distance between trans</li>
+    <li><b>pk</b>: kilometric point of the central axis</li>
+    <li><b>dist_left,dist_right</b>: Distance left and right from the central
+axis</li>
+    <li><b>npk</b>: Distance between trans</li>
 </ul>
 
+
+
+
 <h2>Example</h2>
 <p>
-First we are going to create a polygon with wxdigit, this will create a table in layer 1.
-The name of this map is road1. The polygon will have three lines,two vertices and two nodes.
-In this layer we can create, for example, with the command <em>v.db.addcolumn</em>, three
-new columns to store our information about the road. This columns are <em>Name, Cod, Date</em>.
+First we are going to create a polygon with wxdigit, this will create a table in
+layer 1. The name of this map is road1. The polygon will have three lines,two
+vertices and two nodes. In this layer we can create, for example, with the
+command <em>v.db.addcolumn</em>, three new columns to store our information
+about the road. This columns are <em>Name, Cod, Date</em>.
+
 <p>
-<img src="vcivilroad_1.png" width="600" height="350" alt="" align="middle" />
+At this point we can give the name and select the flag <em>-n</em> (Create/Update
+polygon) and then run. Four tables are crated (or five if the table in layer 1
+don't exist).
 
+<p>
+<img src="vcivilroad_1.png" width="600" height="350" alt="" >
+
+
+
+
 <h3>Plant</h3>
 
 <p>
-At this point we can give the name and select the flag -n (Create/Update polygon) and then run.
-Four tables are crated.
-The fist one, in layer 2, is the definition of the edge in plant. This table have four rows,
-the fist and the last are the vertices of the polygon and the other are the nodes of the polygon.
+The second one, in layer 2, is the definition of the road in plant. This table
+have four rows, the first and the last are the vertices of the polygon and the
+other are the nodes of the polygon.
 
 <p>
-<img src="vcivilroad_2.png" width="700" height="300" alt="" align="middle" />
+<img src="vcivilroad_2.png" width="700" height="300" alt="" >
 
 <p>
-In this table we can define the radio, the parameter A of the input and output clothoid,
-widening (applied to the displaced lines, see below) in curves and superelevation
-(applied to the displaced lines, TODO) for each node.
+In this table we can define the radio, the parameter A of the input and output
+clothoid, widening (applied to the displaced lines, see below) in curves and
+superelevation (applied to the displaced lines, TODO) for each node.
 
 <p>
-After that, in the tab Plant, we can select the flag -h to write the horizontal alignment
-and the flag -k to write the pk's marks. At this moment we need to update the solution with
-the flag -u and then run.
+After that, in the tab Plant, we can select the flag <em>-h</em> to write the horizontal
+alignment and the flag <em>-k</em> to write the pk's marks. At this moment we need to
+update the solution with the flag <em>-u</em> and then run.
 
 <p>
-<img src="vcivilroad_3.png" width="700" height="300" alt="" align="middle" />
+<img src="vcivilroad_3.png" width="700" height="300" alt="" >
 
 <p>
-Then we get two maps <em>road1_plant</em> and <em>road1_pks</em>. The <em>road1_plant</em>
-has three tables with the parameters of the horizontal alignment. The <em>road1_pks</em>
-has a table with a pk columns to use with labels.
+Then we get two maps <em>road1_plant</em> and <em>road1_pks</em>. The
+<em>road1_plant</em> has three tables with the parameters of the horizontal
+alignment. The <em>road1_pks</em> has a table with a pk columns to use with
+labels.
 
 <p>
-<img src="vcivilroad_4.png" width="800" height="450" alt="" align="middle" />
+<img src="vcivilroad_4.png" width="800" height="450" alt="" >
 
 <p>
-At any time we can move the vertices/nodes or add new ones to the polygon, for example,
-wxdigit. If we do that we need to select the flag -n to update the polygon and the
-flag -u to update the solution again.
+At any time we can move the vertices/nodes or add new ones to the polygon, for
+example, wxdigit. If we do that, we need to select the flag <em>-n</em> to update the
+polygon and the flag <em>-u</em> to update the solution again.
 
 <p>
-The polylines that you can see in the last figure have a distance between points about
-1 meters by default, but this can be changed in the <em>Interval in straights</em> and
-<em>Interval in curves</em> options (see below).
+The polylines that you can see in the last figure have a distance between
+points about 1 meters by default, but this can be changed in the <em>Interval
+in straights</em> and <em>Interval in curves</em> options (see below).
 
 <p>
-An example of this section can be seen in http://www.youtube.com/watch?v=n2JYfgVDcmY
+An example of this section can be seen in
+http://www.youtube.com/watch?v=n2JYfgVDcmY<br>
+(You can activate HD quality for better visualization)
 
 
+
+
+<h3>Vertical</h3>
+
+<p>
+The third table, in layer 3, is where the vertical alignment is stored. When
+this table is created, have two rows, who are the first and the last points of
+the central axis, and for that, the vertices of the new polygon of the vertical
+alignment.
+
+<p>
+In this table we can insert breakpoints or new nodes to the vertical polygon to
+define new vertical alignments, with the option <em>-i</em>, selecting the layer
+<em>Vertical</em> and giving a list of pks where the breakpoints will be
+inserted in the central axis. In the columns we can define the elevation,
+the parameter <em>kv</em> and the pk of each node.
+
+<p>
+<img src="vcivilroad_8.png" width="700" height="300" alt="" >
+
+<p>
+After that, in the tab <em>Vertical</em>, we can select the flag <em>-v</em> to write the
+vertical alignment in plant. The map that we get is <em>road1_Vert</em>. It has
+two tables with the parameters of the vertical alignment.
+
+<p>
+The flag <em>-l</em> draw the longitudinal profile of the central axis of the
+road and the terrain profile. The <em>road1_LP_Ras</em> has two tables with the
+parameters of the vertical alignment.
+
+<p>
+The flag <em>-m</em> draw the coordinates axes of the longitudinal profile. Those maps
+have tables with columns for use with labels.
+
+<p>
+We need to give a dem in the terrain tabs, select the flag <em>-u</em> for update the
+solution and then run, to obtain those maps.
+
+<p>
+<img src="vcivilroad_9.png" width="800" height="450" alt="" >
+
+<p>
+An example of this section can be seen in
+http://www.youtube.com/watch?v=AuKYSxohLKE<br>
+(You can activate HD quality for better visualization)
+
+
+
+
 <h3>Platform lines</h3>
-...
 
+<p>
+The fourth table, in layer 4, is the definition of the platforms lines in plant.
+For first time, this table have two rows, who are the vertices of the polygon,
+and for that the first and the last points of the central axis.
 
+<p>
+The displaced lines are defined in <em>sec_left,sec_right</em> columns with
+a list separated with ";", starting from left to right in each side of the
+central axis. Each displaced line is defined with distance to the central
+axis and height to the central axis (d,h).
 
+<p>
+The mode to calculate the displaced lines is defined in the
+<em>type_left,type_right</em> columns,for each line separated by ";".
 
+<p>
+In this table we can insert breakpoints for the displaced lines with the option
+ <em>-i</em>, selecting the layer <em>Section</em> and giving a list of pks where the
+breakpoints will be inserted in the central axis. In this example we are going
+to insert some breakpoints and define three displaced lines in the left side to
+the central axis and three for right side.
+
+<p>
+<img src="vcivilroad_5.png" width="700" height="300" alt="" >
+
+<p>
+The platform lines define, the lanes of a road, the platform limits, ... Those
+lines can be parallel to the central axis of a road (or not). If it's so, we
+need to know that the parallel to a clothoid is not a clothoid. Then we have two
+ways to do the platform lines.
+
+<p>
+In the first way, mode exact "e", we need to calculate a new displaced central
+axis, e.i., a parallel to the polygon not to the central axis. The new alignment
+or displaced line created within the new polygon have new clothoids for the
+transitions. To run this mode, the first and the last points, of a section of
+the road, must have the same displaced distance.
+
+<p>
+The widening parameter of the section above, only will be calculate in this
+mode, because the widening growing in the clothoid, then is applied only to the
+displaced lines calculated with clothoid.
+
+<p>
+The second way, mode lineal "l", we calculate the perpendicular displaced
+distance to each point of the central axis, to obtain a parallel to it,
+where the transitions won't be clothoids. Then we can't know where are
+the tangents of transitions. But in this mode, the displaced distance for the
+first and the last points don't have to be the same in a section of the road.
+A lineal variation will be done between those points.
+
+<p>
+For this example, the first and last are defined as lineal and the rest are in
+mode exact.
+
+<p>
+Into this second way, the variation don't have to be only lineal. We can define
+a circumference in the displaced line with the option "rR,A".
+
+<p>
+Between two points, if the second input distance equal zero, the line will be
+stopped. If the second input distance equal -1, this point will not be processed
+and the next one will be considered.
+
+<p>
+After that, in the tab <em>Plant</em>, we can select the flag <em>-d</em> to write the
+displaced lines map. At this moment we need to update the solution with the flag
+-u and then run.
+
+<p>
+Then we get a map <em>road1_Displ</em>. This map has two tables, the first has
+the displaced lines and the second has the characteristic points of the lines if
+the mode "e" has been used.
+
+
+<p>
+<img src="vcivilroad_6.png" width="800" height="450" alt="" >
+
+<p>
+With the height of the lines we can obtain different forms, that we'll see in
+the cross sections.
+
+<p>
+<img src="vcivilroad_7.png" width="600" height="300" alt="" >
+
+<p>
+The cut/fill are calculated with the first displaced line of the left side and
+the last displaced line of the right side, and with the slope given in the
+columns <em>cut_left, cut_right, fill_left, fill_right</em>
+
+<p>
+An example of this section can be seen in
+http://www.youtube.com/watch?v=3tYxD8HsDEA<br>
+(You can activate HD quality for better visualization)
+
+
+
+
+<h3>Cross sections</h3>
+
+<p>
+The fifth table, in layer 5, is the table where we are going to define
+transversals 2D lines to the central axis, to obtain later, the cross sections.
+
+<p>
+This lines contains the cutoff with the displaced lines.
+
+<p>
+When this table is created, have two rows, who are the first and the last points of
+the central axis.
+
+<p>
+In this table we can insert breakpoints for the transversals lines with the option
+ <em>-i</em>, selecting the layer <em>Trans</em> and giving a list of pks where the
+breakpoints will be inserted in the central axis. In this example we are going
+to insert some breakpoints to define different transversals lines.
+
+<p>
+In the columns <em>dist_left, dist_right</em> we can define the distance left
+and right to the central axis and in the column npk the distance between lines.
+
+<p>
+<img src="vcivilroad_10.png" width="700" height="325" alt="" >
+
+<p>
+Then, in the tab <em>Cross</em>, we can select the flag <em>-c</em> to write the
+transversals lines in plant. The map that we get is <em>road1_Cross</em>. It has
+a table with some parameters.
+
+<p>
+In the tab <em>Terr</em>, we can select the flag <em>-s</em> to write the
+cut/fill lines in plant, with the slope given in the table <em>road1_Section</em>.
+The map that we get is <em>road1_Slope</em>.
+
+<p>
+<img src="vcivilroad_11.png" width="700" height="300" alt="" >
+
+<p>
+In the tab <em>Cross</em> again, we can select the flag<em>-f</em> to draw the
+cross sections and the terrain profile. The maps that we get are
+<em>road1_TP_Ras</em>, that It has two tables with some parameters, and
+<em>road1_TP_Terr</em>
+
+<p>
+<img src="vcivilroad_12.png" width="700" height="450" alt="" >
+
+<p>
+The flag <em>-g</em> draw the coordinates axes of the cross sections. Those maps
+have tables with columns for use with labels. It can be a bit slow.
+
+<p>
+<img src="vcivilroad_13.png" width="500" height="250" alt="" >
+
+<p>
+We need to give a dem in the terrain tabs, select the flag<em>-u</em> for update the
+solution and then run, to obtain those maps.
+
+<p>
+An example of this section can be seen in
+http://www.youtube.com/watch?v=w2LGurDfbY0<br>
+(You can activate HD quality for better visualization)
+
+
+
+
+<h3>Terrain</h3>
+
+<p>
+Some lines before, we have seen who to write the cut/fill lines in plant, with
+the slope given in the table <em>road1_Section</em>.
+
+<p>
+Now we have defined the road, then we can generate points of the different alignments,
+breaklines and a hull of all points, with the flags <em>-p</em>, <em>-b</em> and <em>-o</em>.
+
+<p>
+The distance between points of each alignments is of 1 meters by default, but
+this can be changed in the <em>Interval in straights</em> and
+<em>Interval in curves</em> options. The result can be seen below.
+
+<p>
+<img src="vcivilroad_14.png" width="700" height="550" alt="" >
+
+<p>
+This three maps, created <em>road1_Points, road1_Breaklines and road1_Hull</em> can
+be used in <em>v.civil.topo</em> for get the triangulation of the road.
+
+<p>
+An example of this section can be seen in
+http://www.youtube.com/watch?v=uFZ1PPxkE1c<br>
+(You can activate HD quality for better visualization)
+
+<p>
+To build another types of alignments like "curve-clothoid-curve", or roundabout
+see <em>v.civil.tools</em>
+
+
+
 <h2> AUTHOR</h2>
 <p>
 Jesus Fernandez-Capel Rosillo<br >
@@ -365,4 +631,5 @@
 jfc at alcd net<br >
 
 
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date: 2014-03-18 03:16:51 +0100 (mar 18 de mar de 2014)$</i>

Modified: grass-addons/grass7/vector/v.civil/v.civil.road/v.civil.road.py
===================================================================
--- grass-addons/grass7/vector/v.civil/v.civil.road/v.civil.road.py	2014-03-17 17:38:14 UTC (rev 59277)
+++ grass-addons/grass7/vector/v.civil/v.civil.road/v.civil.road.py	2014-03-18 02:20:57 UTC (rev 59278)
@@ -2,7 +2,7 @@
 # -*- coding: utf-8
 ############################################################################
 #
-# MODULE:       v.civil.road, v0.5.9
+# MODULE:       v.civil.road, v0.6.0
 #
 # AUTHOR:       Jesús Fernández-Capel Rosillo
 #               Civil Engineer, Spain
@@ -19,7 +19,7 @@
 #############################################################################
 
 #%Module
-#% description: Generate a topography edge for desing roads, channels, ports...
+#% description: Generate a alignment for desing roads, channels, ports...
 #% keywords: vector, ROADS, CHANNELS, PORTS.
 #%End
 
@@ -30,7 +30,7 @@
 #% key: edge
 #% type: string
 #% gisprompt: old,vector,vector
-#% description: Name for edge (horizontal polygon)
+#% description: Name for alignment (horizontal polygon)
 #% required: yes
 #%end
 
@@ -39,7 +39,7 @@
 
 #%flag
 #% key: y
-#% description: Write edge polyline
+#% description: Write central axis polyline
 #% guisection: Plan
 #%end
 
@@ -51,7 +51,7 @@
 
 #%option G_OPT_V_OUTPUT
 #% key: plantpoly
-#% description: Name for output edge polyline
+#% description: Name for output central axis polyline
 #% required: no
 #% answer: _Poly
 #% guisection: Plan
@@ -147,17 +147,17 @@
 
 #%flag
 #% key: m
-#% description: Draw longitudinal profile coord edges (dem required)
+#% description: Draw longitudinal profile coord axis (dem required)
 #% guisection: Vertical
 #%end
 
-
 #%option
 #% key: LPScale
-#% type: double
+#% type: integer
 #% description: Long profile vertical scale (V/H, V/1)
+#% options: 0-100
+#% answer : 4
 #% required: no
-#% answer: 8
 #% guisection: Vertical
 #%end
 
@@ -174,39 +174,39 @@
 #% key: raised
 #% description: Name of vertical alignment
 #% required: no
-#% answer: _Vertical
+#% answer: _Vert
 #% guisection: Vertical
 #%end
 
 #%option G_OPT_V_OUTPUT
-#% key: LPedgeX
-#% description: Name of long profile edge x
+#% key: LPaxisX
+#% description: Name of long profile axis x
 #% required: no
-#% answer: _LP_EdgeX
+#% answer: _LP_AxisX
 #% guisection: Vertical
 #%end
 
 #%option G_OPT_V_OUTPUT
-#% key: LPedgeXmarks
-#% description: Name of long profile edge x marks
+#% key: LPaxisXmarks
+#% description: Name of long profile axis x marks
 #% required: no
-#% answer: _LP_EdgeXmarks
+#% answer: _LP_AxisXmarks
 #% guisection: Vertical
 #%end
 
 #%option G_OPT_V_OUTPUT
-#% key: LPedgeY
-#% description: Name of long profile edge y
+#% key: LPaxisY
+#% description: Name of long profile axis y
 #% required: no
-#% answer: _LP_EdgeY
+#% answer: _LP_AxisY
 #% guisection: Vertical
 #%end
 
 #%option G_OPT_V_OUTPUT
-#% key: LPedgeYmarks
-#% description: Name of long profile edge y marks
+#% key: LPaxisYmarks
+#% description: Name of long profile axis y marks
 #% required: no
-#% answer: _LP_EdgeYmarks
+#% answer: _LP_AxisYmarks
 #% guisection: Vertical
 #%end
 
@@ -230,7 +230,7 @@
 #% key: LPejeref
 #% description: Name of long profile vertical polygon
 #% required: no
-#% answer: _LP_Edge
+#% answer: _LP_Polygon
 #% guisection: Vertical
 #%end
 
@@ -242,13 +242,13 @@
 
 #%flag
 #% key: c
-#% description: Write cross section
+#% description: Write transversals lines
 #% guisection: Cross
 #%end
 
 #%flag
 #% key: r
-#% description: Write intersection cross section-displaced
+#% description: Write cutoff transversals lines with displaced lines
 #% guisection: Cross
 #%end
 
@@ -262,7 +262,7 @@
 
 #%flag
 #% key: g
-#% description: Draw cross section coord edges (dem required)
+#% description: Draw cross section coord axis (dem required)
 #% guisection: Cross
 #%end
 
@@ -282,7 +282,7 @@
 #% type: string
 #% description: Cross section options values for Longmark,distMark_x,distMark_y.
 #% required: no
-#% answer: 1,5,2
+#% answer: 1,20,10
 #% guisection: Cross
 #%end
 
@@ -291,7 +291,7 @@
 #% type: string
 #% description: Cross section options values for nrows,distTP_x,distTP_y.
 #% required: no
-#% answer: 5,20,20
+#% answer: 10,50,50
 #% guisection: Cross
 #%end
 
@@ -332,34 +332,34 @@
 
 
 #%option G_OPT_V_OUTPUT
-#% key: LTedgeX
-#% description: Name of cross section coord edge x
+#% key: LTaxisX
+#% description: Name of cross section coord axis x
 #% required: no
-#% answer: _TP_EdgeX
+#% answer: _TP_AxisX
 #% guisection: Cross
 #%end
 
 #%option G_OPT_V_OUTPUT
-#% key: LTedgeXmarks
-#% description: Name of cross section coord edge x
+#% key: LTaxisXmarks
+#% description: Name of cross section coord axis x
 #% required: no
-#% answer: _TP_EdgeXmarks
+#% answer: _TP_AxisXmarks
 #% guisection: Cross
 #%end
 
 #%option G_OPT_V_OUTPUT
-#% key: LTedgeY
-#% description: Name of cross section coord edge y
+#% key: LTaxisY
+#% description: Name of cross section coord axis y
 #% required: no
-#% answer: _TP_EdgeY
+#% answer: _TP_AxisY
 #% guisection: Cross
 #%end
 
 #%option G_OPT_V_OUTPUT
-#% key: LTedgeYmarks
-#% description: Name of cross section coord edge y
+#% key: LTaxisYmarks
+#% description: Name of cross section coord axis y
 #% required: no
-#% answer: _TP_EdgeYmarks
+#% answer: _TP_AxisYmarks
 #% guisection: Cross
 #%end
 
@@ -384,7 +384,7 @@
 
 #%flag
 #% key: t
-#% description: Write terrain edge
+#% description: Write central axis vertical proyection in dem
 #% guisection: Terr
 #%end
 
@@ -462,7 +462,7 @@
 
 #%option G_OPT_V_OUTPUT
 #% key: outtlong
-#% description: Name of terrain edge
+#% description: Name of terrain central axis vertical proyection
 #% required: no
 #% answer: _LongTerr
 #% guisection: Terr
@@ -531,7 +531,7 @@
 
 #%flag
 #% key: i
-#% description: Insert point in edge layers (vertical, section an transversal)
+#% description: Insert point in polygon layers (vertical, section an transversal)
 #%end
 
 #%option
@@ -583,6 +583,7 @@
 from grass.script import array as garray
 from itertools import groupby
 import time
+from copy import deepcopy
 #import Gnuplot
 
 #### Alineaciones
@@ -815,9 +816,11 @@
     #print Az_ent*200/pi,Az_sal*200/pi,w
     return Az_ent,Az_sal,w
 
-def pto_corte_2_rectas(x1,y1,x2,y2,x3,y3,x4,y4):
+def pto_corte_2_rectas2(x1,y1,x2,y2,x3,y3,x4,y4):
 
     if x2 == x1: m11=(y2-y1)/0.0000001
+
+
     else: m11=(y2-y1)/(x2-x1)
 
     if x3 == x4: m22=(y4-y3)/0.0000001
@@ -828,13 +831,29 @@
 
     return x,y
 
+def pto_corte_2_rectas(a,b,c,d,e,f,g,h):
 
+    if a == c:
+        m2 = (h-f)/(g-e)
+        x = a
+        y = f+m2*(a-e)
+    elif e == g:
+        m1 = (d-b)/(c-a)
+        x = e
+        y = b+m1*(e-a)
+    else:
+        m1 = (d-b)/(c-a)
+        m2 = (h-f)/(g-e)
+        x = (m1*a-m2*e-b+f)/(m1-m2)
+        y = m1*(x-a)+b
+    return x,y
+
 def get_PtosEjePlanta(table_plant):
 
     LAcum=0
     x_ini,y_ini = table_plant[0][0],table_plant[0][1]
     puntos_eje=[]
-    centros = []
+    #centros = []
     for i in range(1,len(table_plant)-1,1):
 
         a,b = table_plant[i-1][0],table_plant[i-1][1]
@@ -882,7 +901,7 @@
         fc=f+abs(R+yo_s)*cos(Az_sal+g90)
 
         xc,yc=pto_corte_2_rectas(ac,bc,cc1,dc1,cc2,dc2,ec,fc)
-        centros.append([xc,yc,0])
+        #centros.append([xc,yc,0])
 
         Lini_e,Lini_s=0,0
         if Ae <= 0:
@@ -1041,7 +1060,7 @@
     if c == 1: puntos_centros.append([[],[x_fin,y_fin,z_fin,h,LAcum,"'Line'",Lrecta,0,Az_sal*200/pi]])
     if c == 1: seg.append(Ini+Ptos_recta+[[x_fin,y_fin,z_fin,cat,LAcum,"'End'",i+1]])
 
-    #for jj in puntos: print jj
+    #for jj in puntos_caract: print jj
     return puntos,seg,puntos_caract,puntos_centros
 
 
@@ -1103,7 +1122,7 @@
         if pk2 == pkv: ps=0
         else: ps=(z2-zv)/(pk2-pkv)
 
-        if alz[i][7]!='':Kv=alz[i][7]
+        if alz[i][6]!='':Kv=alz[i][6]
         else:
             puntos_eje_alz.append([pk_ini,zini,pkv,zv,pkv,zv,pkv,zv,0,0,pe,ps])
             pk_ini=pkv; zini=zv
@@ -1229,68 +1248,51 @@
 
     M_ptos,M_ptos_caract=[],[]
     type2=[]
-    nume=0
-    #incremento de sobreancho a cada desplazado
-    if izq==1:
-        for tt in type1:
-            if "e" in tt: nume=nume+1
-        sobrei=nume+1
-    else: sobrei=0
+    nume,sobrei=0,0
 
     for i,line in enumerate(Sec):
 
-        Puntos_Despl=[[]]
-        Pc_izq=[]
+        Puntos_Despl = [[0]]
+        Pc_izq = []
         pkant=0.0
         npks=pks[:]
-        line2=line[:]
+        Dist=line[:]
         type2=type1[i][:]
+        if 'e' in type2: sobrei=sobrei+1
 
-        for j,dist in enumerate(line2[:-1]):
+        for j,dist in enumerate(Dist[:-1]):
 
-            if line2[j]!=-1 and line2[j+1]==-1:
-
-                line2[j+1]=line2[j]
+            if Dist[j]!=-1 and Dist[j+1]==-1:
+                Dist[j+1]=Dist[j]
                 npks[j+1]=npks[j]
                 type2[j+1]=type2[j]
                 continue
 
             #incremento de sobreancho a cada desplazado
-            if type2[j]=="e" and izq==1: sobrei=sobrei-1
-            elif type2[j]=="e" and izq==0: sobrei=sobrei+1
+            if type2[j]=="e": sobre2=sobrei
+            else: sobre2=0
 
-            #if npks[j+1]==npks[-1] or line2[j+1]==0: npks[j+1]=npks[j+1]
+            pkini = npks[j]
+            pkfin = npks[j+1]
 
-            ptosDes,Pc=get_PtosDesplazdos(Puntos,table_plant,line2[j],Cota[i][j],line2[j+1],Cota[i][j+1],sobrei,izq,npks[j],npks[j+1],type2[j])
+            ptosDes,Pc=get_PtosDesplazdos(Puntos,table_plant,Dist[j],Cota[i][j],Dist[j+1],Cota[i][j+1],sobre2,izq,pkini,pkfin,type2[j])
 
-            #Corregimos los pks de los desplazados
-            ptosDes2=[]
             for h,row in enumerate(ptosDes):
-                if row!=[]:
-                    ptosDes2.append(row)
 
-            if ptosDes2 != []:
-                if Puntos_Despl[-1]==[]:
-                    Puntos_Despl=[]
-                    x_ant=ptosDes2[0][0]
-                    y_ant=ptosDes2[0][1]
-                    pkant=0
-                elif ptosDes2[-1]!=[]:
-                    x_ant=Puntos_Despl[-1][0]
-                    y_ant=Puntos_Despl[-1][1]
-                    pkant=Puntos_Despl[-1][4]
+                if len(ptosDes[h]) > 1:
+                    ptosDes[h][4]=row[4]+pkant
 
-                x2=ptosDes2[0][0]
-                y2=ptosDes2[0][1]
+                if Puntos_Despl[-1][-1] != ptosDes[h][-1]:
+                    Puntos_Despl.append(ptosDes[h])
 
-                l=sqrt((x2-x_ant)**2+(y2-y_ant)**2)
+                elif Puntos_Despl[-1][-1] == ptosDes[h][-1] and len(ptosDes[h]) > 1:
+                    del Puntos_Despl[-1]
+                    Puntos_Despl.append(ptosDes[h])
 
-                for h,row in enumerate(ptosDes):
-                    if row!=[]:
-                        ptosDes[h][4]=row[4]+pkant+l
+            if len(Puntos_Despl[-1]) > 1:
+                pkant=Puntos_Despl[-1][4]
 
             Pc_izq.extend(Pc)
-            Puntos_Despl.extend(ptosDes)
 
         M_ptos.append(Puntos_Despl)
         if Pc_izq!=[]: M_ptos_caract.append(Pc_izq)
@@ -1305,14 +1307,14 @@
     SecIzq,CotaIzq,pks,typel=read_ColumnSecc(table_secc,5)
     SecDer,CotaDer,pks,typer=read_ColumnSecc(table_secc,6)
 
-    M_ptos_izq,M_ptos_caract=get_Desplaz(table_plant,SecIzq,CotaIzq,pks,typel,Puntos,1)
+    M_ptos_izq,M_ptos_caract=get_Desplaz(table_plant,SecIzq[::-1],CotaIzq[::-1],pks,typel[::-1],Puntos,1)
     M_ptos_der,M_ptos_caract2=get_Desplaz(table_plant,SecDer,CotaDer,pks,typer,Puntos,0)
 
     M_ptos_caract=M_ptos_caract+M_ptos_caract2
 
     M_ptos_caract = [m for p in M_ptos_caract for m in p]
 
-    return M_ptos_izq,M_ptos_der,M_ptos_caract
+    return M_ptos_izq[::-1],M_ptos_der,M_ptos_caract
 
 
 
@@ -1387,10 +1389,10 @@
         # Clotoide de salida en locales
         xo_sal,yo_sal,Tau_sal,Lsal,xs,ys=clotoide_Locales(Asal,abs(R))
 
-        if izq!=0 and R<0: radio=R+dist+(sobreancho*sobreanchoTable)
-        elif izq!=0 and R>0: radio=R+dist-(sobreancho*sobreanchoTable)
-        elif izq==0 and R>0: radio=R-dist+(sobreancho*sobreanchoTable)
-        elif izq==0 and R<0: radio=R-dist-(sobreancho*sobreanchoTable)
+        if izq!=0 and R<0: radio=R+dist-(sobreancho*sobreanchoTable)
+        elif izq!=0 and R>0: radio=R+dist+(sobreancho*sobreanchoTable)
+        elif izq==0 and R>0: radio=R-dist-(sobreancho*sobreanchoTable)
+        elif izq==0 and R<0: radio=R-dist+(sobreancho*sobreanchoTable)
 
         # Parametro A de entrada
         if Aent==0: Aent1=0
@@ -1430,7 +1432,9 @@
             h=h/2
         else:
             Li=Li+h
+
     if abs(eq)>0.001: x1,y1=[0,0]
+    if Li > Lrecta_d: Li = Lrecta_d
     return x1,y1,Li
 
 #Pto de corte entre la perpendicular a un pto de un circulo y un circulo
@@ -1581,21 +1585,18 @@
         if pkini <= pp[4] and pp[4] <= pkfin:
             ptos.append(pp)
 
-    if round(pkfin - puntos[-1][4],6) == 0:
-        ptos.append(puntos[-1])
-
     if dist!=0 and dist2==0: dist=0
     if dist==dist2 and dist!=0 and type1=='e':
 
         desplaz=get_Paralles(table_plant,dist,sobrea,izq)
         puntos_DesplEje=get_PtosEjePlanta(desplaz)
 
-        PK2_ini=puntos[int(pkini)][4]
-
+        x,y,z,cat,PK,Az,tipo,align=ptos[0][0:8]
+        x1,y1,PK2_ini=get_ptoDesplaz(x,y,PK,Az,tipo,align,puntos_DesplEje)
         for pt in ptos:
 
             x,y,z,cat,PK,Az,tipo,align=pt[0:8]
-            #print x,y,z,cat,PK,Az,tipo,align
+
             cota0=cota+((pt[4]-pkini)*(cota2-cota))/(pkfin-pkini)
             x1,y1,PK2=get_ptoDesplaz(x,y,PK,Az,tipo,align,puntos_DesplEje)
             if x1!=0 and y1!=0:
@@ -1604,25 +1605,13 @@
                 lin.append([])
 
         a,b,Pc,c=generate_Pts(puntos_DesplEje,0,1,0,1,1)
-        Pc=[row for row in Pc  if row[4]>pkini and row[4]<pkfin]
+        Pc=[row for row in Pc  if row[4]>=pkini and row[4]<=pkfin]
 
-    elif dist!=0:
+    elif dist!=0 and dist2!=0:
 
         l_ant=0
-        for i,p in enumerate(puntos):
-            if p[4]==pkini:
-                ii=p[3]
-                break
-
-        x,y,z,cat,PK,Az,tipo,align=puntos[ii][0:8]
-
-        #if izq==1: Az1=Az-pi/2
-        #else: Az1=Az+pi/2
-        #x_ant=x+(dist)*sin(Az1)
-        #y_ant=y+(dist)*cos(Az1)
         x_ant=0
         y_ant=0
-        #lin.append([x_ant,y_ant,z+cota,cat,0,Az,'d'+str(dist),PK])
 
         for pt in ptos:
 
@@ -1678,7 +1667,7 @@
     elif dist==0:
 
         for pt in ptos:
-            lin.append([])
+            lin.append([pt[4]])
 
     return lin,Pc
 
@@ -1691,6 +1680,7 @@
     for pp in puntos:
         if pkini <= pp[4] and pp[4] < pkfin and pp[4]%npk==0:
             ptos.append(pp)
+
     if pkfin == puntos[-1][4]: ptos.append(puntos[-1])
 
     for pt in ptos:
@@ -1820,55 +1810,47 @@
         salida.append(ptos)
     return salida
 
-def drape_Points2(puntos,dem):
+#def drape_Points2(puntos,dem):
 
-    elev = raster.RasterRow('elev1')
-    elev.open('r')
-    region=Region()
-    salida=[]
-    for i,punt in enumerate(puntos):
-        pto_col = int((punt[0] - region.west)/region.ewres)
-        pto_row = int((region.north - punt[1])/region.nsres)
-        salida.append(punt[:2]+[elev[pto_row][pto_col]]+punt[3:])
-    elev.close()
-    return salida
+    #elev = raster.RasterRow('elev1')
+    #elev.open('r')
+    #region=Region()
+    #salida=[]
+    #for i,punt in enumerate(puntos):
+        #pto_col = int((punt[0] - region.west)/region.ewres)
+        #pto_row = int((region.north - punt[1])/region.nsres)
+        #salida.append(punt[:2]+[elev[pto_row][pto_col]]+punt[3:])
+    #elev.close()
+    #return salida
 
 
-def drape_LinesPoints2(lines,dem):
+#def drape_LinesPoints2(lines,dem):
 
-    elev = raster.RasterRow('elev1')
-    elev.open('r')
-    region=Region()
-    salida=[]
-    for i,line in enumerate(lines):
-        ptos=[]
-        for j,pto in enumerate(line):
-            pto_col = int((pto[0] - region.west)/region.ewres)
-            pto_row = int((region.north - pto[1])/region.nsres)
-            ptos.append(lines[i][j][:2]+[elev[pto_row][pto_col]]+lines[i][j][3:])
+    #elev = raster.RasterRow('elev1')
+    #elev.open('r')
+    #region=Region()
+    #salida=[]
+    #for i,line in enumerate(lines):
+        #ptos=[]
+        #for j,pto in enumerate(line):
+            #pto_col = int((pto[0] - region.west)/region.ewres)
+            #pto_row = int((region.north - pto[1])/region.nsres)
+            #ptos.append(lines[i][j][:2]+[elev[pto_row][pto_col]]+lines[i][j][3:])
 
-        salida.append(ptos)
-    elev.close()
-    return salida
+        #salida.append(ptos)
+    #elev.close()
+    #return salida
 
 
 def get_Taludes(puntos,puntos_Despl,des,ter,des2,ter2,dem,pkini,pkfin):
 
     puntos_talud=[]
     ptos=[]
-    for pp in puntos:
-        if pkini <= pp[4] and pp[4] < pkfin:
-            ptos.append(pp)
-    if pkfin == puntos[-1][4]: ptos.append(puntos[-1])
     pta=[]
-    for pt in ptos:
+    for i,pt in enumerate(puntos):
 
-        for ptoD in puntos_Despl:
-            if ptoD!=[] and pt[4] == ptoD[-1]:
-                pta = ptoD
-                continue
-
-        if pta!=[] and des!=0 and ter!=0:
+        pta = puntos_Despl[i]
+        if len(pta)>1 and des!=0 and ter!=0:
             a=pt[0]; b=pt[1]; z=pt[2]
             c=pta[0]; d=pta[1]; z1=pta[2]
 
@@ -1922,33 +1904,60 @@
                             zt_ant=zt
                             Li=Li+h
 
-            puntos_talud.append([x1,y1,z1]+pt[3:]+[tipo])
+            puntos_talud.append([x1,y1,z1]+pt[3:]+[tipo]+[pt[4]])
         else:
-            puntos_talud.append([])
+            puntos_talud.append([pta])
 
     return puntos_talud
 
 
 def generate_Taludes(puntos,puntos_Despl_izq,puntos_Despl_der,table_secc,dem):
 
-    tal_izq,tal_der=[],[]
+    tal_izq,tal_der=[[0]],[[0]]
+    if puntos_Despl_izq == [] and puntos_Despl_der == []: return [],[]
 
-    Despl_izq0,Despl_der1=[],[]
-    if puntos_Despl_izq != [] and puntos_Despl_der != []:
+    for j,line in enumerate(table_secc[:-1]):
 
-        for j,line in enumerate(table_secc[:-1]):
+        pkini,pkfin=line[4],table_secc[j+1][4]
+        ptos,ptos_izq=[],[]
+        for i,pp in enumerate(puntos):
+            if pkini <= pp[4] and pp[4] <= pkfin:
+                ptos.append(pp)
+                ptos_izq.append(puntos_Despl_izq[0][i])
 
-            pkini,pkfin=line[4],table_secc[j+1][4]
+        taludes=get_Taludes(ptos,ptos_izq,float(line[9]),float(line[11]),
+                            float(table_secc[j+1][9]),float(table_secc[j+1][11]),dem,pkini,pkfin)
 
-            #if table_secc[j+1]==table_secc[-1]: pkfin=pkfin+1
+        for h,row in enumerate(taludes):
 
-            taludes=get_Taludes(puntos,puntos_Despl_izq[0],float(line[9]),float(line[11]),
-                                float(table_secc[j+1][9]),float(table_secc[j+1][11]),dem,pkini,pkfin)
-            tal_izq.extend(taludes)
-            taludes=get_Taludes(puntos,puntos_Despl_der[-1],float(line[10]),float(line[12]),
-                                float(table_secc[j+1][10]),float(table_secc[j+1][12]),dem,pkini,pkfin)
-            tal_der.extend(taludes)
+            if tal_izq[-1][-1] != taludes[h][-1]:
+                tal_izq.append(taludes[h])
 
+            elif tal_izq[-1][-1] == taludes[h][-1] and len(taludes[h]) > 1:
+                del tal_izq[-1]
+                tal_izq.append(taludes[h])
+
+    for j,line in enumerate(table_secc[:-1]):
+
+        pkini,pkfin=line[4],table_secc[j+1][4]
+        ptos,ptos_der=[],[]
+        for i,pp in enumerate(puntos):
+            if pkini <= pp[4] and pp[4] <= pkfin:
+                ptos.append(pp)
+                ptos_der.append(puntos_Despl_der[-1][i])
+
+        taludes=get_Taludes(ptos,ptos_der,float(line[10]),float(line[12]),
+                            float(table_secc[j+1][10]),float(table_secc[j+1][12]),dem,pkini,pkfin)
+
+        for h,row in enumerate(taludes):
+
+            if tal_der[-1][-1] != taludes[h][-1]:
+                tal_der.append(taludes[h])
+
+            elif tal_der[-1][-1] == taludes[h][-1] and len(taludes[h]) > 1:
+                del tal_der[-1]
+                tal_der.append(taludes[h])
+
     return tal_izq,tal_der
 
 
@@ -1956,6 +1965,7 @@
 
     # despl_izq[0] [line1,[],line2,...] --> [[ line1,linet1 ],[ line12,linet2 ],...]
     # taludes      [linet1,[],linet2,...]
+
     lines=[]
     if Puntos_Talud_izq != [] or Puntos_Talud_der != []:
 
@@ -2028,11 +2038,12 @@
     TransDespl=[]
     for i,line in enumerate(Trans):
 
+
         # Cuidado con la asignacion de listas que se pasan por referencia/mutables
         tmpline=[line[0][:2]+[0]+line[0][3:]+[0]]
         for line_desp in desplaz_izq:
             for i_izq,pto in enumerate(line_desp):
-                if pto!=[] and line[1][4] == pto[-1]:
+                if len(pto) > 1 and line[1][4] == pto[-1]:
                     dist_izq=sqrt((line[1][0]-pto[0])**2+(line[1][1]-pto[1])**2)
                     tmpline.append(pto[:2]+[0]+pto[3:]+[round(dist_izq,6)]) # Cota cero para poder mover los ptos del transv
                     continue
@@ -2041,7 +2052,7 @@
 
         for line_desp in desplaz_der:
             for i_der,pto in enumerate(line_desp):
-                if pto!=[] and line[1][4] == pto[-1]:
+                if len(pto) > 1 and line[1][4] == pto[-1]:
                     dist_der=sqrt((line[1][0]-pto[0])**2+(line[1][1]-pto[1])**2)
                     tmpline.append(pto[:2]+[0]+pto[3:]+[round(dist_der,6)])
                     continue
@@ -2054,11 +2065,12 @@
 
 def get_SeccTerr(Trans,Trans_Pklist,Desplaz_izq,Desplaz_der,Puntos_Talud_izq,Puntos_Talud_der):
 
+
     talud_izq=[]
     for ptoss in Trans_Pklist:
         esta=0
         for ptot in Puntos_Talud_izq:
-            if ptot!=[] and ptoss[4] == ptot[4]:
+            if len(ptot)>1 and ptoss[4] == ptot[4]:
                 talud_izq.append(ptot)
                 esta=1
                 continue
@@ -2069,7 +2081,7 @@
     for ptoss in Trans_Pklist:
         esta=0
         for ptot in Puntos_Talud_der:
-            if ptot!=[] and ptoss[4] == ptot[4]:
+            if len(ptot)>1 and ptoss[4] == ptot[4]:
                 talud_der.append(ptot)
                 esta=1
                 continue
@@ -2082,7 +2094,7 @@
         for ptoss in Trans_Pklist:
             esta=0
             for ptot in desp:
-                if ptot!=[] and ptoss[4] == ptot[-1]:
+                if len(ptot)>1 and ptoss[4] == ptot[-1]:
                     desp_izq.append(ptot)
                     esta=1
                     continue
@@ -2096,7 +2108,7 @@
         for ptoss in Trans_Pklist:
             esta=0
             for ptot in desp:
-                if ptot!=[] and ptoss[4] == ptot[-1]:
+                if len(ptot)>1 and ptoss[4] == ptot[-1]:
                     desp_der.append(ptot)
                     esta=1
                     continue
@@ -2149,10 +2161,16 @@
 
     dist_orig,dist_par,cras,cterr,croja=[],[],[],[],[]
     d_ant=0
-    for i in range(0,int(puntos[-1][4]),mark_x_dist):
-        dist_orig.append(puntos[i][4])
-        dist_par.append(puntos[i][4]-d_ant)
-        d_ant=puntos[i][4]
+
+    for pt in puntos:
+        for j in range(0,int(puntos[-1][4]),mark_x_dist):
+
+            if j == int(pt[4]):
+
+                dist_orig.append(pt[4])
+                dist_par.append(pt[4]-d_ant)
+                d_ant=pt[4]
+                continue
     dist_orig.append(puntos[-1][4])
     dist_par.append(puntos[-1][4]-d_ant)
 
@@ -2187,16 +2205,19 @@
     cat=1
     for j in range(0,6):
         t=0
-        for i in range(0,int(puntos[-1][4]),mark_x_dist):
-            if j==0: label=round(dist_orig[t],2)
-            elif j==1: label=round(dist_par[t],2)
-            elif j==2: label=round(cras[t],2)
-            elif j==3: label=round(cterr[t],2)
-            elif j==4: label=round(croja[t],2)
-            else: label=0
-            t=t+1
-            mark_x.append([[cerox+i,ceroy-mark_lon-j*dist_ejes_x,0,cat,label],[cerox+i,ceroy+mark_lon-j*dist_ejes_x,0,cat,label]])
-            cat=cat+1
+        for pt in puntos:
+            for k in range(0,int(puntos[-1][4]),mark_x_dist):
+                if k == int(pt[4]):
+                    if j==0: label=round(dist_orig[t],2)
+                    elif j==1: label=round(dist_par[t],2)
+                    elif j==2: label=round(cras[t],2)
+                    elif j==3: label=round(cterr[t],2)
+                    elif j==4: label=round(croja[t],2)
+                    else: label=0
+                    t=t+1
+                    mark_x.append([[cerox+k,ceroy-mark_lon-j*dist_ejes_x,0,cat,label],[cerox+k,ceroy+mark_lon-j*dist_ejes_x,0,cat,label]])
+                    cat=cat+1
+                    continue
         if j==0: label=round(dist_orig[-1],2)
         elif j==1: label=round(dist_par[-1],2)
         elif j==2: label=round(cras[-1],2)
@@ -2206,7 +2227,7 @@
         mark_x.append([[cerox+puntos[-1][4],ceroy-mark_lon-j*dist_ejes_x,0,cat,label],[cerox+puntos[-1][4],ceroy+mark_lon-j*dist_ejes_x,0,cat,label]])
         cat=cat+1
 
-    ptos_eje=[[cerox+p[4],p[5]*escala-cero_y_ref,0,p[3],p[4],p[6],p[7]] for p in table_alz]
+    ptos_eje=[[cerox+p[4],p[5]*escala-cero_y_ref,0,p[3],p[4],p[6]] for p in table_alz]
 
     return eje_x,eje_y,mark_x,mark_y,ptos_terr_ref,ptos_eje,ASeg_ref,APtos_caract_ref
 
@@ -2225,7 +2246,8 @@
     filas,sep_x,sep_y=opt2.split(',')
     filas,sep_x,sep_y=int(filas),float(sep_x),float(sep_y)
 
-    columnas=len(Trans_Pklist)/filas
+    columnas=len(Trans_Pklist)/float(filas)
+    columnas=int(ceil(columnas))
     # Ancho y alto de cada fila/columna
     h=0
     ancho_colum,centro_secc,max_filas,min_filas,dif_filas=[],[],[],[],[]
@@ -2242,12 +2264,20 @@
             minfila.append(min_trans)
             dif_fila.append((max_trans-min_trans)*escala)
             h=h+1
+            if h == len(Trans_Pklist):break
         ancho_colum.append(max(anchos_colum))
         centro_secc.append(max(centros_colum))
         max_filas.append(maxfila)
         min_filas.append(minfila)
         dif_filas.append(dif_fila)
 
+    for k in range(len(max_filas[0])-len(max_filas[-1])):
+        max_filas[-1].append(0)
+    for k in range(len(min_filas[0])-len(min_filas[-1])):
+        min_filas[-1].append(100000)
+    for k in range(len(dif_filas[0])-len(dif_filas[-1])):
+        dif_filas[-1].append(0)
+
     max_filas2 = [[row[i] for row in max_filas] for i in range(len(max_filas[0]))] # transpuesta
     max_filas2 = [max(row) for row in max_filas2]
     min_filas2 = [[row[i] for row in min_filas] for i in range(len(min_filas[0]))] # transpuesta
@@ -2288,13 +2318,14 @@
                 ptos_terr.append([centro_x+dist,orig_y+(pto[2]-cotaMin)*escala+dif_y_ref,0,h+1,Trans_Pklist[h][4]])
             b=0
             for pto in secc[h]:
-                if pto !=[]:
+
+                if len(pto)>1:
                     dist=sqrt((Trans_Pklist[h][0]-pto[0])**2+(Trans_Pklist[h][1]-pto[1])**2)
                     if dist==0:b=1
                     if b==0: dist=-dist
                     cota_ras=orig_y+(pto[2]-cotaMin)*escala+dif_y_ref
                     t=t+1
-                    ptos_eje.append([centro_x+dist,cota_ras,0,t,h+1,Trans_Pklist[h][4],round(cota_ras,2),round(dist,2)])
+                    ptos_eje.append([centro_x+dist,cota_ras,0,t,h+1,Trans_Pklist[h][4],round(pto[2],2),round(dist,2)])
 
             # Eje y
             ejes_y.append([[orig_x-sep_eje_x,final_y,0,h+1,"'Y'"],[orig_x-sep_eje_x,orig_y,0,h+1,"'Y'"]])
@@ -2302,13 +2333,15 @@
             ejes_x.append([[orig_x-sep_eje_x,orig_y,0,h+1,"'X'",format_Pk(Trans_Pklist[h][4])],[final_x,orig_y,0,h+1,"'X'",Trans_Pklist[h][4]]])
 
             # Marcas eje x desde el centro
-            mark2_x=[]
+            mark2_x,mark2_x2=[],[]
             mark2_x.append([[orig_x,orig_y-2*mark_lon,0,q+1,-(centro_x-orig_x)],[orig_x,orig_y+2*mark_lon,0]])
             q=q+1
             for k in range(mark_x_dist,int(centro_x-orig_x),mark_x_dist):
-                mark2_x.append([[centro_x-k,orig_y-mark_lon,0,q+1,-((centro_x-orig_x)-((centro_x-orig_x) % mark_x_dist)-k+mark_x_dist)],
+                mark2_x2.append([[centro_x-k,orig_y-mark_lon,0,q+1,-((centro_x-orig_x)-((centro_x-orig_x) % mark_x_dist)-k+mark_x_dist)],
                                 [centro_x-k,orig_y+mark_lon,0]])
                 q=q+1
+            mark2_x.extend(mark2_x2[::-1])
+
             mark2_x.append([[centro_x,orig_y-2*mark_lon,0,q+1,0.0],[centro_x,orig_y+2*mark_lon,0]])
             q=q+1
             for k in range(mark_x_dist,int(final_x-centro_x),mark_x_dist):
@@ -2324,10 +2357,12 @@
             w=w+1
             mark_y.append([[orig_x-mark_lon-sep_eje_x,final_y,0,w,round(cotaMax-dif_y_ref,2)],[orig_x+mark_lon-sep_eje_x,final_y,0]])
             mark_x.extend(mark2_x)
-            h=h+1
+
             puntos_terr_ref.append(ptos_terr)
             ptos_eje_ref.append(ptos_eje)
 
+            h=h+1
+            if h == len(Trans_Pklist):break
 
     return ejes_x,ejes_y,mark_x,mark_y,puntos_terr_ref,ptos_eje_ref
 
@@ -2354,13 +2389,13 @@
 
 def read_TableAlz(EjeMap):
 
-    alzado = read_Table(EjeMap,3,'pk,elev,slope,kv,l,b')
+    alzado = read_Table(EjeMap,3,'pk,elev,kv,l,b')
     alzado = float_List(alzado)
     return alzado
 
 def read_TableSection(EjeMap):
 
-    section = read_Table(EjeMap,4,'pk,sec_left,sec_right,type_left,type_right,cut_left,cut_right,fill_left,fill_right,superelev_left,superelev_right')
+    section = read_Table(EjeMap,4,'pk,sec_left,sec_right,type_left,type_right,cut_left,cut_right,fill_left,fill_right')
     for i in range(len(section)):
         section[i][:5]=[float(p) for p in section[i][:5]]
     return section
@@ -2440,14 +2475,14 @@
 
 def update_TableAlz(EjeMap,ptsList):
 
-    update_Table(EjeMap,'_Vertical',3,ptsList,'pk,elev,slope,kv,l,b')
+    update_Table(EjeMap,'_Vertical',3,ptsList,'pk,elev,kv,l,b')
     return 0
 
 def update_TableSection(EjeMap,ptsList):
 
     for i,pts in enumerate(ptsList):
         ptsList[i][5:]=["'"+str(p)+"'" for p in ptsList[i][5:] if str(p).find("'")==-1]
-    update_Table(EjeMap,'_Section',4,ptsList,'pk,sec_left,sec_right,type_left,type_right,cut_left,cut_right,fill_left,fill_right,superelev_left,superelev_right')
+    update_Table(EjeMap,'_Section',4,ptsList,'pk,sec_left,sec_right,type_left,type_right,cut_left,cut_right,fill_left,fill_right')
     return 0
 
 def update_TableTransv(EjeMap,ptsList):
@@ -2459,13 +2494,13 @@
 
 def corrige_Alzado(puntos_eje,alz,EjeMap):
 
-    alz.sort(key=lambda x: x[4]) # alz=[x,y,z,cat,Pk,Cota,Pend,Kv,L,B]
+    alz.sort(key=lambda x: x[4]) # alz=[x,y,z,cat,Pk,Cota,Kv,L,B]
 
     for i in range(1,len(alz),1):
         if i < len(alz)-1:
             alz[i][0],alz[i][1]=get_PlantaXY(alz[i][4],puntos_eje)[:2]
         alz[i][3]=i+1
-        alz[i][6]=(float(alz[i][5])-alz[i-1][5])/(float(alz[i][4])-alz[i-1][4])
+        #alz[i][6]=(float(alz[i][5])-alz[i-1][5])/(float(alz[i][4])-alz[i-1][4])
     alz[-1][4]=puntos_eje[-1][-1][7]
     alz[-1][0],alz[-1][1],alz[-1][2]=puntos_eje[-1][0][:3]
     remove_Alz(EjeMap)
@@ -2573,13 +2608,12 @@
                       columns='pk_eje double, radio double, a_in double, \
                       a_out double, widening double', quiet=True)
         g.run_command('v.db.addtable', map=EjeMap, layer=3, key='cat3', table=EjeMap+'_Vertical',
-                      columns='pk double, elev double, slope double, \
+                      columns='pk double, elev double, \
                       kv double, l double, b double', quiet=True)
         g.run_command('v.db.addtable', map=EjeMap, layer=4, key='cat4', table=EjeMap+'_Section',
                       columns='pk double, sec_left varchar(25), sec_right varchar(25), \
                       type_left varchar(25), type_right varchar(25), \
-                      cut_left varchar(25), cut_right varchar(25), fill_left varchar(25), fill_right  varchar(25), \
-                      superelev_left varchar(25), superelev_right varchar(25)', quiet=True)
+                      cut_left varchar(25), cut_right varchar(25), fill_left varchar(25), fill_right varchar(25)', quiet=True)
         g.run_command('v.db.addtable', map=EjeMap, layer=5, key='cat5', table=EjeMap+'_Transv',
                       columns='pk double, dist_left double, dist_right double, npk double', quiet=True)
 
@@ -2587,10 +2621,10 @@
         planta=[]
         for i in range(len(pk_eje)):
             planta.append([verti[i][0],verti[i][1],verti[i][2],i+1,pk_eje[i],0.0,0.0,0.0,0.0,0.0,0.0])
-        alzado=[[verti[0][0],verti[0][1],verti[0][2],1,pk_eje[0],0.0,0.0,0.0,0.0,0.0],
-                [verti[-1][0],verti[-1][1],verti[-1][2],2,pk_eje[-1],0.0,0.0,0.0,0.0,0.0]]
-        seccion=[[verti[0][0],verti[0][1],verti[0][2],1,pk_eje[0],'','','','','','','','',''],
-                [verti[-1][0],verti[-1][1],verti[-1][2],2,pk_eje[-1],'','','','','','','','','']]
+        alzado=[[verti[0][0],verti[0][1],verti[0][2],1,pk_eje[0],0.0,0.0,0.0,0.0],
+                [verti[-1][0],verti[-1][1],verti[-1][2],2,pk_eje[-1],0.0,0.0,0.0,0.0]]
+        seccion=[[verti[0][0],verti[0][1],verti[0][2],1,pk_eje[0],'','','','','','',''],
+                [verti[-1][0],verti[-1][1],verti[-1][2],2,pk_eje[-1],'','','','','','','']]
         transv=[[verti[0][0],verti[0][1],verti[0][2],1,pk_eje[0],0.0,0.0,0.0],
                 [verti[-1][0],verti[-1][1],verti[-1][2],2,pk_eje[-1],0.0,0.0,0.0]]
 
@@ -2645,8 +2679,9 @@
 
 def write_Despl(dlines_izq,dlines_der,p_caract,p_vert,EjeMap,ext):
 
-    dlines=dlines_izq[:]
-    dlines.extend(dlines_der)
+    dlines = deepcopy(dlines_izq)
+    dlines2= deepcopy(dlines_der)
+    dlines.extend(dlines2)
 
     write_Polylines(dlines,EjeMap+ext,1)
     sdlines,cats=splitdlines(dlines)
@@ -2682,6 +2717,9 @@
     #                                         --> [   1 ,    1 ,    2 ,   3 ,...]
     tolines,cats=[],[]
     for j,line in enumerate(lines):
+        for h,pt in enumerate(line):
+            if len(pt) == 1:
+                line[h]=[]
         if [] in line:
             splitlist=[list(group) for k, group in groupby(line, lambda x: x == []) if not k] # split list
             tolines.extend(splitlist)
@@ -2720,7 +2758,7 @@
     i=0
     for j,line in enumerate(lines):
         for pp in line:
-            if pp==[]: continue
+            if len(pp)==1 or pp == []: continue
             sal_puntos+=str(i)+"|"+str(pp[4])+"|"+str(pp[5])+"|"+str(pp[6])+"|"+str(pp[0])+"|"+str(pp[1])+"|"+str(pp[2])+"\n"
             i=i+1
     g.write_command('v.in.ascii', flags='nz', output=name, stdin=sal_puntos, input='-',
@@ -2770,15 +2808,18 @@
 
     sal_linea=""
     for j,line in enumerate(lines):
-        if [] in line: continue
-        sal_linea+="B "+str(len(line)+1)+" 1\n"
+        longLine=1
+        sal_linea2=""
         for i,pp in enumerate(line):
+            if len(pp) > 1:
+                longLine+=1
+                sal_linea2+=str(pp[0])+" "+str(pp[1])+"\n"
 
-            sal_linea+=str(pp[0])+" "+str(pp[1])+"\n"
-
+        sal_linea+="B "+str(longLine)+" 1\n"
+        sal_linea+=sal_linea2
         sal_linea+=str(line[0][0])+" "+str(line[0][1])+"\n"
         sal_linea+="1 "+str(j+1)+"\n"
-    #print sal_linea
+
     g.write_command('v.in.ascii', flags='nz', output=name, stdin=sal_linea,
                         input='-', format='standard', overwrite=True, quiet=True)
     return 0
@@ -2824,7 +2865,7 @@
 def lista_PksEje(Puntos_Eje,Puntos_EjeAlz,puntos,table_alz,table_secc,table_transv):
 
     pkpuntos=[round(p[4],6) for p in puntos]
-    for alz in table_alz+table_secc+table_transv:
+    for alz in table_secc+table_transv:
         if round(alz[4],6) not in pkpuntos:
             pkpuntos.append(alz[4])
             x,y,z,cat,PK,Az,tipo,align=get_PlantaXY(round(alz[4],6),Puntos_Eje)[:8]
@@ -2933,13 +2974,13 @@
 
     if flags['n']:
 
-        g.message("Creating/Updating edge map")
+        g.message("Creating/Updating polygon map")
         update_EdgeMap(NameMap)
 
 
     if flags['u']:
 
-        g.message("Reading edge tables")
+        g.message("Reading polygon tables")
         ### Lectura tablas eje
 
         table_plant= read_TablePlant(NameMap)
@@ -2971,11 +3012,13 @@
 
         Desplazados_izq,Desplazados_der,DPtos_caract=generate_Desplaz(table_plant,table_secc,Puntos2)
 
+        #print len(Puntos),len(Puntos2),len(Desplazados_izq[0]),len(Desplazados_izq[1]),len(Desplazados_izq[2]),len(Desplazados_der[0]),len(Desplazados_der[1]),len(Desplazados_der[2])
+
         Desplaz_Areas=generate_DesplazAreas(Desplazados_izq[:],Puntos2[:],Desplazados_der[:])
 
         Transversales,Trans_Pklist=generate_Transv(Puntos,table_transv)
 
-        Transv_Despl = get_TransDespl(Transversales,Desplazados_izq,Desplazados_der)
+        Transv_Despl = get_TransDespl(Transversales,Desplazados_izq[:],Desplazados_der[:])
 
         Transv_Discr =  discr_Lines(Transv_Despl,1)
 
@@ -3063,7 +3106,7 @@
             ##################################################################
             g.message("Generating terrain maps")
 
-            Puntos_Talud_izq,Puntos_Talud_der=generate_Taludes(Puntos,Desplazados_izq,Desplazados_der,table_secc,Terreno_Array)
+            Puntos_Talud_izq,Puntos_Talud_der=generate_Taludes(Puntos2,Desplazados_izq,Desplazados_der,table_secc,Terreno_Array)
 
             Taludes_Areas=generate_TaludesAreas(Puntos_Talud_izq,Desplazados_izq,Desplazados_der,Puntos_Talud_der)
 
@@ -3200,16 +3243,16 @@
 
                 if flags['m']:
 
-                    if re.search(r'^_', options['LPedgeX']): nameEdgeX=NameMap+options['LPedgeX']
-                    else: nameEdgeX=options['LPedgeX']
+                    if re.search(r'^_', options['LPaxisX']): nameEdgeX=NameMap+options['LPaxisX']
+                    else: nameEdgeX=options['LPaxisX']
 
-                    if re.search(r'^_', options['LPedgeXmarks']): nameEdgeXmarks=NameMap+options['LPedgeXmarks']
-                    else: nameEdgeXmarks=options['LPedgeXmarks']
+                    if re.search(r'^_', options['LPaxisXmarks']): nameEdgeXmarks=NameMap+options['LPaxisXmarks']
+                    else: nameEdgeXmarks=options['LPaxisXmarks']
 
-                    if re.search(r'^_', options['LPedgeY']): nameEdgeY=NameMap+options['LPedgeY']
-                    else: nameEdgeY=options['LPedgeY']
+                    if re.search(r'^_', options['LPaxisY']): nameEdgeY=NameMap+options['LPaxisY']
+                    else: nameEdgeY=options['LPaxisY']
 
-                    if re.search(r'^_', options['LPedgeYmarks']): nameEdgeYmarks=NameMap+options['LPedgeYmarks']
+                    if re.search(r'^_', options['LPaxisYmarks']): nameEdgeYmarks=NameMap+options['LPaxisYmarks']
                     else: nameEdgeYmarks=options['LPedgeYmarks']
 
                     write_Polylines(eje_x,nameEdgeX,1)
@@ -3264,17 +3307,17 @@
 
                 if flags['g']:
 
-                    if re.search(r'^_', options['LTedgeX']): nameTEdgeX=NameMap+options['LTedgeX']
-                    else: nameTEdgeX=options['LTedgeX']
+                    if re.search(r'^_', options['LTaxisX']): nameTEdgeX=NameMap+options['LTaxisX']
+                    else: nameTEdgeX=options['LTaxisX']
 
-                    if re.search(r'^_', options['LTedgeXmarks']): nameTEdgeXmarks=NameMap+options['LTedgeXmarks']
-                    else: nameTEdgeXmarks=options['LTedgeXmarks']
+                    if re.search(r'^_', options['LTaxisXmarks']): nameTEdgeXmarks=NameMap+options['LTaxisXmarks']
+                    else: nameTEdgeXmarks=options['LTaxisXmarks']
 
-                    if re.search(r'^_', options['LTedgeY']): nameTEdgeY=NameMap+options['LTedgeY']
-                    else: nameTEdgeY=options['LTedgeY']
+                    if re.search(r'^_', options['LTaxisY']): nameTEdgeY=NameMap+options['LTaxisY']
+                    else: nameTEdgeY=options['LTaxisY']
 
-                    if re.search(r'^_', options['LTedgeYmarks']): nameTEdgeYmarks=NameMap+options['LTedgeYmarks']
-                    else: nameTEdgeYmarks=options['LTedgeYmarks']
+                    if re.search(r'^_', options['LTaxisYmarks']): nameTEdgeYmarks=NameMap+options['LTaxisYmarks']
+                    else: nameTEdgeYmarks=options['LTaxisYmarks']
 
                     write_Polylines(ejes_x,nameTEdgeX,1)
                     write_Polylines(mark_x,nameTEdgeXmarks,1)

Added: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_10.png
===================================================================
(Binary files differ)


Property changes on: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_10.png
___________________________________________________________________
Added: svn:mime-type
   + image/png

Added: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_11.png
===================================================================
(Binary files differ)


Property changes on: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_11.png
___________________________________________________________________
Added: svn:mime-type
   + image/png

Added: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_12.png
===================================================================
(Binary files differ)


Property changes on: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_12.png
___________________________________________________________________
Added: svn:mime-type
   + image/png

Added: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_13.png
===================================================================
(Binary files differ)


Property changes on: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_13.png
___________________________________________________________________
Added: svn:mime-type
   + image/png

Added: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_14.png
===================================================================
(Binary files differ)


Property changes on: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_14.png
___________________________________________________________________
Added: svn:mime-type
   + image/png

Added: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_5.png
===================================================================
(Binary files differ)


Property changes on: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_5.png
___________________________________________________________________
Added: svn:mime-type
   + image/png

Added: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_6.png
===================================================================
(Binary files differ)


Property changes on: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_6.png
___________________________________________________________________
Added: svn:mime-type
   + image/png

Added: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_7.png
===================================================================
(Binary files differ)


Property changes on: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_7.png
___________________________________________________________________
Added: svn:mime-type
   + image/png

Added: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_8.png
===================================================================
(Binary files differ)


Property changes on: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_8.png
___________________________________________________________________
Added: svn:mime-type
   + image/png

Added: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_9.png
===================================================================
(Binary files differ)


Property changes on: grass-addons/grass7/vector/v.civil/v.civil.road/vcivilroad_9.png
___________________________________________________________________
Added: svn:mime-type
   + image/png



More information about the grass-commit mailing list