The ordering was made to allow determining the "depth" of subgraphs which
are nested within other graphs. This corresponds to a situation where the
buffer creates holes within polygons and polygons nested within holes.
When a disjoint graph is encountered, a stabbing line is constructed from
the righmost segment, and all segments in other subgraphs which intersect
this are found. The minimum one is then computed - this is what the
ordering is used for.
By linear ordering I really mean a total ordering of segments which:
(a) determines the leftmost segment in a set
(b) obeys the general contract for Comparator.
LineSegment#compareTo satifies (b), but not (a) (it's just a lexocographic
ordering by endpoint, which doesn't handle the case where the segments lie
"close together" (i.e. their envelopes overlap). For instance, the
following ASCII diagram shows a situation where A is left of B but would be
greater than B under the LineSegment order:
| /
A | /
/
/ B
/
On Thu, Feb 5, 2015 at 1:47 PM, Michael Michaud <[email protected]
> wrote:
> Hi Martin,
>
> The DepthSegment compareTo still does not obey the contract,
> unfortunately. It's difficult to come up with a consistent linear ordering
> for 2D segments.
>
> It would be great if someone can build this and give it a test with real
> data.
>
> What is this ordering made for, and what do you mean by linear ordering ?
> Isn't LineSegment#compareTo method enough to get a strict ordering over
> segments for example ?
>
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Jts-topo-suite-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user