use of com.revolsys.geometry.model.Polygonal in project com.revolsys.open by revolsys.
the class EWktWriter method write.
private static void write(final Writer out, final Geometry geometry, final int axisCount) throws IOException {
if (geometry != null) {
if (geometry instanceof Point) {
final Point point = (Point) geometry;
write(out, point, axisCount);
} else if (geometry instanceof Punctual) {
final Punctual punctual = (Punctual) geometry;
write(out, punctual, axisCount);
} else if (geometry instanceof LinearRing) {
final LinearRing line = (LinearRing) geometry;
write(out, line, axisCount);
} else if (geometry instanceof LineString) {
final LineString line = (LineString) geometry;
write(out, line, axisCount);
} else if (geometry instanceof Lineal) {
final Lineal lineal = (Lineal) geometry;
write(out, lineal, axisCount);
} else if (geometry instanceof Polygon) {
final Polygon polygon = (Polygon) geometry;
write(out, polygon, axisCount);
} else if (geometry instanceof Polygonal) {
final Polygonal polygonal = (Polygonal) geometry;
write(out, polygonal, axisCount);
} else if (geometry.isGeometryCollection()) {
writeGeometryCollection(out, geometry, axisCount);
} else {
throw new IllegalArgumentException("Unknown geometry type" + geometry.getClass());
}
}
}
use of com.revolsys.geometry.model.Polygonal in project com.revolsys.open by revolsys.
the class WktWriter method write.
public static void write(final Writer out, final Geometry geometry) {
if (geometry != null) {
if (geometry instanceof Point) {
final Point point = (Point) geometry;
write(out, point);
} else if (geometry instanceof Punctual) {
final Punctual punctual = (Punctual) geometry;
write(out, punctual);
} else if (geometry instanceof LinearRing) {
final LinearRing line = (LinearRing) geometry;
write(out, line);
} else if (geometry instanceof LineString) {
final LineString line = (LineString) geometry;
write(out, line);
} else if (geometry instanceof Lineal) {
final Lineal lineal = (Lineal) geometry;
write(out, lineal);
} else if (geometry instanceof Polygon) {
final Polygon polygon = (Polygon) geometry;
write(out, polygon);
} else if (geometry instanceof Polygonal) {
final Polygonal polygonal = (Polygonal) geometry;
write(out, polygonal);
} else if (geometry.isGeometryCollection()) {
writeGeometryCollection(out, geometry);
} else {
throw new IllegalArgumentException("Unknown geometry type" + geometry.getClass());
}
}
}
use of com.revolsys.geometry.model.Polygonal in project com.revolsys.open by revolsys.
the class WktWriter method write.
public static void write(final Writer out, final Geometry geometry, final int axisCount) {
try {
if (geometry != null) {
if (geometry instanceof Point) {
final Point point = (Point) geometry;
write(out, point, axisCount);
} else if (geometry instanceof Punctual) {
final Punctual punctual = (Punctual) geometry;
write(out, punctual, axisCount);
} else if (geometry instanceof LinearRing) {
final LinearRing line = (LinearRing) geometry;
write(out, line, axisCount);
} else if (geometry instanceof LineString) {
final LineString line = (LineString) geometry;
write(out, line, axisCount);
} else if (geometry instanceof Lineal) {
final Lineal lineal = (Lineal) geometry;
write(out, lineal, axisCount);
} else if (geometry instanceof Polygon) {
final Polygon polygon = (Polygon) geometry;
write(out, polygon, axisCount);
} else if (geometry instanceof Polygonal) {
final Polygonal polygonal = (Polygonal) geometry;
write(out, polygonal, axisCount);
} else if (geometry.isGeometryCollection()) {
writeGeometryCollection(out, geometry, axisCount);
} else {
throw new IllegalArgumentException("Unknown geometry type" + geometry.getClass());
}
}
} catch (final IOException e) {
throw Exceptions.wrap(e);
}
}
use of com.revolsys.geometry.model.Polygonal in project com.revolsys.open by revolsys.
the class RandomPointsBuilder method setExtent.
/**
* Sets a polygonal mask.
*
* @param mask
* @throws IllegalArgumentException if the mask is not polygonal
*/
public void setExtent(final Geometry mask) {
if (!(mask instanceof Polygonal)) {
throw new IllegalArgumentException("Only polygonal extents are supported");
}
this.maskPoly = mask;
setExtent(mask.getBoundingBox());
this.extentLocator = new IndexedPointInAreaLocator(mask);
}
use of com.revolsys.geometry.model.Polygonal in project com.revolsys.open by revolsys.
the class PostgreSQLGeometryWrapper method writeGeometry.
private static void writeGeometry(final PrintWriter out, final Geometry geometry, final int axisCount) {
if (geometry != null) {
if (geometry instanceof Point) {
final Point point = (Point) geometry;
writePoint(out, point, axisCount);
} else if (geometry instanceof Punctual) {
final Punctual punctual = (Punctual) geometry;
writeMultiPoint(out, punctual, axisCount);
} else if (geometry instanceof LinearRing) {
final LinearRing line = (LinearRing) geometry;
writeLinearRing(out, line, axisCount);
} else if (geometry instanceof LineString) {
final LineString line = (LineString) geometry;
writeLineString(out, line, axisCount);
} else if (geometry instanceof Lineal) {
final Lineal lineal = (Lineal) geometry;
writeMultiLineString(out, lineal, axisCount);
} else if (geometry instanceof Polygon) {
final Polygon polygon = (Polygon) geometry;
writePolygon(out, polygon, axisCount);
} else if (geometry instanceof Polygonal) {
final Polygonal polygonal = (Polygonal) geometry;
writeMultiPolygon(out, polygonal, axisCount);
} else if (geometry.isGeometryCollection()) {
writeGeometryCollection(out, geometry, axisCount);
} else {
throw new IllegalArgumentException("Unknown geometry type" + geometry.getClass());
}
}
}
Aggregations