Dear JTS list members,
UnaryUnionOp.union() operation is a solution to remove shared edges of
several contiguous polygons. As an example, spatial union of:
P1 = POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))
and
P2 = POLYGON ((10 5, 10 10, 15 10, 15 5, 10 5))
produces:
POLYGON ((0 0, 0 10, 10 10, 15 10, 15 5, 10 5, 10 0, 0 0))
Let's assume, A1 attribute corresponds to P1 and A2 attribute corresponds
to P2. I'm looking for robust and efficient solution able to assign
attribute values to each edge (resulting from spatial union of input
polygons). With the previous example, I would like to obtain:
A1 -> LINESTRING((0 0, 0 10))
A1 -> LINESTRING((0 10, 10 10))
A2 -> LINESTRING((10 10, 15 10))
A2 -> LINESTRING((15 10, 15 5))
A2 -> LINESTRING((15 5, 10 5))
A1 -> LINESTRING((10 5, 10 0))
A1 -> LINESTRING((10 0, 0 0))
A simple (but heavy) solution consists in a loop on each edge (resulting
from spatial union) with an intersection test... so as to identify
corresponding parent polygon. To speed this test up, it is worth using a
spatial index.
I wonder whether, there exists some solution analogous to the one proposed
by M Davies last Oct. 28 (in a post entitled "tracking constraint segments
in ConformingDelaunayTriangulationBuilder or
ConformingDelaunayTriangulator"):
> One way to do this is to set the data attribute on the segments input as
> constraints, using the constructor Segment(Coordinate p0, Coordinate p1,
Object data)
Any help is welcome.
Thomas
--
Thomas LEDUC
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Jts-topo-suite-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user