An example:<br><br><font face="courier new, monospace">with pg_pts_oriented as (</font><div><font face="courier new, monospace"><br>   select st_dumpPoints(<br>      st_exteriorRing(<br>         st_forceRHR(<br>            'POLYGON (( 355 215, 390 220, 403 258, 364 234, 375 277, 326 274, 286 243, 355 215 ))'::geometry<br>
         )<br>      )<br>   ) as d<br>) select (p1.d).path[1] as edge_number, st_makeLine((p1.d).geom, (p2.d).geom) as edge <br>from pg_pts_oriented p1,<br>pg_pts_oriented p2<br>where (p2.d).path[1] = (p1.d).path[1] + 1;</font><br>
<br><br>On 24 August 2012 10:24, Nicolas Ribot <<a href="mailto:nicolas.ribot@gmail.com">nicolas.ribot@gmail.com</a>> wrote:<br>> Hi,<br>><br>> Yes, it seems possible:<br>><br>> • First force polygon orientation to be CW: st_forceRHR()<br>
> • Then, extract the polygons outer rings (st_exteriorRing) (if<br>> polygons have holes or are multipolygons, you may want to deal with<br>> these cases)<br>> • With st_dumppoints(), you will dump the points forming theses<br>
> exteriors (linestrings). It will give you the index of the vertex.<br>> • You will then be able to build edges if you need them<br>> (st_makeLine()), or just number them virtually.<br>><br>> Nicolas<br>><br>
> On 23 August 2012 19:56, Zmitser Kozhukh <<a href="mailto:zmitserk@mail.ru">zmitserk@mail.ru</a>> wrote:<br>>> hello!<br>>> I've a question and would be really grateful if someone helps...dunno if it<br>
>> is a trivial thing to do...<br>>> I have a polygon boundary and want to number all polygon edges starting from<br>>> certain vertice for instance in clockwise direction....so the first edge to<br>>> the left from certain vertice will have number one, then the next one to the<br>
>> left number two etc...until all edges will be numbered.<br>>> does anyone have an idea how to do it?<br>>> thanks a lot.<br>>> storm_bringer<br>>><br>>> _______________________________________________<br>
>> postgis-users mailing list<br>>> <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>>> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
>><br></div>