use of com.revolsys.geometry.model.Punctual 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.Punctual 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.Punctual 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.Punctual in project com.revolsys.open by revolsys.
the class TextOnCurveConverter method write.
@Override
public void write(final OsnSerializer serializer, final Object object) throws IOException {
if (object instanceof Punctual) {
final Punctual punctual = (Punctual) object;
serializer.startObject(SaifConstants.TEXT_ON_CURVE);
serializer.fieldName("characters");
serializer.startCollection("List");
final OsnConverter osnConverter = this.converters.getConverter(SaifConstants.TEXT_LINE);
for (final Point point : punctual.points()) {
osnConverter.write(serializer, point);
}
serializer.endCollection();
serializer.endAttribute();
serializer.endObject();
}
}
use of com.revolsys.geometry.model.Punctual 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