Search in sources :

Example 1 with ContourLineString

use of com.revolsys.record.io.format.saif.geometry.ContourLineString in project com.revolsys.open by revolsys.

the class ContourConverter method write.

@Override
public void write(final OsnSerializer serializer, final Object object) throws IOException {
    if (object instanceof LineString) {
        final LineString line = (LineString) object;
        serializer.startObject(GEOMETRY_CLASS);
        serializer.fieldName("arc");
        super.write(serializer, object);
        serializer.endAttribute();
        if (line instanceof ContourLineString) {
            final ContourLineString contourLine = (ContourLineString) line;
            final String form = contourLine.getForm();
            attributeEnum(serializer, "form", form);
            super.writeAttributes(serializer, (ArcLineString) line);
            final int value = contourLine.getValue();
            attributeEnum(serializer, "form", Integer.toString(value));
        } else if (line instanceof ArcLineString) {
            super.writeAttributes(serializer, (ArcLineString) line);
        }
        serializer.endObject();
    }
}
Also used : ArcLineString(com.revolsys.record.io.format.saif.geometry.ArcLineString) ContourLineString(com.revolsys.record.io.format.saif.geometry.ContourLineString) LineString(com.revolsys.geometry.model.LineString) ArcLineString(com.revolsys.record.io.format.saif.geometry.ArcLineString) ArcLineString(com.revolsys.record.io.format.saif.geometry.ArcLineString) ContourLineString(com.revolsys.record.io.format.saif.geometry.ContourLineString) LineString(com.revolsys.geometry.model.LineString) ContourLineString(com.revolsys.record.io.format.saif.geometry.ContourLineString)

Aggregations

LineString (com.revolsys.geometry.model.LineString)1 ArcLineString (com.revolsys.record.io.format.saif.geometry.ArcLineString)1 ContourLineString (com.revolsys.record.io.format.saif.geometry.ContourLineString)1