public static Element feature(Document document, Node parent) { Element feature = element(TEST.TestFeature, document, parent); Element geom = element(new QName(TEST.NAMESPACE, "geom"), document, feature); point(document, geom); Element count = GML3MockData.element(new QName(TEST.NAMESPACE, "count"), document, feature); count.appendChild(document.createTextNode("1")); return feature; }
public static Element point3D(Document document, Node parent, boolean addDimension) { Element point = element(GML.Point, document, parent); point.setAttribute("srsName", "urn:x-ogc:def:crs:EPSG:6.11.2:4326"); if (addDimension) { point.setAttribute("srsDimension", "3"); } Element pos = element(qName("pos"), document, point); pos.appendChild(document.createTextNode("1.0 2.0 10.0")); return point; }
public static Element linearRingWithPos(Document document, Node parent) { Element linearRing = element(qName("LinearRing"), document, parent); Element pos = element(qName("pos"), document, linearRing); pos.appendChild(document.createTextNode("1.0 2.0")); pos = element(qName("pos"), document, linearRing); pos.appendChild(document.createTextNode("3.0 4.0")); pos = element(qName("pos"), document, linearRing); pos.appendChild(document.createTextNode("5.0 6.0")); pos = element(qName("pos"), document, linearRing); pos.appendChild(document.createTextNode("1.0 2.0")); return linearRing; }
public static Element lineStringWithPos(Document document, Node parent) { Element lineString = element(qName("LineString"), document, parent); Element pos = element(qName("pos"), document, lineString); pos.appendChild(document.createTextNode("1.0 2.0")); pos = element(qName("pos"), document, lineString); pos.appendChild(document.createTextNode("3.0 4.0")); return lineString; }
public static Element lineStringWithPosList3D( Document document, Node parent, boolean addSrsDimension) { Element lineString = element(qName("LineString"), document, parent); if (addSrsDimension) { lineString.setAttribute("srsDimension", "3"); } Element posList = element(qName("posList"), document, lineString); posList.appendChild(document.createTextNode("1.0 2.0 10.0 3.0 4.0 20.0")); return lineString; }
public static Element polygonWithPosList( Document document, Node parent, QName name, boolean withInterior) { Element polygon = element(name, document, parent); Element exterior = element(qName("exterior"), document, polygon); linearRingWithPosList(document, exterior); if (withInterior) { Element interior = element(qName("interior"), document, polygon); linearRingWithPosList(document, interior); } return polygon; }
public static Element polygonWithPos3D( Document document, Node parent, QName name, boolean addSrsDimension) { Element polygon = element(name, document, parent); if (addSrsDimension) { polygon.setAttribute("srsDimension", "3"); } Element exterior = element(qName("exterior"), document, polygon); linearRingWithPos3D(document, exterior, false); Element interior = element(qName("interior"), document, polygon); linearRingWithPos3D(document, interior, false); return polygon; }
public static Element polygonWithPosList3D( Document document, Node parent, QName name, boolean addSrsDimension) { Element polygon = element(name, document, parent); if (addSrsDimension) { polygon.setAttribute("srsDimension", "3"); } Element exterior = element(qName("exterior"), document, polygon); linearRingWithPosList3D(document, exterior, false); Element interior = element(qName("interior"), document, polygon); linearRingWithPosList3D(document, interior, false); return polygon; }
public static Element polygon( Document document, Node parent, QName name, boolean withInterior) { Element polygon = element(name, document, parent); Element exterior = element(qName("exterior"), document, polygon); linearRing(document, exterior); if (withInterior) { Element interior = element(qName("interior"), document, polygon); linearRing(document, interior); } return polygon; }
public static Element multiLineString3D(Document document, Node parent) { Element multiLineString = element(qName("MultiLineString"), document, parent); multiLineString.setAttribute("srsDimension", "3"); Element lineStringMember = element(qName("lineStringMember"), document, multiLineString); lineStringWithPosList3D(document, lineStringMember, false); lineStringMember = element(qName("lineStringMember"), document, multiLineString); lineStringWithPosList3D(document, lineStringMember, false); return multiLineString; }
public static Element multiPolygon(Document document, Node parent) { Element multiPolygon = element(qName("MultiPolygon"), document, parent); Element polygonMember = element(qName("polygonMember"), document, multiPolygon); polygon(document, polygonMember); polygonMember = element(qName("polygonMember"), document, multiPolygon); polygon(document, polygonMember); return multiPolygon; }
public static Element multiGeometry(Document document, Node parent) { Element multiGeometry = element(qName("MultiGeometry"), document, parent); Element geometryMember = element(qName("geometryMember"), document, multiGeometry); point(document, geometryMember); geometryMember = element(qName("geometryMember"), document, multiGeometry); lineString(document, geometryMember); geometryMember = element(qName("geometryMember"), document, multiGeometry); polygon(document, geometryMember); return multiGeometry; }
public static Element featureMember(Document document, Node parent) { Element featureMember = element(qName("featureMember"), document, parent); feature(document, featureMember); return featureMember; }
public void test1D() throws Exception { GML3MockData.element(GML.pos, document, document); document.getDocumentElement().appendChild(document.createTextNode("1.0")); DirectPosition pos = (DirectPosition) parse(); assertNotNull(pos); assertTrue(pos instanceof DirectPosition1D); assertEquals(pos.getOrdinate(0), 1.0, 0); }
public void test2D() throws Exception { GML3MockData.element(GML.posList, document, document); document.getDocumentElement().setAttribute("srsDimension", "2"); document.getDocumentElement().setAttribute("count", "1"); document.getDocumentElement().appendChild(document.createTextNode("1.0 2.0 ")); DirectPosition[] dps = (DirectPosition[]) parse(); assertNotNull(dps); assertEquals(1, dps.length); assertTrue(dps[0] instanceof DirectPosition2D); assertEquals(1d, dps[0].getOrdinate(0), 0d); assertEquals(2d, dps[0].getOrdinate(1), 0d); }
public void test2D() throws Exception { GML3MockData.element(GML.pos, document, document); document.getDocumentElement().appendChild(document.createTextNode("1.0 2.0")); DirectPosition pos = (DirectPosition) parse(); assertNotNull(pos); assertTrue(pos instanceof DirectPosition2D); assertEquals(pos.getOrdinate(0), 1.0, 0); assertEquals(pos.getOrdinate(1), 2.0, 0); }