Hi,

thanks a lot Michaël and Larry.
To limit the (inner) iteration through the features of layer b to those 
features which envelopes intersect the envelope of layer a-feature 
speeds up things a lot (approx. factor 120!).
The methods 
com.vividsolutions.jump.feature.FeatureCollectionWrapper.query() and 
com.vividsolutions.jump.feature.IndexedFeatureCollection.query() seem to 
work the same way, at least there is no difference in the performance 
with my data.

By the way:
com.vividsolutions.jts.geom.Geometry.intersects(Geometry geom) is less 
expensive than 
com.vividsolutions.jts.geom.Geometry.intersection(Geometry geom):
To replace

dblAreaIntersectionTemp+=featureB.getGeometry().intersection(featureA.getGeometry()).getArea();

with

if (featureB.getGeometry().intersects(featureA.getGeometry())) {
    
dblAreaIntersectionTemp+=featureB.getGeometry().intersection(featureA.getGeometry()).getArea();
}

in the inner loop speeds up things twice (even though both methods, 
intersects AND intersection are applied to the intersecting geometries)!

Regards,
Nils

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to