static Element featureId(Document document, Node parent) { Element featureId = element(document, parent, OGC.FeatureId); featureId.setAttribute("fid", "foo"); return featureId; }
static Element geometry(Document document, Node parent) { Element geometry = element(document, parent, GML.Point); Element pos = element(document, geometry, GML.coord); Element x = element(document, pos, new QName(GML.NAMESPACE, "X")); x.appendChild(document.createTextNode("1")); Element y = element(document, pos, new QName(GML.NAMESPACE, "Y")); y.appendChild(document.createTextNode("1")); return geometry; }
static Element propertyName(String property, Document document, Node parent) { Element propertyName = element(document, parent, OGC.PropertyName); propertyName.appendChild(document.createTextNode(property)); return propertyName; }
static Element literal(String value, Document document, Node parent) { Element literal = element(document, parent, OGC.Literal); literal.appendChild(document.createTextNode(value)); return literal; }
static Element distanceBufferOperator(Document document, Node parent, QName name) { Element doperator = binarySpatialOperator(document, parent, name); Element distance = element(document, doperator, new QName(OGC.NAMESPACE, "Distance")); distance.appendChild(document.createTextNode("1.0")); distance.setAttribute("units", "m"); return doperator; }
static Element propertyisNull(Document document, Node parent) { Element isNull = element(document, parent, OGC.PropertyIsNull); propertyName(document, isNull); return isNull; }
static Element propertyIsBetween(Document document, Node parent) { Element between = element(document, parent, OGC.PropertyIsBetween); propertyName(document, between); Element lower = element(document, between, new QName(OGC.NAMESPACE, "LowerBoundary")); literal(document, lower); Element upper = element(document, between, new QName(OGC.NAMESPACE, "UpperBoundary")); literal(document, upper); return between; }
static Element not(Document document, Node parent) { Element not = element(document, parent, OGC.Not); propertyIsEqualTo(document, not); return not; }
static Element propertyIsLike(Document document, Node parent) { Element isLike = element(document, parent, OGC.PropertyIsLike); propertyName(document, isLike); literal(document, isLike); isLike.setAttribute("wildCard", "x"); isLike.setAttribute("singleChar", "y"); isLike.setAttribute("escape", "z"); return isLike; }
static Element function(Document document, Node parent) { Element function = element(document, parent, OGC.Function); function.setAttributeNS("", "name", "min"); propertyName(document, function); literal(document, function); return function; }
static Element bbox(Document document, Node parent) { Element bbox = element(document, parent, OGC.BBOX); propertyName(document, bbox); envelope(document, bbox); return bbox; }
static Element binaryComparisonOp(Document document, Node parent, QName name) { Element binaryComparisonOp = element(document, parent, name); propertyName(document, binaryComparisonOp); literal(document, binaryComparisonOp); return binaryComparisonOp; }
static Element binaryExpression(Document document, Node parent, QName name) { Element binaryExpression = element(document, parent, name); literal(document, binaryExpression); literal(document, binaryExpression); return binaryExpression; }
static Element and(Document document, Node parent, boolean empty) { Element and = element(document, parent, OGC.And); if (!empty) { propertyIsEqualTo(document, and); propertyIsNotEqualTo(document, and); } return and; }
static Element or(Document document, Node parent) { Element or = element(document, parent, OGC.Or); propertyIsEqualTo(document, or); propertyIsNotEqualTo(document, or); return or; }
static Element withinWithFunction(Document document, Node parent) { Element within = element(document, parent, OGC.Within); propertyName(document, within); function(document, within); return within; }
static Element binarySpatialOperator(Document document, Node parent, QName name) { Element spatial = element(document, parent, name); propertyName(document, spatial); geometry(document, spatial); return spatial; }
public void testParseComparison() throws Exception { Element filterElement = FilterMockData.element(document, document, OGC.Filter); FilterMockData.propertyIsEqualTo(document, filterElement); Filter filter = (Filter) parse(); assertTrue(filter instanceof PropertyIsEqualTo); }
public void testParseSpatial() throws Exception { Element filterElement = FilterMockData.element(document, document, OGC.Filter); FilterMockData.intersects(document, filterElement); Filter filter = (Filter) parse(); assertTrue(filter instanceof Intersects); }
public void testParseLogical() throws Exception { Element filterElement = FilterMockData.element(document, document, OGC.Filter); FilterMockData.and(document, filterElement); Filter filter = (Filter) parse(); assertTrue(filter instanceof And); }