public static Element propertyIsLessThanOrEqualTo(Document document, Node parent) { return binaryComparisonOp(document, parent, OGC.PropertyIsLessThanOrEqualTo); }
public static Element div(Document document, Node parent) { return binaryExpression(document, parent, OGC.Div); }
public static Element touches(Document document, Node parent) { return binarySpatialOperator(document, parent, OGC.Touches); }
public 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; }
public void testEncodeLogical() throws Exception { Document doc = encode(FilterMockData.and(), OGC.Filter); assertEquals("ogc:Filter", doc.getDocumentElement().getNodeName()); assertEquals(1, doc.getElementsByTagNameNS(OGC.NAMESPACE, "And").getLength()); doc = encode(FilterMockData.not(), OGC.Filter); assertEquals("ogc:Filter", doc.getDocumentElement().getNodeName()); assertEquals(1, doc.getElementsByTagNameNS(OGC.NAMESPACE, "Not").getLength()); }
public void testDWithinEncode() throws Exception { Document dom = encode(FilterMockData.beyond(), OGC.DWithin); assertEquals( 1, dom.getElementsByTagNameNS(OGC.NAMESPACE, OGC.PropertyName.getLocalPart()) .getLength()); assertEquals( 1, dom.getElementsByTagNameNS(GML.NAMESPACE, GML.Point.getLocalPart()).getLength()); assertEquals(1, dom.getElementsByTagNameNS(OGC.NAMESPACE, "Distance").getLength()); assertEquals( "1.0", dom.getElementsByTagNameNS(OGC.NAMESPACE, "Distance") .item(0) .getFirstChild() .getNodeValue()); }
public void testContainsEncode() throws Exception { Document dom = encode(FilterMockData.contains(), OGC.Contains); assertEquals( 1, dom.getElementsByTagNameNS(OGC.NAMESPACE, OGC.PropertyName.getLocalPart()) .getLength()); assertEquals( 1, dom.getElementsByTagNameNS(GML.NAMESPACE, GML.Point.getLocalPart()).getLength()); }
public void testAndEncode() throws Exception { Document dom = encode(FilterMockData.and(), OGC.And); assertEquals( 1, dom.getElementsByTagNameNS(OGC.NAMESPACE, OGC.PropertyIsEqualTo.getLocalPart()) .getLength()); assertEquals( 1, dom.getElementsByTagNameNS(OGC.NAMESPACE, OGC.PropertyIsNotEqualTo.getLocalPart()) .getLength()); }
public void testCrossesEncode() throws Exception { Document dom = encode(FilterMockData.crosses(), OGC.Crosses); assertEquals( 1, dom.getElementsByTagNameNS(OGC.NAMESPACE, OGC.PropertyName.getLocalPart()) .getLength()); assertEquals( 1, dom.getElementsByTagNameNS(GML.NAMESPACE, GML.Point.getLocalPart()).getLength()); }
public void testAddEncode() throws Exception { Document dom = encode(FilterMockData.add(), OGC.Add); assertEquals( 2, dom.getElementsByTagNameNS(OGC.NAMESPACE, OGC.Literal.getLocalPart()).getLength()); }
public void testDisjointEncode() throws Exception { Document dom = encode(FilterMockData.disjoint(), OGC.Disjoint); assertEquals( 1, dom.getElementsByTagNameNS(OGC.NAMESPACE, OGC.PropertyName.getLocalPart()) .getLength()); assertEquals( 1, dom.getElementsByTagNameNS(GML.NAMESPACE, GML.Point.getLocalPart()).getLength()); }
public static Element beyond(Document document, Node parent) { return distanceBufferOperator(document, parent, OGC.Beyond); }
public void testBeyondEncode() throws Exception { Document dom = encode(FilterMockData.beyond(), OGC.Beyond); assertEquals( 1, dom.getElementsByTagNameNS(OGC.NAMESPACE, OGC.PropertyName.getLocalPart()) .getLength()); assertEquals( 1, dom.getElementsByTagNameNS(GML.NAMESPACE, GML.Point.getLocalPart()).getLength()); assertEquals(1, dom.getElementsByTagNameNS(OGC.NAMESPACE, "Distance").getLength()); assertEquals( "1.0", dom.getElementsByTagNameNS(OGC.NAMESPACE, "Distance") .item(0) .getFirstChild() .getNodeValue()); }
public void testContainsParse() throws Exception { FilterMockData.contains(document, document); Contains contains = (Contains) parse(); assertNotNull(contains.getExpression1()); assertNotNull(contains.getExpression2()); }
public void testAndParse() throws Exception { FilterMockData.and(document, document); And and = (And) parse(); assertEquals(2, and.getChildren().size()); }
public void testCrossesParse() throws Exception { FilterMockData.crosses(document, document); Crosses crosses = (Crosses) parse(); assertNotNull(crosses.getExpression1()); assertNotNull(crosses.getExpression2()); }
public void testAddParse() throws Exception { FilterMockData.add(document, document); Add add = (Add) parse(); assertNotNull(add.getExpression1()); assertNotNull(add.getExpression2()); }
public void testDisjointParse() throws Exception { FilterMockData.disjoint(document, document); Disjoint disjoint = (Disjoint) parse(); assertNotNull(disjoint.getExpression1()); assertNotNull(disjoint.getExpression2()); }
public static Element dwithin(Document document, Node parent) { return distanceBufferOperator(document, parent, OGC.DWithin); }