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