@Override public void process(BoundContainer bound) { // Specialcase this. Assume we only ever get one contigious bound // request. switchTypes(); processBounds(bound.getEntity()); }
/** * {@inheritDoc} */ public void process(BoundContainer bound) { if (boundWritten) { throw new OsmosisRuntimeException("Bound element already written and only one allowed."); } if (entitiesWritten) { throw new OsmosisRuntimeException("Can't write bound element after other entities."); } boundWriter.process(bound.getEntity()); boundWritten = true; } }
/** * {@inheritDoc} */ public void process(BoundContainer bound) { if (boundWritten) { throw new OsmosisRuntimeException("Bound element already written and only one allowed."); } if (entitiesWritten) { throw new OsmosisRuntimeException("Can't write bound element after other entities."); } boundWriter.process(bound.getEntity()); boundWritten = true; } }
/** * {@inheritDoc} */ @Override public void process(BoundContainer boundContainer) { Bound newBound; /* * The order of calling intersect is important because the first non-empty origin string * will be used for the resulting Bound, and we want the origin string from the pipeline * Bound to be used. */ newBound = boundContainer.getEntity().intersect(bound); // intersect will return null if there is no overlapping area if (newBound != null) { // Send on a bound element clipped to the area super.process(new BoundContainer(newBound)); } }
/** * {@inheritDoc} */ @Override public void process(BoundContainer boundContainer) { Bound newBound; /* * The order of calling intersect is important because the first non-empty origin string * will be used for the resulting Bound, and we want the origin string from the pipeline * Bound to be used. */ newBound = boundContainer.getEntity().intersect(bound); // intersect will return null if there is no overlapping area if (newBound != null) { // Send on a bound element clipped to the area super.process(new BoundContainer(newBound)); } }
/** * {@inheritDoc} */ @Override public void process(BoundContainer boundContainer) { Bound newBound = null; // Configure the area if it hasn't been created yet. (Should this be in an "initialize" method?) if (area == null) { area = new PolygonFileReader(polygonFile).loadPolygon(); } for (Bound b : boundContainer.getEntity().toSimpleBound()) { if (newBound == null) { newBound = simpleBoundIntersect(b); } else { newBound = newBound.union(simpleBoundIntersect(b)); } } if (newBound != null) { super.process(new BoundContainer(newBound)); } }
/** * {@inheritDoc} */ @Override public void process(BoundContainer boundContainer) { Bound newBound = null; // Configure the area if it hasn't been created yet. (Should this be in an "initialize" method?) if (area == null) { area = new PolygonFileReader(polygonFile).loadPolygon(); } for (Bound b : boundContainer.getEntity().toSimpleBound()) { if (newBound == null) { newBound = simpleBoundIntersect(b); } else { newBound = newBound.union(simpleBoundIntersect(b)); } } if (newBound != null) { super.process(new BoundContainer(newBound)); } }