use of com.revolsys.geometry.model.LineString in project com.revolsys.open by revolsys.
the class LineStringLessThanDistanceFilter method getFilter.
public static Predicate<Record> getFilter(final Record object, final double maxDistance) {
final LineString line = object.getGeometry();
final LineStringLessThanDistanceFilter lineFilter = new LineStringLessThanDistanceFilter(line, maxDistance);
return new RecordGeometryFilter<>(lineFilter);
}
use of com.revolsys.geometry.model.LineString in project com.revolsys.open by revolsys.
the class PreparedMultiLineString method prepareLineStrings.
private static LineString[] prepareLineStrings(final MultiLineString multiLineString) {
final LineString[] polygons = new LineString[multiLineString.getLineStringCount()];
for (int i = 0; i < polygons.length; i++) {
final LineString polygon = multiLineString.getLineString(i);
polygons[i] = polygon.prepare();
}
return polygons;
}
use of com.revolsys.geometry.model.LineString in project com.revolsys.open by revolsys.
the class MultiLineStringSegment method next.
@Override
public Segment next() {
final Lineal lineal = this.lineal;
this.segmentIndex++;
while (this.partIndex < lineal.getGeometryCount()) {
final LineString part = getPart();
if (this.segmentIndex < part.getSegmentCount()) {
return this;
} else {
this.partIndex++;
this.segmentIndex = 0;
}
}
throw new NoSuchElementException();
}
use of com.revolsys.geometry.model.LineString in project com.revolsys.open by revolsys.
the class MultiLineStringSegment method hasNext.
@Override
public boolean hasNext() {
if (getGeometry().isEmpty()) {
return false;
} else {
final Lineal line = this.lineal;
int partIndex = this.partIndex;
int segmentIndex = this.segmentIndex + 1;
final int geometryCount = line.getGeometryCount();
while (partIndex < geometryCount) {
final LineString part = line.getGeometry(partIndex);
final int segmentCount = part.getSegmentCount();
if (segmentIndex < segmentCount) {
return true;
} else {
partIndex++;
segmentIndex = 0;
}
}
return false;
}
}
use of com.revolsys.geometry.model.LineString in project com.revolsys.open by revolsys.
the class LineStringVertex method getLineNext.
@Override
public Vertex getLineNext() {
final int newVertexIndex = this.vertexIndex + 1;
final LineString lineString = getLineString();
final int vertexCount = lineString.getVertexCount();
if (newVertexIndex < vertexCount) {
return new LineStringVertex(lineString, newVertexIndex);
} else {
return null;
}
}
Aggregations