use of com.revolsys.geometry.model.Polygon in project com.revolsys.open by revolsys.
the class MultiPolygonVertex method getX.
@Override
public double getX() {
final Polygon polygon = getPolygon();
final LinearRing ring = polygon.getRing(this.ringIndex);
if (ring == null) {
return java.lang.Double.NaN;
} else {
return ring.getX(this.vertexIndex);
}
}
use of com.revolsys.geometry.model.Polygon in project com.revolsys.open by revolsys.
the class PolygonVertex method hasNext.
@Override
public boolean hasNext() {
if (getGeometry().isEmpty()) {
return false;
} else {
final Polygon polygon = getPolygon();
int ringIndex = this.ringIndex;
int vertexIndex = this.vertexIndex;
while (ringIndex < polygon.getRingCount()) {
final LinearRing ring = polygon.getRing(ringIndex);
if (vertexIndex + 1 < ring.getVertexCount()) {
return true;
} else {
ringIndex++;
vertexIndex = 0;
}
}
return false;
}
}
use of com.revolsys.geometry.model.Polygon in project com.revolsys.open by revolsys.
the class PolygonVertex method getY.
@Override
public double getY() {
final Polygon polygon = getPolygon();
final LinearRing ring = polygon.getRing(this.ringIndex);
if (ring == null) {
return java.lang.Double.NaN;
} else {
return ring.getY(this.vertexIndex);
}
}
use of com.revolsys.geometry.model.Polygon in project com.revolsys.open by revolsys.
the class PolygonVertex method getX.
@Override
public double getX() {
final Polygon polygon = getPolygon();
final LinearRing ring = polygon.getRing(this.ringIndex);
if (ring == null) {
return java.lang.Double.NaN;
} else {
return ring.getX(this.vertexIndex);
}
}
use of com.revolsys.geometry.model.Polygon in project com.revolsys.open by revolsys.
the class PolygonVertex method next.
@Override
public Vertex next() {
final Polygon polygon = getPolygon();
this.vertexIndex++;
while (this.ringIndex < polygon.getRingCount()) {
final LinearRing ring = polygon.getRing(this.ringIndex);
if (this.vertexIndex < ring.getVertexCount()) {
return this;
} else {
this.ringIndex++;
this.vertexIndex = 0;
}
}
throw new NoSuchElementException();
}
Aggregations