If you have guava, multimap
<http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/collect/Multimap.html>might
solve the "segments not distinct" problem that Rob alluded to.

Another thing to consider is segment orientation -- LineSegment (p0, p1) is
not equal to LineSegment (p1, p0), but I think you'd want it to be for
this.  Choosing them such that p0.compareTo(p1) is always less than or
equal to 0 would solve that problem.

Is this solution really an improvement over a SpatialIndex solution,
though?  It seems like even if it is, it wouldn't be too significant, as
the structure of the solution hasn't really changed -- it still builds up a
big data structure that it queries for each coordinate in the output
polygon list.  The only thing that's changed is what that data structure is
and how it's queried.

On Tue, Nov 25, 2014 at 5:59 PM, Rob Emanuele <[email protected]> wrote:

> Well, the original linestrings and the border/polygon hole line strings
> wouldn't necessarily be equal, correct? One option would be to first
> dissolve the line strings into segments, so that all resulting line strings
> were one segment long. Construct the hashmap from that set. Then after
> polygonization, you could walk the segments of the polygon linestrings and
> use the hashmap to determine the values of contributing line strings. If
> line string values are not unique, this method would require some tweaking.
>
>
>
> > On Nov 25, 2014, at 4:48 PM, Michael Bedward <[email protected]>
> wrote:
> >
> > Hi Peter,
> >
> > Perhaps a HashMap of LineString -> Double will do the trick ?
> >
> > Michael
> >
> >> On 26 November 2014 at 05:29, Peter Kovac <[email protected]>
> wrote:
> >> Hi JTS,
> >>
> >> I'm computing a polygonization of a large set of LineStrings (tens to
> >> hundred thousands), each with one Double value as user data. What is the
> >> most efficient way to determine for each resulting polygon the set of
> >> Double values of LineStrings which are the borders of the polygon?
> >>
> >> Can I find by extending the Poylgonizer somehow (I think it's unlikely)?
> >> Currently, I keep the input LineStrings in a SpatialIndex and query each
> >> polygon coordinate for LineStrings containing it, but it's a very slow
> >> process (tens of seconds).
> >>
> >> For example:
> >> Let's give LineStrings in this MULTILINESTRING ((10 0, 0 0, 0 20, 10
> >> 20), (10 0, 20 0, 20 20, 10 20), (10 0, 10 20)) values 1, 2, and 3
> >> respectively.
> >> Then the set of values of POLYGON ((10 20, 10 0, 0 0, 0 20, 10 20)) is
> >> {1, 3} and of POLYGON ((10 20, 20 20, 20 0, 10 0, 10 20)) is {2, 3}.
> >>
> >> Thank you,
> >>
> >> --
> >> Peter Kovac
> >> MicroStep-MIS
> >> Programmer
> >> [email protected]
> >> http://www.microstep-mis.com
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> >> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> >> with Interactivity, Sharing, Native Excel Exports, App Integration &
> more
> >> Get technology previously reserved for billion-dollar corporations, FREE
> >>
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> >> _______________________________________________
> >> Jts-topo-suite-user mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user
> >
> >
> ------------------------------------------------------------------------------
> > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> > from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> > with Interactivity, Sharing, Native Excel Exports, App Integration & more
> > Get technology previously reserved for billion-dollar corporations, FREE
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Jts-topo-suite-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> _______________________________________________
> Jts-topo-suite-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Jts-topo-suite-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user

Reply via email to