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) {