<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div>Hola Ulises,</div>
<div><br>
</div>
<div>Posiblemente no la mejor solución, pero una posibilidad. Ten en cuenta que yo soy algo nueva en esto y seguro que otra gente puede ayudar mejor, pero ahi va mi intento: </div>
<div><br>
</div>
<div>1. - Yo ingeriría el shapefile en una DB PostGIS con ogr2ogr[1], por ejemplo. Algo como:</div>
<div><br>
</div>
<div>ogr2ogr -f "PostgreSQL" PG:"dbname=db etc" shapefile.shp</div>
<div><br>
</div>
<div>2.- Luego extraería los puntos junto con las IDs y los tiempos de las rutas en una tabla, usando ST_DumpPoints[2].</div>
<div><br>
</div>
<div>3.- A partir de la tabla de puntos, con ST_Makeline[3], ordenando los puntos por tiempos y agrupando por ID, te quedaría una tabla de LINESTRINGS con una entrada por ruta, con todos los puntos unidos en orden. Por ejemplo:</div>
<div><br>
</div>
<div>
<div>CREATE TABLE route_lines</div>
<div>AS (</div>
<div>    SELECT id,</div>
<div>        count(*) AS points_count,</div>
<div>        ST_MakeLine(location order by time) AS trajectory</div>
<div>    FROM (</div>
<div>        SELECT *</div>
<div>        FROM route_points</div>
<div>    )</div>
<div>    AS lines</div>
<div>    GROUP BY id</div>
<div>);</div>
</div>
<div><br>
</div>
<div>Probablemente esto se puede hacer en un solo paso, pero mi SQL no llega a tanto, me temo 0:-) </div>
<div><br>
</div>
<div>Espero que ayude!</div>
<div><br>
</div>
<div>[1] <a href="http://www.gdal.org/drv_pg.html">http://www.gdal.org/drv_pg.html</a></div>
<div>[2] <a href="http://postgis.net/docs/ST_DumpPoints.html">http://postgis.net/docs/ST_DumpPoints.html</a></div>
<div>[3] <a href="http://postgis.net/docs/ST_MakeLine.html">http://postgis.net/docs/ST_MakeLine.html</a></div>
<div><br>
</div>
<div>
<div id="MAC_OUTLOOK_SIGNATURE"></div>
</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:12pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Ulises Ibarra<br>
<span style="font-weight:bold">Reply-To: </span>Capítulo Local de la comunidad hispano-hablante<br>
<span style="font-weight:bold">Date: </span>Friday, 24 July 2015 07:21<br>
<span style="font-weight:bold">To: </span>Capítulo Local de la comunidad hispano-hablante<br>
<span style="font-weight:bold">Subject: </span>[Spanish] Como unir fragmentos de líneas por sus extremos<br>
</div>
<div><br>
</div>
<span style="color: rgb(0, 0, 0); font-family: Calibri; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none;">Muy
 estimada lista:</span>
<div style="color: rgb(0, 0, 0); font-family: Calibri; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
Tengo una duda enorme. Una amiga de comenta que tiene un archivo shp con 1500 rutas de GPS, cada ruta con un ID. Pero esas rutas tienen duscontinuidades, es decir, están rotas y ella quiere unirlas de forma más o menimos automática. ¿Podrían decirme sí hay
 algo que pueda hacer?</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
Gracias por adelantado</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
Ulises</div>
</span>
</body>
</html>