use of com.revolsys.geometry.model.LineString in project com.revolsys.open by revolsys.
the class MultiLineStringVertex method getLineCoordinateRelative.
@Override
public double getLineCoordinateRelative(final int vertexOffset, final int axisIndex) {
if (isEmpty()) {
return java.lang.Double.NaN;
} else {
final int vertexIndex = getVertexIndex();
final LineString line = getLineString();
return line.getCoordinate(vertexIndex + vertexOffset, axisIndex);
}
}
use of com.revolsys.geometry.model.LineString in project com.revolsys.open by revolsys.
the class MultiLineStringVertex method hasNext.
@Override
public boolean hasNext() {
if (getGeometry().isEmpty()) {
return false;
} else {
final Lineal lineal = getLineal();
int partIndex = this.partIndex;
int vertexIndex = this.vertexIndex + 1;
while (partIndex < lineal.getGeometryCount()) {
final LineString lineString = lineal.getLineString(partIndex);
if (vertexIndex < lineString.getVertexCount()) {
return true;
} else {
partIndex++;
vertexIndex = 0;
}
}
return false;
}
}
use of com.revolsys.geometry.model.LineString in project com.revolsys.open by revolsys.
the class PolygonVertex method getLineNext.
@Override
public Vertex getLineNext() {
final LineString ring = getRing();
if (ring != null) {
int newVertexIndex = this.vertexIndex + 1;
final int vertexCount = ring.getVertexCount();
if (newVertexIndex == vertexCount - 1) {
newVertexIndex = 1;
} else if (newVertexIndex < vertexCount - 1) {
return new PolygonVertex(getPolygon(), this.ringIndex, newVertexIndex);
}
}
return null;
}
use of com.revolsys.geometry.model.LineString in project com.revolsys.open by revolsys.
the class GeometryTransformer method transformMultiLineString.
protected Lineal transformMultiLineString(final Lineal lineal) {
boolean updated = false;
final List<LineString> newLines = new ArrayList<>();
for (final LineString line : lineal.lineStrings()) {
final LineString newLine = transformLineString(line);
if (newLine == null || newLine.isEmpty()) {
updated = true;
} else {
newLines.add(newLine);
if (newLine != line) {
updated = true;
}
}
}
if (updated) {
return lineal;
} else {
return this.factory.lineal(newLines);
}
}
use of com.revolsys.geometry.model.LineString in project com.revolsys.open by revolsys.
the class PlanarPolygon3D method locate.
private Location locate(final Point pt, final LineString ring) {
final LineString seq = ring;
final LineString seqProj = project(seq, this.facingPlane);
final Point ptProj = project(pt, this.facingPlane);
return RayCrossingCounter.locatePointInRing(ptProj, seqProj);
}
Aggregations