use of com.revolsys.geometry.model.TopologyException in project com.revolsys.open by revolsys.
the class Buffer method bufferReducedPrecision.
private static Geometry bufferReducedPrecision(final Geometry geometry, final double distance, final BufferParameters parameters) {
TopologyException saveException = null;
// try and compute with decreasing precision
for (int precDigits = MAX_PRECISION_DIGITS; precDigits >= 0; precDigits--) {
try {
final double sizeBasedScaleFactor = precisionScaleFactor(geometry, distance, precDigits);
final GeometryFactory precisionModel = geometry.getGeometryFactory().convertScales(sizeBasedScaleFactor, sizeBasedScaleFactor);
return bufferFixedPrecision(precisionModel, geometry, distance, parameters);
} catch (final TopologyException e) {
saveException = e;
// TODO remove
// throw e;
}
}
throw saveException;
}
use of com.revolsys.geometry.model.TopologyException in project com.revolsys.open by revolsys.
the class BufferSubgraph method computeNodeDepth.
private void computeNodeDepth(final Node n) {
// find a visited dirEdge to start at
DirectedEdge startEdge = null;
for (final Object element : (DirectedEdgeStar) n.getEdges()) {
final DirectedEdge de = (DirectedEdge) element;
if (de.isVisited() || de.getSym().isVisited()) {
startEdge = de;
break;
}
}
// only compute string append if assertion would fail
if (startEdge == null) {
throw new TopologyException("unable to find edge to compute depths at POINT(" + n.getX() + " " + n.getY() + ")");
}
((DirectedEdgeStar) n.getEdges()).computeDepths(startEdge);
// copy depths to sym edges
for (final Object element : (DirectedEdgeStar) n.getEdges()) {
final DirectedEdge de = (DirectedEdge) element;
de.setVisited(true);
copySymDepths(de);
}
}
use of com.revolsys.geometry.model.TopologyException in project com.revolsys.open by revolsys.
the class ScaleMultipleRenderer method renderRecords.
@Override
protected // NOTE: Needed for multiple styles
void renderRecords(final Viewport2D viewport, final Cancellable cancellable, final AbstractRecordLayer layer, final List<LayerRecord> records) {
final BoundingBox visibleArea = viewport.getBoundingBox();
final AbstractRecordLayerRenderer renderer = getRenderer(viewport);
if (renderer != null) {
for (final LayerRecord record : cancellable.cancellable(records)) {
if (isVisible(record)) {
try {
renderer.renderRecord(viewport, visibleArea, layer, record);
} catch (final TopologyException e) {
}
}
}
}
}
Aggregations