use of org.geotoolkit.ogc.xml.v100.PropertyNameType in project geotoolkit by Geomatys.
the class FilterFactoryImpl method greaterOrEqual.
@Override
public BinaryComparisonOperator<Object> greaterOrEqual(final Expression<Object, ?> expr1, final Expression<Object, ?> expr2) {
LiteralType lit = null;
PropertyNameType propName = null;
if (expr1 instanceof PropertyNameType) {
propName = (PropertyNameType) expr1;
} else if (expr2 instanceof PropertyNameType) {
propName = (PropertyNameType) expr2;
}
if (expr1 instanceof LiteralType) {
lit = (LiteralType) expr1;
} else if (expr2 instanceof LiteralType) {
lit = (LiteralType) expr2;
}
return new PropertyIsGreaterThanOrEqualToType(lit, propName, null);
}
use of org.geotoolkit.ogc.xml.v100.PropertyNameType in project geotoolkit by Geomatys.
the class FilterFactoryImpl method touches.
@Override
public BinarySpatialOperator<Object> touches(final Expression<Object, ?> propertyName1, final Expression<Object, ?> geometry2) {
PropertyNameType propertyName = null;
if (propertyName1 instanceof PropertyNameType) {
propertyName = (PropertyNameType) propertyName1;
} else {
throw new IllegalArgumentException("unexpected type instead of propertyNameType: " + propertyName1.getClass().getSimpleName());
}
// we transform the JTS geometry into a GML geometry
Object geom = null;
if (geometry2 instanceof LiteralType) {
geom = ((LiteralType) geometry2).getValue();
geom = GeometryToGML(geom);
}
return new TouchesType(propertyName, geom);
}
use of org.geotoolkit.ogc.xml.v100.PropertyNameType in project geotoolkit by Geomatys.
the class FilterFactoryImpl method toverlaps.
@Override
public TemporalOperator<Object> toverlaps(final Expression<Object, ?> expr1, final Expression<Object, ?> expr2) {
Object temporal = null;
PropertyNameType propName = null;
if (expr1 instanceof PropertyNameType) {
propName = (PropertyNameType) expr1;
temporal = expr2;
} else if (expr2 instanceof PropertyNameType) {
propName = (PropertyNameType) expr2;
temporal = expr1;
}
return new TimeOverlapsType(propName.getXPath(), temporal);
}
use of org.geotoolkit.ogc.xml.v100.PropertyNameType in project geotoolkit by Geomatys.
the class FilterFactoryImpl method bbox.
@Override
public BinarySpatialOperator<Object> bbox(final Expression geometry, final Envelope bounds) {
String propertyName = "";
final String CRSName;
if (geometry instanceof PropertyNameType) {
propertyName = ((PropertyNameType) geometry).getXPath();
}
if (bounds.getCoordinateReferenceSystem() != null) {
CRSName = IdentifiedObjects.getIdentifierOrName(bounds.getCoordinateReferenceSystem());
} else {
CRSName = "CRS:84";
}
return new BBOXType(propertyName, bounds.getMinimum(0), bounds.getMinimum(1), bounds.getMaximum(0), bounds.getMaximum(1), CRSName);
}
use of org.geotoolkit.ogc.xml.v100.PropertyNameType in project geotoolkit by Geomatys.
the class FilterFactoryImpl method metBy.
@Override
public TemporalOperator<Object> metBy(final Expression<Object, ?> expr1, final Expression<Object, ?> expr2) {
Object temporal = null;
PropertyNameType propName = null;
if (expr1 instanceof PropertyNameType) {
propName = (PropertyNameType) expr1;
temporal = expr2;
} else if (expr2 instanceof PropertyNameType) {
propName = (PropertyNameType) expr2;
temporal = expr1;
}
return new TimeMetByType(propName.getXPath(), temporal);
}
Aggregations