Package ch.interlis.ili2c.metamodel

Examples of ch.interlis.ili2c.metamodel.AttributeDef


                                while (attri.hasNext()) {
                                    ch.interlis.ili2c.metamodel.ViewableTransferElement attrObj = (ch.interlis.ili2c.metamodel.ViewableTransferElement) attri
                                            .next();
                                    if (attrObj.obj instanceof AttributeDef) {
                                        AttributeDef attrdefObj = (AttributeDef) attrObj.obj;
                                        Type type = attrdefObj
                                                .getDomainResolvingAliases();

                                        if (type instanceof PolylineType) {
                                            typeBuilder.add(attrdefObj
                                                    .getName().toLowerCase(),
                                                    LineString.class);
                                        } else if (type instanceof SurfaceType) {
                                            String name = attrdefObj.getName();

                                            // Neuen SimpleFeatureTypeBuilder
                                            // für
                                            // Surface Helper-Table erstellen:
                                            // - tid
                                            // - foreign key, zB.
                                            // '_itf_ref_XXXXX (eigentlich egal)
                                            // - Key (Name) des Builders ist
                                            // Tabellenname + '_Attributname"
                                            // Dem 'originalen' (Main-Table)
                                            // Builder wird
                                            // eine Polygonklasse hinzugefügt.

                                            SimpleFeatureTypeBuilder typeBuilderRef = new SimpleFeatureTypeBuilder();
                                            typeBuilderRef.setName(className
                                                    + "_ " + name);
                                            // typeBuilderRef.setNamespaceURI(
                                            // "http://www.catais.org" );
                                            typeBuilderRef.setSRS("EPSG:"
                                                    + epsg);

                                            typeBuilderRef.add("tid",
                                                    String.class);
                                            typeBuilderRef.add("_itf_ref",
                                                    String.class);
                                            typeBuilderRef.add(
                                                    name.toLowerCase(),
                                                    LineString.class);

                                            if (true) {
                                                typeBuilderRef.add("gem_bfs",
                                                        Integer.class);
                                                typeBuilderRef.add("los",
                                                        Integer.class);
                                                typeBuilderRef.add(
                                                        "lieferdatum",
                                                        Date.class);
                                            }

                                            SimpleFeatureType featureTypeRef = typeBuilderRef
                                                    .buildFeatureType();
                                            ret.put(className + "_" + name,
                                                    featureTypeRef);

                                            typeBuilder.add(name.toLowerCase(),
                                                    Polygon.class);
                                        } else if (type instanceof AreaType) {
                                            String name = attrdefObj.getName();

                                            // Neuen SimpleFeatureTypeBuilder
                                            // für
                                            // Area Helper-Table erstellen.
                                            // Ähnlich
                                            // wie oben, nur dass im 'original'
                                            // Builder
                                            // zusätzliche eine Point-Geometrie
                                            // hinzugefügt werden muss.

                                            SimpleFeatureTypeBuilder typeBuilderRef = new SimpleFeatureTypeBuilder();
                                            typeBuilderRef.setName(className
                                                    + "_" + name);
                                            // typeBuilderRef.setNamespaceURI(
                                            // "http://www.catais.org" );
                                            typeBuilderRef.setSRS("EPSG:"
                                                    + epsg);

                                            typeBuilderRef.add("tid",
                                                    String.class);
                                            typeBuilderRef.add("_itf_ref",
                                                    String.class);
                                            typeBuilderRef.add(
                                                    name.toLowerCase(),
                                                    LineString.class);

                                            if (false) {
                                                typeBuilderRef.add("gem_bfs",
                                                        Integer.class);
                                                typeBuilderRef.add("los",
                                                        Integer.class);
                                                typeBuilderRef.add(
                                                        "lieferdatum",
                                                        Date.class);
                                            }

                                            SimpleFeatureType featureTypeRef = typeBuilderRef
                                                    .buildFeatureType();
                                            ret.put(className + "_" + name,
                                                    featureTypeRef);

                                            typeBuilder.add(name.toLowerCase()
                                                    + "_point", Point.class);
                                            typeBuilder.add(name.toLowerCase(),
                                                    Polygon.class);

                                        } else if (type instanceof CoordType) {
                                            typeBuilder.add(attrdefObj
                                                    .getName().toLowerCase(),
                                                    Point.class);
                                        } else if (type instanceof NumericType) {
                                            typeBuilder.add(attrdefObj
                                                    .getName().toLowerCase(),
                                                    Double.class);
                                        } else if (type instanceof EnumerationType) {
                                            typeBuilder.add(attrdefObj
                                                    .getName().toLowerCase(),
                                                    Integer.class);
                                            if (true) {
                                                typeBuilder.add(attrdefObj
                                                        .getName()
                                                        .toLowerCase()
                                                        + "_txt", String.class);
                                            }

                                        } else {
                                            typeBuilder.add(attrdefObj
                                                    .getName().toLowerCase(),
                                                    String.class);
                                        }
                                    }
                                    if (attrObj.obj instanceof RoleDef) {
View Full Code Here


                                while (attri.hasNext()) {
                                    ch.interlis.ili2c.metamodel.ViewableTransferElement attrObj = (ch.interlis.ili2c.metamodel.ViewableTransferElement) attri
                                            .next();

                                    if (attrObj.obj instanceof AttributeDef) {
                                        AttributeDef attrdefObj = (AttributeDef) attrObj.obj;
                                        Type type = attrdefObj
                                                .getDomainResolvingAliases();
                                        String attrName = attrdefObj.getName()
                                                .toLowerCase();

                                        if (type instanceof PolylineType
                                                || type instanceof SurfaceType
                                                || type instanceof AreaType
View Full Code Here

                while (attri.hasNext()) {
                    ViewableTransferElement obj = (ViewableTransferElement) attri
                            .next();

                    if (obj.obj instanceof AttributeDef) {
                        AttributeDef attr = (AttributeDef) obj.obj;
                        Type type = attr.getDomainResolvingAliases();
                        String attrName = attr.getName();

                        // what is this good for?
                        if (type instanceof CompositionType) {
                            logger.debug("CompositionType");
                            int valuec = iomObj.getattrvaluecount(attrName);
View Full Code Here

                                while (attri.hasNext()) {
                                    ch.interlis.ili2c.metamodel.ViewableTransferElement attrObj = (ch.interlis.ili2c.metamodel.ViewableTransferElement) attri
                                            .next();

                                    if (attrObj.obj instanceof AttributeDef) {
                                        AttributeDef attrdefObj = (AttributeDef) attrObj.obj;
                                        Type type = attrdefObj
                                                .getDomainResolvingAliases();

                                        String attrName = attrdefObj.getName()
                                                .toLowerCase();

                                        if (type instanceof PolylineType) {
                                            tables.append(" ");
                                            tables.append(attrName + " ");
                                            tables.append("geometry(LINESTRING, "
                                                    + epsg + "),\n");

                                            geomType.add("LINESTRING");
                                            geomName.add(attrName);
                                        } else if (type instanceof SurfaceType) {
                                            tables.append(" ");
                                            tables.append(attrName + " ");
                                            tables.append("geometry(POLYGON, "
                                                    + epsg + "),\n");

                                            geomType.add("POLYGON");
                                            geomName.add(attrName);
                                        } else if (type instanceof AreaType) {
                                            tables.append(" ");
                                            tables.append(attrName + " ");
                                            tables.append("geometry(POLYGON, "
                                                    + epsg + "),\n");

                                            geomType.add("POLYGON");
                                            geomName.add(attrName);
                                        } else if (type instanceof CoordType) {
                                            tables.append(" ");
                                            tables.append(attrName + " ");
                                            tables.append("geometry(POINT, "
                                                    + epsg + "),\n");

                                            geomType.add("POINT");
                                            geomName.add(attrName);
                                        } else if (type instanceof NumericType) {
                                            tables.append(" ");
                                            tables.append(attrName + " ");
                                            tables.append("DOUBLE PRECISION,\n");
                                        } else if (type instanceof EnumerationType) {
                                            tables.append(" ");
                                            tables.append(attrName + " ");
                                            tables.append("INTEGER,\n");

                                            // append also the text
                                            // representation of the enumeration
                                            if (true) {
                                                tables.append(" ");
                                                tables.append(attrName
                                                        + "_txt ");
                                                tables.append("VARCHAR,\n");
                                            }

                                            Type attrType = (Type) attrdefObj
                                                    .getDomain();
                                            if (attrType instanceof EnumerationType) {
                                                EnumerationType enumerationType = (EnumerationType) attrType;
                                                ch.interlis.ili2c.metamodel.Enumeration enumerations = (ch.interlis.ili2c.metamodel.Enumeration) enumerationType
                                                        .getConsolidatedEnumeration();
View Full Code Here

TOP

Related Classes of ch.interlis.ili2c.metamodel.AttributeDef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.