/**
* {@inheritDoc}
*/
public void process(RelationContainer container) {
Relation relation;
boolean inArea;
boolean holdBackRelation;
relation = container.getEntity();
// First look through all the node and way members to see if any are within the filtered area
inArea = false;
holdBackRelation = false;
for (RelationMember member : relation.getMembers()) {
switch (member.getMemberType()) {
case Node:
inArea = availableNodes.get(member.getMemberId());
break;
case Way:
inArea = availableWays.get(member.getMemberId());
break;
case Relation:
inArea = availableRelations.get(member.getMemberId());
break;
default:
break;
}
if (inArea) {
break;
}
}
if (cascadingRelations) { // && referencesOtherRelation && (!inArea || clipIncompleteEntities)) {
holdBackRelation = true;
}
// Check if we're storing entities for later.
if (storeEntities || holdBackRelation) {
allRelations.add(container);
}
// If the relation has at least one member in the filtered area.
if (inArea) {
availableRelations.set(relation.getId());
// If we're not storing entities, we pass it on immediately.
if (!storeEntities && !holdBackRelation) {
emitRelation(container);
}