Search in sources :

Example 1 with TextOnCurve

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

the class TextOnCurveConverter method read.

@Override
public Object read(final OsnIterator iterator) {
    final List<Point> points = new ArrayList<>();
    String fieldName = iterator.nextFieldName();
    while (fieldName != null) {
        if (fieldName.equals("characters")) {
            while (iterator.next() != OsnIterator.END_LIST) {
                final String objectName = iterator.nextObjectName();
                final OsnConverter osnConverter = this.converters.getConverter(objectName);
                if (osnConverter == null) {
                    iterator.throwParseError("No Geometry Converter for " + objectName);
                }
                points.add((TextLinePoint) osnConverter.read(iterator));
            }
        }
        fieldName = iterator.nextFieldName();
    }
    final Geometry geometry = new TextOnCurve(this.geometryFactory, points);
    return geometry;
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) ArrayList(java.util.ArrayList) TextOnCurve(com.revolsys.record.io.format.saif.geometry.TextOnCurve) TextLinePoint(com.revolsys.record.io.format.saif.geometry.TextLinePoint) Point(com.revolsys.geometry.model.Point)

Aggregations

Geometry (com.revolsys.geometry.model.Geometry)1 Point (com.revolsys.geometry.model.Point)1 TextLinePoint (com.revolsys.record.io.format.saif.geometry.TextLinePoint)1 TextOnCurve (com.revolsys.record.io.format.saif.geometry.TextOnCurve)1 ArrayList (java.util.ArrayList)1