Search in sources :

Example 6 with TypeConstraint

use of eu.esdihumboldt.hale.common.schema.model.TypeConstraint in project hale by halestudio.

the class LineStringHandler method initConstraints.

/**
 * @see eu.esdihumboldt.hale.io.gml.geometry.FixedConstraintsGeometryHandler#initConstraints()
 */
@Override
protected Collection<? extends TypeConstraint> initConstraints() {
    Collection<TypeConstraint> constraints = new ArrayList<TypeConstraint>(2);
    constraints.add(Binding.get(GeometryProperty.class));
    constraints.add(GeometryType.get(LineString.class));
    constraints.add(new GeometryFactory(this));
    return constraints;
}
Also used : DefaultGeometryProperty(eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty) GeometryProperty(eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty) GeometryFactory(eu.esdihumboldt.hale.io.gml.geometry.constraint.GeometryFactory) LineString(com.vividsolutions.jts.geom.LineString) TypeConstraint(eu.esdihumboldt.hale.common.schema.model.TypeConstraint) ArrayList(java.util.ArrayList)

Example 7 with TypeConstraint

use of eu.esdihumboldt.hale.common.schema.model.TypeConstraint in project hale by halestudio.

the class RingHandler method initConstraints.

@Override
protected Collection<? extends TypeConstraint> initConstraints() {
    Collection<TypeConstraint> constraints = new ArrayList<TypeConstraint>(2);
    constraints.add(Binding.get(GeometryProperty.class));
    constraints.add(GeometryType.get(LinearRing.class));
    constraints.add(new GeometryFactory(this));
    return constraints;
}
Also used : DefaultGeometryProperty(eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty) GeometryProperty(eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty) GeometryFactory(eu.esdihumboldt.hale.io.gml.geometry.constraint.GeometryFactory) TypeConstraint(eu.esdihumboldt.hale.common.schema.model.TypeConstraint) ArrayList(java.util.ArrayList) LinearRing(com.vividsolutions.jts.geom.LinearRing)

Example 8 with TypeConstraint

use of eu.esdihumboldt.hale.common.schema.model.TypeConstraint in project hale by halestudio.

the class DefaultSchemaSpace method toggleMappingRelevant.

/**
 * @see eu.esdihumboldt.hale.common.schema.model.TypeIndex#toggleMappingRelevant(java.util.Collection)
 */
@Override
public void toggleMappingRelevant(Collection<? extends TypeDefinition> types) {
    synchronized (this) {
        for (TypeDefinition type : types) {
            Schema container = null;
            for (Schema schema : schemas) if (schema.getTypes().contains(type)) {
                container = schema;
                break;
            }
            // toggle type in its schema
            if (container != null)
                container.toggleMappingRelevant(Collections.singletonList(type));
            else {
                // shouldn't happen, but to be safe toggle it in this case
                // too
                Definition<TypeConstraint> def = type;
                ((AbstractDefinition<TypeConstraint>) def).setConstraint(MappingRelevantFlag.get(!type.getConstraint(MappingRelevantFlag.class).isEnabled()));
            }
            // was toggled, update own list
            if (mappingRelevantTypes != null)
                if (type.getConstraint(MappingRelevantFlag.class).isEnabled())
                    mappingRelevantTypes.add(type);
                else
                    mappingRelevantTypes.remove(type);
        }
    }
}
Also used : Schema(eu.esdihumboldt.hale.common.schema.model.Schema) TypeConstraint(eu.esdihumboldt.hale.common.schema.model.TypeConstraint) TypeDefinition(eu.esdihumboldt.hale.common.schema.model.TypeDefinition)

Example 9 with TypeConstraint

use of eu.esdihumboldt.hale.common.schema.model.TypeConstraint in project hale by halestudio.

the class ArcHandler method initConstraints.

@Override
protected Collection<? extends TypeConstraint> initConstraints() {
    Collection<TypeConstraint> constraints = new ArrayList<TypeConstraint>(2);
    constraints.add(Binding.get(GeometryProperty.class));
    constraints.add(GeometryType.get(LineString.class));
    constraints.add(new GeometryFactory(this));
    return constraints;
}
Also used : DefaultGeometryProperty(eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty) GeometryProperty(eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty) GeometryFactory(eu.esdihumboldt.hale.io.gml.geometry.constraint.GeometryFactory) LineString(com.vividsolutions.jts.geom.LineString) TypeConstraint(eu.esdihumboldt.hale.common.schema.model.TypeConstraint) ArrayList(java.util.ArrayList)

Example 10 with TypeConstraint

use of eu.esdihumboldt.hale.common.schema.model.TypeConstraint in project hale by halestudio.

the class ArcStringHandler method initConstraints.

/**
 * @see eu.esdihumboldt.hale.io.gml.geometry.FixedConstraintsGeometryHandler#initConstraints()
 */
@Override
protected Collection<? extends TypeConstraint> initConstraints() {
    Collection<TypeConstraint> constraints = new ArrayList<TypeConstraint>(2);
    constraints.add(Binding.get(GeometryProperty.class));
    constraints.add(GeometryType.get(LineString.class));
    constraints.add(new GeometryFactory(this));
    return constraints;
}
Also used : DefaultGeometryProperty(eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty) GeometryProperty(eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty) GeometryFactory(eu.esdihumboldt.hale.io.gml.geometry.constraint.GeometryFactory) LineString(com.vividsolutions.jts.geom.LineString) TypeConstraint(eu.esdihumboldt.hale.common.schema.model.TypeConstraint) ArrayList(java.util.ArrayList)

Aggregations

TypeConstraint (eu.esdihumboldt.hale.common.schema.model.TypeConstraint)16 GeometryProperty (eu.esdihumboldt.hale.common.schema.geometry.GeometryProperty)14 GeometryFactory (eu.esdihumboldt.hale.io.gml.geometry.constraint.GeometryFactory)14 ArrayList (java.util.ArrayList)14 DefaultGeometryProperty (eu.esdihumboldt.hale.common.instance.geometry.DefaultGeometryProperty)12 LineString (com.vividsolutions.jts.geom.LineString)7 Polygon (com.vividsolutions.jts.geom.Polygon)3 LinearRing (com.vividsolutions.jts.geom.LinearRing)2 Geometry (com.vividsolutions.jts.geom.Geometry)1 GeometryCollection (com.vividsolutions.jts.geom.GeometryCollection)1 Point (com.vividsolutions.jts.geom.Point)1 Schema (eu.esdihumboldt.hale.common.schema.model.Schema)1 TypeDefinition (eu.esdihumboldt.hale.common.schema.model.TypeDefinition)1 Geometries (eu.esdihumboldt.hale.io.gml.geometry.Geometries)1 GeometryNotSupportedException (eu.esdihumboldt.hale.io.gml.geometry.GeometryNotSupportedException)1 Collection (java.util.Collection)1