Hi,
//STRtree (JTS package) and IndexedFeatureCollection (jump) are your
friends,
//You can use the index like that :
IndexedFeatureCollection ifc = new IndexedFeatureCollection(fcB, new
STRtree());
//Then your second loop just go through the result of the following request
List candidates = ifc.query(featureA.getEnvelopeInternal());
// candidates contains features of fcB having their envelope
intersecting envelope of feature A in a very fast way
for (Feature candidate : candidates) {
// your test
}
//Code may contains errors, hope that's enough for you to catch the idea
Michaël
Nils Kuhn a écrit :
> Hi all,
>
> I have the following problem:
> I have two polygon-layers with many thousands of features. In layer a
> I want to flag in an integer-field for every feature, whether the area
> of the intersection with the polygons of layer b amounts more than 1
> percent of the area himself.
>
> The attached code works, but the calculation would last about two
> weeks, I think...
>
> Can anybody see a better way than my nested loop through the features
> of both layers? I searched for a function like*
> *com.vividsolutions.jump.feature.FeatureCollectionWrapper.query(|com.vividsolutions.jts.geom.Envelope
> envelope|),
> but I would like to refer a geometry instead of an envelope.
>
> Thanks for any ideas in advance.
> Regards, Nils
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> ------------------------------------------------------------------------
>
> _______________________________________________
> Jump-pilot-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel