<div dir="ltr"><div><div><div>You can use <br><a href="http://postgis.refractions.net/docs/ST_Reverse.html">http://postgis.refractions.net/docs/ST_Reverse.html</a><br><br></div>Or simply ORDER BY DESC for your path<br><br>
</div>Cheers,<br><br></div>Rémi-C<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-25 11:49 GMT+01:00 Pedro Costa <span dir="ltr"><<a href="mailto:pedrocostaarma@sapo.pt" target="_blank">pedrocostaarma@sapo.pt</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>Hi Rémi,<br>
<br>
Thanks for your awnser.<br>
My problem is that the draw order isn't equal in all lines so the
path of st_dumppoints sometimes return ascend order and another
times descend. I need to make a loop to make a reverse...<br>
<br>
Em 25-02-2014 08:33, Rémi Cura escreveu:<br>
</div><div><div class="h5">
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>Hey,<br>
</div>
I don't understand your problem.<br>
<br>
</div>
If you have multilinestring, you need to break it to
linestring with an id per multilinestring.<br>
</div>
If you have linestring, you just need to keep an id for each
line and an id per point (given in path).<br>
<br>
</div>
Then you have several option to generate a ordered set of
point (use the ORDER BY and the row_number() postgres
function).<br>
<br>
</div>
If you give some detailled example maybe we could help better.<br>
<br>
Cheers,<br>
Rémi-C<br>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">2014-02-24 19:27 GMT+01:00 Stephen
Woodbridge <span dir="ltr"><<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div>On 2/24/2014 11:33 AM, Pedro Costa wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi guys,<br>
<br>
I'm trying to use lines from postgis to google maps
android.<br>
To do that, I'm converting the lines to points with
St_DumpPoints and,<br>
in gmaps, I make the lines. My problem is that I
cannot create a correct<br>
sequence to order the points in android and so i get
wrong lines (see ss<br>
atached). I'm already try to use st_dumpPoints path
column and generate<br>
a serial but doesn't result.<br>
<br>
Anybody knows a solution to resolve that?<br>
</blockquote>
<br>
</div>
</div>
You probably need to write function that re-orients you
lines before you dump them to points. The algorithm is like
this:<br>
<br>
1. for the first edge, if the start point match the the
start or end of the 2nd edge, if it does then st_reverse()
the first edge.<br>
<br>
2. for the rest of the edges, if the edge point of the
current edge matches the end point of the last edge, then
st_reverse() the current edge.<br>
<br>
You might be able to st_union all the edges into one large
edge and that should create a new reorder edge.<br>
<br>
No you can dump them and the order will be correct.<br>
<br>
-Steve<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
postgis-users mailing list
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a></pre>
</blockquote>
<br>
</div></div></div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>