use of com.vividsolutions.jts.index.sweepline.SweepLineOverlapAction in project activityinfo by bedatadriven.
the class BatchGeocoder method geocode.
public List<List<AdminEntity>> geocode() {
entities = queryEntities();
// add the entities to the sweep line index
indexEntities();
index.computeOverlaps(new SweepLineOverlapAction() {
@Override
public void overlap(SweepLineInterval s0, SweepLineInterval s1) {
// is this an overlap between a point and and entity?
if (s0.getItem() instanceof Integer && s1.getItem() instanceof AdminEntity) {
checkContains((Integer) s0.getItem(), (AdminEntity) s1.getItem());
} else if (s1.getItem() instanceof Integer && s0.getItem() instanceof AdminEntity) {
checkContains((Integer) s1.getItem(), (AdminEntity) s0.getItem());
}
}
});
return results;
}
Aggregations