Search in sources :

Example 11 with CoordType

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 {
        }
    }
}
Also used : PolylineType(ch.interlis.ili2c.metamodel.PolylineType) NumericType(ch.interlis.ili2c.metamodel.NumericType) PolylineType(ch.interlis.ili2c.metamodel.PolylineType) Type(ch.interlis.ili2c.metamodel.Type) ReferenceType(ch.interlis.ili2c.metamodel.ReferenceType) SurfaceOrAreaType(ch.interlis.ili2c.metamodel.SurfaceOrAreaType) SurfaceType(ch.interlis.ili2c.metamodel.SurfaceType) CompositionType(ch.interlis.ili2c.metamodel.CompositionType) EnumerationType(ch.interlis.ili2c.metamodel.EnumerationType) NumericType(ch.interlis.ili2c.metamodel.NumericType) ObjectType(ch.interlis.ili2c.metamodel.ObjectType) CoordType(ch.interlis.ili2c.metamodel.CoordType) IomObject(ch.interlis.iom.IomObject) SurfaceOrAreaType(ch.interlis.ili2c.metamodel.SurfaceOrAreaType) EnumerationType(ch.interlis.ili2c.metamodel.EnumerationType) Viewable(ch.interlis.ili2c.metamodel.Viewable) CompositionType(ch.interlis.ili2c.metamodel.CompositionType) ReferenceType(ch.interlis.ili2c.metamodel.ReferenceType) CoordType(ch.interlis.ili2c.metamodel.CoordType)

Example 12 with CoordType

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;
}
Also used : DbColGeometry(ch.ehi.sqlgen.repository.DbColGeometry) Domain(ch.interlis.ili2c.metamodel.Domain) CoordType(ch.interlis.ili2c.metamodel.CoordType)

Example 13 with CoordType

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);
}
Also used : Domain(ch.interlis.ili2c.metamodel.Domain) LineType(ch.interlis.ili2c.metamodel.LineType) CoordType(ch.interlis.ili2c.metamodel.CoordType)

Aggregations

CoordType (ch.interlis.ili2c.metamodel.CoordType)13 Type (ch.interlis.ili2c.metamodel.Type)9 CompositionType (ch.interlis.ili2c.metamodel.CompositionType)8 SurfaceOrAreaType (ch.interlis.ili2c.metamodel.SurfaceOrAreaType)8 SurfaceType (ch.interlis.ili2c.metamodel.SurfaceType)8 EnumerationType (ch.interlis.ili2c.metamodel.EnumerationType)7 PolylineType (ch.interlis.ili2c.metamodel.PolylineType)7 AttributeDef (ch.interlis.ili2c.metamodel.AttributeDef)6 ObjectType (ch.interlis.ili2c.metamodel.ObjectType)6 ReferenceType (ch.interlis.ili2c.metamodel.ReferenceType)6 AreaType (ch.interlis.ili2c.metamodel.AreaType)5 BlackboxType (ch.interlis.ili2c.metamodel.BlackboxType)5 ViewableWrapper (ch.ehi.ili2db.mapping.ViewableWrapper)4 Domain (ch.interlis.ili2c.metamodel.Domain)4 LineType (ch.interlis.ili2c.metamodel.LineType)4 NumericType (ch.interlis.ili2c.metamodel.NumericType)4 Table (ch.interlis.ili2c.metamodel.Table)4 IomObject (ch.interlis.iom.IomObject)4 ConverterException (ch.ehi.ili2db.converter.ConverterException)3 ArrayMapping (ch.ehi.ili2db.mapping.ArrayMapping)3