use of ch.interlis.ili2c.metamodel.CoordType in project ili2db by claeis.
the class TransferFromXtf method allReferencesKnownHelper.
private void allReferencesKnownHelper(IomObject iomObj, AttributeDef attr, FixIomObjectExtRefs extref) {
String attrName = attr.getName();
if (attr.isDomainBoolean()) {
} else if (attr.isDomainIli1Date()) {
} else if (attr.isDomainIli2Date()) {
} else if (attr.isDomainIli2Time()) {
} else if (attr.isDomainIli2DateTime()) {
} else {
Type type = attr.getDomainResolvingAliases();
if (type instanceof CompositionType) {
// enqueue struct values
int structc = iomObj.getattrvaluecount(attrName);
for (int structi = 0; structi < structc; structi++) {
IomObject struct = iomObj.getattrobj(attrName, structi);
allReferencesKnownHelper(struct, extref);
}
} else if (type instanceof PolylineType) {
} else if (type instanceof SurfaceOrAreaType) {
} else if (type instanceof CoordType) {
} else if (type instanceof NumericType) {
} else if (type instanceof EnumerationType) {
} else if (type instanceof ReferenceType) {
IomObject structvalue = iomObj.getattrobj(attrName, 0);
String refoid = null;
if (structvalue != null) {
refoid = structvalue.getobjectrefoid();
}
if (refoid != null) {
Viewable targetClass = ((ReferenceType) type).getReferred();
if (!oidPool.containsXtfid(Ili2cUtility.getRootViewable(targetClass).getScopedName(null), refoid)) {
extref.addFix(structvalue, targetClass);
}
}
} else {
}
}
}
use of ch.interlis.ili2c.metamodel.CoordType in project ili2db by claeis.
the class AbstractRecordConverter method generatePolylineType.
public DbColGeometry generatePolylineType(LineType type, String attrName) {
DbColGeometry ret = new DbColGeometry();
boolean compoundCurve = false;
if (!strokeArcs) {
compoundCurve = true;
}
ret.setType(compoundCurve ? DbColGeometry.COMPOUNDCURVE : DbColGeometry.LINESTRING);
Domain coordDomain = type.getControlPointDomain();
if (coordDomain != null) {
CoordType coord = (CoordType) coordDomain.getType();
ret.setDimension(coord.getDimensions().length);
setBB(ret, coord, attrName);
}
return ret;
}
use of ch.interlis.ili2c.metamodel.CoordType in project ili2db by claeis.
the class AbstractRecordConverter method setCrs.
public void setCrs(DbColGeometry ret, AttributeDef attr) {
ch.interlis.ili2c.metamodel.Element attrOrDomainDef = attr;
ch.interlis.ili2c.metamodel.Type attrType = attr.getDomain();
if (attrType instanceof ch.interlis.ili2c.metamodel.TypeAlias) {
attrOrDomainDef = ((ch.interlis.ili2c.metamodel.TypeAlias) attrType).getAliasing();
attrType = ((Domain) attrOrDomainDef).getType();
}
CoordType coord = null;
if (attrType instanceof CoordType) {
coord = (CoordType) attrType;
} else if (attrType instanceof LineType) {
Domain coordDomain = ((LineType) attrType).getControlPointDomain();
if (coordDomain != null) {
attrOrDomainDef = coordDomain;
coord = (CoordType) coordDomain.getType();
}
}
if (coord != null) {
String crs = coord.getCrs(attrOrDomainDef);
if (crs != null) {
String[] crsv = crs.split(":");
ret.setSrsAuth(crsv[0]);
ret.setSrsId(crsv[1]);
return;
}
}
ret.setSrsAuth(defaultCrsAuthority);
ret.setSrsId(defaultCrsCode);
}
Aggregations