use of org.geotoolkit.ogc.xml.v110.LiteralType in project geotoolkit by Geomatys.
the class FilterFactoryImpl method lessOrEqual.
@Override
public BinaryComparisonOperator<Object> lessOrEqual(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 PropertyIsLessThanOrEqualToType(lit, propName, null);
}
use of org.geotoolkit.ogc.xml.v110.LiteralType in project geotoolkit by Geomatys.
the class FilterFactoryImpl method disjoint.
@Override
public BinarySpatialOperator<Object> disjoint(final Expression<Object, ?> geometry1, final Expression<Object, ?> geometry2) {
PropertyNameType propertyName = null;
if (geometry1 instanceof PropertyNameType) {
propertyName = (PropertyNameType) geometry1;
} else {
throw new IllegalArgumentException("unexpected type instead of propertyNameType: " + geometry1.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 DisjointType(propertyName, geom);
}
use of org.geotoolkit.ogc.xml.v110.LiteralType in project geotoolkit by Geomatys.
the class FilterFactoryImpl method dwithin.
@Override
public DistanceOperator<Object> dwithin(final Expression geometry1, final Expression geometry2, final double distance, String units) {
String propertyName = "";
// we get the propertyName
if (geometry1 instanceof PropertyNameType) {
propertyName = ((PropertyNameType) geometry1).getXPath();
} else {
throw new IllegalArgumentException("unexpected type instead of propertyNameType: " + geometry1.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);
}
// we formats the units (CQL parser add a white space at the end)
if (units.indexOf(' ') == units.length() - 1) {
units = units.substring(0, units.length() - 1);
}
return new DWithinType(propertyName, (AbstractGeometryType) geom, distance, units);
}
use of org.geotoolkit.ogc.xml.v110.LiteralType in project geotoolkit by Geomatys.
the class FilterFactoryImpl method equal.
@Override
public BinaryComparisonOperator<Object> equal(final Expression<Object, ?> expr1, final Expression<Object, ?> expr2, final boolean matchCase, final MatchAction action) {
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 PropertyIsEqualToType(lit, propName, matchCase);
}
use of org.geotoolkit.ogc.xml.v110.LiteralType in project geotoolkit by Geomatys.
the class FilterFactoryImpl method lessOrEqual.
@Override
public BinaryComparisonOperator<Object> lessOrEqual(final Expression<Object, ?> expr1, final Expression<Object, ?> expr2, final boolean matchCase, final MatchAction action) {
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 PropertyIsLessThanOrEqualToType(lit, propName, matchCase);
}
Aggregations