// what is this good for?
if (type instanceof CompositionType) {
logger.debug("CompositionType");
int valuec = iomObj.getattrvaluecount(attrName);
for (int valuei = 0; valuei < valuec; valuei++) {
IomObject value = iomObj.getattrobj(attrName,
valuei);
if (value != null) {
// do nothing...
}
}
} else if (type instanceof PolylineType) {
IomObject value = iomObj.getattrobj(attrName, 0);
if (value != null) {
featBuilder.set(attrName.toLowerCase(),
Iox2wkt.polyline2jts(value, 0));
} else {
featBuilder.set(attrName.toLowerCase(), null);
}
} else if (type instanceof SurfaceType) {
isSurfaceMain = true;
geomName = attrName.toLowerCase();
} else if (type instanceof AreaType) {
isAreaMain = true;
IomObject value = iomObj.getattrobj(attrName, 0);
try {
Point point = new GeometryFactory()
.createPoint(Iox2jts.coord2JTS(value));
// point.setSRID( Integer.parseInt(this.epsg) );
featBuilder.set(attrName.toLowerCase()
+ "_point", point);
geomName = attrName.toLowerCase();
} catch (Iox2jtsException e) {
e.printStackTrace();
logger.warn(e.getMessage());
}
} else if (type instanceof CoordType) {
IomObject value = iomObj.getattrobj(attrName, 0);
if (value != null) {
if (!value.getobjecttag().equals("COORD")) {
logger.warn("object tag <> COORD");
} else {
try {
Point point = new GeometryFactory()
.createPoint(Iox2jts
.coord2JTS(value));
featBuilder.set(attrName.toLowerCase(),
point);
} catch (Iox2jtsException e) {
e.printStackTrace();
logger.warn(e.getMessage());
}
}
}
} else if (type instanceof NumericType) {
String value = iomObj.getattrvalue(attrName);
if (value != null) {
featBuilder.set(attrName.toLowerCase(),
Double.valueOf(value));
} else {
featBuilder.set(attrName.toLowerCase(), null);
}
} else if (type instanceof EnumerationType) {
String value = iomObj.getattrvalue(attrName);
if (value != null) {
featBuilder.set(attrName.toLowerCase(),
Integer.valueOf(value));
if (true == true) {
featBuilder.set(attrName.toLowerCase()
+ "_txt", enumCodeMapper
.mapItfCode2XtfCode(
(EnumerationType) type,
value));
}
} else {
featBuilder.set(attrName.toLowerCase(), null);
if (true) {
featBuilder.set(attrName.toLowerCase()
+ "_txt", null);
}
}
} else {
String value = iomObj.getattrvalue(attrName);
if (value != null) {
featBuilder.set(attrName.toLowerCase(), value);
} else {
featBuilder.set(attrName.toLowerCase(), null);
}
}
}
if (obj.obj instanceof RoleDef) {
RoleDef role = (RoleDef) obj.obj;
String roleName = role.getName();
IomObject structvalue = iomObj.getattrobj(roleName, 0);
String refoid = "";
if (structvalue != null) {
if (((ItfReader) ioxReader).isRenumberTids()) {
refoid = getTidOrRef(structvalue
.getobjectrefoid());
} else {
refoid = structvalue.getobjectrefoid();
}
}
featBuilder.set(roleName.toLowerCase(),
refoid.toString());
}
}
} else if (tableObj instanceof LocalAttribute) {
LocalAttribute localAttr = (LocalAttribute) tag2class
.get(iomObj.getobjecttag());
Type type = localAttr.getDomainResolvingAliases();
if (type instanceof SurfaceType) {
isSurfaceHelper = true;
geomName = localAttr.getName().toLowerCase();
String fkName = ch.interlis.iom_j.itf.ModelUtilities
.getHelperTableMainTableRef(localAttr);
IomObject structvalue = iomObj.getattrobj(fkName, 0);
String refoid = null;
if (((ItfReader) ioxReader).isRenumberTids()) {
refoid = getTidOrRef(structvalue.getobjectrefoid());
} else {
refoid = structvalue.getobjectrefoid();
}
featBuilder.set("_itf_ref", refoid);
IomObject value = iomObj.getattrobj(
ch.interlis.iom_j.itf.ModelUtilities
.getHelperTableGeomAttrName(localAttr), 0);
if (value != null) {
PrecisionDecimal maxOverlaps = ((SurfaceType) type)
.getMaxOverlap();
if (maxOverlaps == null) {
featBuilder.set(localAttr.getName().toLowerCase(),
Iox2wkt.polyline2jts(value, 0.02));
} else {
// featBuilder.set(localAttr.getName().toLowerCase(),
// Iox2wkt.polyline2jts( value,
// maxOverlaps.doubleValue() ) );
featBuilder.set(localAttr.getName().toLowerCase(),
Iox2wkt.polyline2jts(value, 0.001));
}
}
} else if (type instanceof AreaType) {
isAreaHelper = true;
geomName = localAttr.getName().toLowerCase();
String fkName = ch.interlis.iom_j.itf.ModelUtilities
.getHelperTableMainTableRef(localAttr);
IomObject structvalue = iomObj.getattrobj(fkName, 0);
featBuilder.set("_itf_ref", null);
IomObject value = iomObj.getattrobj(
ch.interlis.iom_j.itf.ModelUtilities
.getHelperTableGeomAttrName(localAttr), 0);
if (value != null) {
PrecisionDecimal maxOverlaps = ((AreaType) type)
.getMaxOverlap();