use of com.revolsys.record.io.format.saif.geometry.TextLinePoint in project com.revolsys.open by revolsys.
the class TextLineConverter method read.
@Override
public Object read(final OsnIterator iterator) {
final Map<String, Object> values = new TreeMap<>();
values.put(TYPE, SaifConstants.TEXT_LINE);
TextLinePoint geometry = null;
String fieldName = iterator.nextFieldName();
while (fieldName != null) {
if (fieldName.equals("position")) {
final String objectName = iterator.nextObjectName();
final OsnConverter osnConverter = this.converters.getConverter(objectName);
if (osnConverter == null) {
iterator.throwParseError("No Geometry Converter for " + objectName);
}
geometry = new TextLinePoint((Point) osnConverter.read(iterator));
} else {
readAttribute(iterator, fieldName, values);
}
fieldName = iterator.nextFieldName();
}
Property.set(geometry, values);
return geometry;
}
use of com.revolsys.record.io.format.saif.geometry.TextLinePoint 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;
}
Aggregations