use of com.revolsys.geometry.model.LinearRing in project com.revolsys.open by revolsys.
the class RectangleXY method forEachGeometry.
@Override
public void forEachGeometry(final Consumer<Geometry> action) {
final LinearRing ring = getRing(0);
ring.forEachGeometry(action);
}
use of com.revolsys.geometry.model.LinearRing in project com.revolsys.open by revolsys.
the class LinearRingDoubleGf method reverse.
@Override
public LinearRing reverse() {
final int vertexCount = getVertexCount();
final int axisCount = getAxisCount();
final double[] coordinates = new double[vertexCount * axisCount];
for (int vertexIndex = 0; vertexIndex < vertexCount; vertexIndex++) {
for (int axisIndex = 0; axisIndex < axisCount; axisIndex++) {
final int coordinateIndex = (vertexCount - 1 - vertexIndex) * axisCount + axisIndex;
coordinates[coordinateIndex] = getCoordinate(vertexIndex, axisIndex);
}
}
final GeometryFactory geometryFactory = getGeometryFactory();
final LinearRing reverseLine = geometryFactory.linearRing(axisCount, coordinates);
return reverseLine;
}
use of com.revolsys.geometry.model.LinearRing in project com.revolsys.open by revolsys.
the class MultiPolygonSegment method hasNext.
@Override
public boolean hasNext() {
final Polygonal polygonal = this.polygonal;
if (polygonal.isEmpty()) {
return false;
} else {
int partIndex = this.partIndex;
int ringIndex = this.ringIndex;
int segmentIndex = this.segmentIndex + 1;
while (partIndex < polygonal.getGeometryCount()) {
final Polygon polygon = getPolygon();
while (ringIndex < polygon.getRingCount()) {
final LinearRing ring = polygon.getRing(ringIndex);
if (segmentIndex < ring.getSegmentCount()) {
return true;
} else {
ringIndex++;
segmentIndex = 0;
}
}
partIndex++;
ringIndex = 0;
segmentIndex = 0;
}
return false;
}
}
use of com.revolsys.geometry.model.LinearRing in project com.revolsys.open by revolsys.
the class MultiPolygonSegment method next.
@Override
public Segment next() {
this.segmentIndex++;
final Polygonal polygonal = this.polygonal;
final int geometryCount = polygonal.getGeometryCount();
while (this.partIndex < geometryCount) {
final Polygon polygon = getPolygon();
final int ringCount = polygon.getRingCount();
while (this.ringIndex < ringCount) {
final LinearRing ring = polygon.getRing(this.ringIndex);
if (this.segmentIndex < ring.getSegmentCount()) {
return this;
} else {
this.ringIndex++;
this.segmentIndex = 0;
}
}
this.partIndex++;
this.ringIndex = 0;
this.segmentIndex = 0;
}
throw new NoSuchElementException();
}
use of com.revolsys.geometry.model.LinearRing in project com.revolsys.open by revolsys.
the class PolygonSegment method hasNext.
@Override
public boolean hasNext() {
if (getGeometry().isEmpty()) {
return false;
} else {
final Polygon polygon = this.polygon;
int ringIndex = this.ringIndex;
int segmentIndex = this.segmentIndex;
while (ringIndex < polygon.getRingCount()) {
final LinearRing ring = polygon.getRing(ringIndex);
if (segmentIndex + 1 < ring.getSegmentCount()) {
return true;
} else {
ringIndex++;
segmentIndex = 0;
}
}
return false;
}
}
Aggregations