use of com.marcnuri.yakc.model.io.k8s.api.core.v1.Node in project osmosis by openstreetmap.
the class BoundingBoxFilterTest method setUp.
/**
* Performs pre-test activities.
*/
@Before
public void setUp() {
OsmUser user;
List<Tag> tags;
user = new OsmUser(12, "OsmosisTest");
// All nodes have an empty tags list.
tags = new ArrayList<Tag>();
entityInspector = new SinkEntityInspector();
// simpleAreaFilter doesn't cross antimeridian; no complete ways or relations
simpleAreaFilter = new BoundingBoxFilter(IdTrackerType.Dynamic, -20, 20, 20, -20, false, false, false, false);
simpleAreaFilter.setSink(entityInspector);
intersectingBound = new Bound(30, 10, 30, 10, "intersecting");
nonIntersectingBound = new Bound(-30, -50, 10, -10, "nonintersecting");
inAreaNode = new Node(new CommonEntityData(1234, 0, new Date(), user, 0, tags), 10, 10);
outOfAreaNode = new Node(new CommonEntityData(1235, 0, new Date(), user, 0, tags), 30, 30);
edgeNodeEast = new Node(new CommonEntityData(1236, 0, new Date(), user, 0, tags), 10, 20);
edgeNodeWest = new Node(new CommonEntityData(1237, 0, new Date(), user, 0, tags), 10, -20);
edgeNodeNorth = new Node(new CommonEntityData(1238, 0, new Date(), user, 0, tags), 20, 10);
edgeNodeSouth = new Node(new CommonEntityData(1239, 0, new Date(), user, 0, tags), -20, 10);
}
use of com.marcnuri.yakc.model.io.k8s.api.core.v1.Node in project osmosis by openstreetmap.
the class PolygonFilterTest method setUp.
/**
* Performs pre-test activities.
*/
@Before
public void setUp() {
OsmUser user;
List<Tag> tags;
user = new OsmUser(12, "OsmosisTest");
// All nodes have an empty tags list.
tags = new ArrayList<Tag>();
polygonFile = new File(getClass().getResource("testPolygon.txt").getFile());
entityInspector = new SinkEntityInspector();
// polyAreaFilter has a notch out of the Northeast corner.
polyAreaFilter = new PolygonFilter(IdTrackerType.Dynamic, polygonFile, false, false, false, false);
polyAreaFilter.setSink(entityInspector);
intersectingBound = new Bound(30, 0, 30, 0, "intersecting");
crossingIntersectingBound = new Bound(-10, 10, 30, -30, "crossing intersecting");
nonIntersectingBound = new Bound(30, 15, 30, 15, "nonintersecting");
inAreaNode = new Node(new CommonEntityData(1234, 0, new Date(), user, 0, tags), 5, 10);
outOfAreaNode = new Node(new CommonEntityData(1235, 0, new Date(), user, 0, tags), 15, 15);
edgeNode = new Node(new CommonEntityData(1236, 0, new Date(), user, 0, tags), 15, 10);
}
use of com.marcnuri.yakc.model.io.k8s.api.core.v1.Node in project osmosis by openstreetmap.
the class NodeKeyFilter method process.
/**
* {@inheritDoc}
*/
public void process(NodeContainer container) {
Node node = container.getEntity();
boolean matchesFilter = false;
for (Tag tag : node.getTags()) {
if (allowedKeys.contains(tag.getKey())) {
matchesFilter = true;
break;
}
}
if (matchesFilter) {
sink.process(container);
}
}
use of com.marcnuri.yakc.model.io.k8s.api.core.v1.Node in project osmosis by openstreetmap.
the class NodeKeyValueFilter method process.
/**
* {@inheritDoc}
*/
public void process(NodeContainer container) {
Node node = container.getEntity();
boolean matchesFilter = false;
for (Tag tag : node.getTags()) {
String keyValue = tag.getKey() + "." + tag.getValue();
if (allowedKeyValues.contains(keyValue)) {
matchesFilter = true;
break;
}
}
if (matchesFilter) {
sink.process(container);
}
}
use of com.marcnuri.yakc.model.io.k8s.api.core.v1.Node in project osmosis by openstreetmap.
the class TagFilterTest method setUp.
/**
* Performs pre-test activities.
*/
@Before
public void setUp() {
OsmUser user;
List<Tag> tags;
user = new OsmUser(12, "OsmosisTest");
tags = Arrays.asList(new Tag("amenity", "bank"), new Tag("Akey", "Avalue"));
amenityNode = new Node(new CommonEntityData(1101, 0, new Date(), user, 0, tags), 1, 2);
amenityNodeContainer = new NodeContainer(amenityNode);
tags = new ArrayList<Tag>();
taglessNode = new Node(new CommonEntityData(1102, 0, new Date(), user, 0, tags), 3, 4);
taglessNodeContainer = new NodeContainer(taglessNode);
tags = Arrays.asList(new Tag("highway", "motorway"), new Tag("Bkey", "Bvalue"));
motorwayWay = new Way(new CommonEntityData(2201, 0, new Date(), user, 0, tags), new ArrayList<WayNode>());
motorwayWayContainer = new WayContainer(motorwayWay);
tags = Arrays.asList(new Tag("highway", "residential"), new Tag("Ckey", "Cvalue"));
residentialWay = new Way(new CommonEntityData(2202, 0, new Date(), user, 0, tags), new ArrayList<WayNode>());
residentialWayContainer = new WayContainer(residentialWay);
tags = Arrays.asList(new Tag("Dkey", "Dvalue"));
testRelation = new Relation(new CommonEntityData(3301, 0, new Date(), user, 0, tags), new ArrayList<RelationMember>());
testRelationContainer = new RelationContainer(testRelation);
}
Aggregations