@Override protected void setUpInternal(SystemTestData dataDirectory) throws Exception { CoordinateReferenceSystem epsg4326 = CRS.decode(TARGET_CRS_CODE); CoordinateReferenceSystem epsg32615 = CRS.decode("EPSG:32615"); tx = CRS.findMathTransform(epsg32615, epsg4326); WFSInfo wfs = getWFS(); wfs.setFeatureBounding(true); getGeoServer().save(wfs); dataDirectory.addVectorLayer( NULL_GEOMETRIES, Collections.EMPTY_MAP, getClass(), getCatalog()); Map<LayerProperty, Object> extra = new HashMap<LayerProperty, Object>(); extra.put(LayerProperty.PROJECTION_POLICY, ProjectionPolicy.REPROJECT_TO_DECLARED); extra.put(LayerProperty.SRS, 900913); dataDirectory.addVectorLayer(GOOGLE, extra, getClass(), getCatalog()); }
@Override protected void setUpInternal(SystemTestData data) throws Exception { WFSInfo wfs = getWFS(); wfs.setFeatureBounding(true); getGeoServer().save(wfs); }
@Override protected void setUpInternal(SystemTestData data) throws Exception { WFSInfo wfs = getWFS(); wfs.setFeatureBounding(true); getGeoServer().save(wfs); }
@Override protected void setUpInternal(SystemTestData testData) throws Exception { WFSInfo wfs = getWFS(); wfs.setFeatureBounding(true); getGeoServer().save(wfs); }
@Override protected void setUpInternal(SystemTestData data) throws Exception { WFSInfo wfs = getWFS(); wfs.setFeatureBounding(true); getGeoServer().save(wfs); }
@Test public void testGetFeatureReproject11() throws Exception { WFSInfo wfs = getWFS(); wfs.setFeatureBounding(true); getGeoServer().save(wfs); Document doc = getAsDOM( "wfs?request=GetFeature&typename=cite:Geometryless&version=1.1.0&service=wfs&srsName=EPSG:900913"); assertEquals("wfs:FeatureCollection", doc.getDocumentElement().getNodeName()); NodeList featureMembers = doc.getElementsByTagName("gml:featureMembers"); assertFalse(featureMembers.getLength() == 0); NodeList features = doc.getElementsByTagName("cite:Geometryless"); assertEquals(3, features.getLength()); }
@Override protected void setUpInternal(SystemTestData dataDirectory) throws Exception { // temp hack until feature bounding for 3D is fixed. WFSInfo wfs = getWFS(); wfs.setFeatureBounding(false); getGeoServer().save(wfs); // add extra types dataDirectory.addVectorLayer( new QName(SystemTestData.SF_URI, "With3D", SystemTestData.SF_PREFIX), Collections.EMPTY_MAP, getClass(), getCatalog()); }
@Test public void testGetFeatureReproject10() throws Exception { WFSInfo wfs = getWFS(); wfs.setFeatureBounding(true); getGeoServer().save(wfs); Document doc = getAsDOM( "wfs?request=GetFeature&typename=cite:Geometryless&version=1.0.0&service=wfs&srsName=EPSG:900913"); assertEquals("wfs:FeatureCollection", doc.getDocumentElement().getNodeName()); // print(doc); NodeList featureMembers = doc.getElementsByTagName("gml:featureMember"); assertFalse(featureMembers.getLength() == 0); NodeList features = doc.getElementsByTagName("cite:Geometryless"); assertEquals(3, featureMembers.getLength()); }
@Test public void testWfs11() throws Exception { WFSInfo wfs = getWFS(); boolean oldFeatureBounding = wfs.isFeatureBounding(); wfs.setFeatureBounding(true); getGeoServer().save(wfs); try { String q = "wfs?request=getfeature&service=wfs&version=1.1.0" + "&typename=cgf:Points"; Document d = getAsDOM(q); assertEquals("wfs:FeatureCollection", d.getDocumentElement().getNodeName()); NodeList boxes = d.getElementsByTagName("gml:Envelope"); assertFalse(boxes.getLength() == 0); for (int i = 0; i < boxes.getLength(); i++) { Element box = (Element) boxes.item(i); assertEquals("urn:x-ogc:def:crs:EPSG:32615", box.getAttribute("srsName")); } NodeList points = d.getElementsByTagName("gml:Point"); assertFalse(points.getLength() == 0); for (int i = 0; i < points.getLength(); i++) { Element point = (Element) points.item(i); assertEquals("urn:x-ogc:def:crs:EPSG:32615", point.getAttribute("srsName")); } } finally { wfs.setFeatureBounding(oldFeatureBounding); getGeoServer().save(wfs); } }
@Override protected void setUpInternal(SystemTestData dataDirectory) throws Exception { // temp hack until feature bounding for 3D is fixed. WFSInfo wfs = getWFS(); wfs.setFeatureBounding(false); getGeoServer().save(wfs); // add extra types dataDirectory.addVectorLayer( new QName(SystemTestData.SF_URI, "With3D", SystemTestData.SF_PREFIX), Collections.EMPTY_MAP, org.geoserver.wfs.v1_1.BoundingBox3DTest.class, getCatalog()); }
wfs.setFeatureBounding(true); getGeoServer().save(wfs); wfs.setFeatureBounding(oldFeatureBounding); getGeoServer().save(wfs);
@Override protected void setUpInternal(SystemTestData data) throws Exception { WFSInfo wfs = getWFS(); wfs.setFeatureBounding(true); getGeoServer().save(wfs); data.addVectorLayer(NULL_GEOMETRIES, Collections.EMPTY_MAP, getClass(), getCatalog()); data.addVectorLayer(FIFTEEN_DUPLICATE, Collections.EMPTY_MAP, getClass(), getCatalog()); }
wfs.setFeatureBounding(false); getGeoServer().save(wfs); wfs.setFeatureBounding(oldFeatureBounding); getGeoServer().save(wfs);
@Override protected void oneTimeSetUp() throws Exception { super.oneTimeSetUp(); WFSInfo wfs = getGeoServer().getService( WFSInfo.class ); wfs.setFeatureBounding(true); getGeoServer().save(wfs); }
@Override protected void oneTimeSetUp() throws Exception { super.oneTimeSetUp(); WFSInfo wfs = getGeoServer().getService( WFSInfo.class ); wfs.setFeatureBounding(true); getGeoServer().save(wfs); }
wfs.setFeatureBounding(false); try { gs.save(wfs); assertEquals(JSONNull.getInstance(), bbox); } finally { wfs.setFeatureBounding(before); gs.save(wfs);
@Test public void testFeatureBoudingOff() throws Exception { WFSInfo wfs = getWFS(); wfs.setFeatureBounding(false); getGeoServer().save(wfs); Document doc = getAsDOM( "wfs?request=GetFeature&typeName=" + getLayerId(SystemTestData.BUILDINGS) + "&version=1.1.0&service=wfs&propertyName=ADDRESS"); // print(doc); // check it's a feature collection assertXpathEvaluatesTo("1", "count(//wfs:FeatureCollection)", doc); // check the collection does not have bounds assertXpathEvaluatesTo("0", "count(//wfs:FeatureCollection/gml:boundedBy)", doc); } }
@Test public void testFeatureBoudingOn() throws Exception { WFSInfo wfs = getWFS(); wfs.setFeatureBounding(true); getGeoServer().save(wfs); Document doc = getAsDOM( "wfs?request=GetFeature&typeName=" + getLayerId(SystemTestData.BUILDINGS) + "&version=1.0.0&service=wfs&propertyName=ADDRESS"); // print(doc); // check it's a feature collection assertXpathEvaluatesTo("1", "count(//wfs:FeatureCollection)", doc); // check the collection has non null bounds assertXpathEvaluatesTo("1", "count(//wfs:FeatureCollection/gml:boundedBy/gml:Box)", doc); // check that each feature has non null bounds XpathEngine xpath = XMLUnit.newXpathEngine(); assertTrue( xpath.getMatchingNodes("//cite:Buildings/gml:boundedBy/gml:Box", doc).getLength() > 0); }
@Test public void testFeatureBoudingOn() throws Exception { WFSInfo wfs = getWFS(); wfs.setFeatureBounding(true); getGeoServer().save(wfs); Document doc = getAsDOM( "wfs?request=GetFeature&typeName=" + getLayerId(SystemTestData.BUILDINGS) + "&version=1.1.0&service=wfs&propertyName=ADDRESS"); // print(doc); // check it's a feature collection assertXpathEvaluatesTo("1", "count(//wfs:FeatureCollection)", doc); // check the collection has non null bounds assertXpathEvaluatesTo( "1", "count(//wfs:FeatureCollection/gml:boundedBy/gml:Envelope)", doc); // check that each feature has non null bounds XpathEngine xpath = XMLUnit.newXpathEngine(); assertTrue( xpath.getMatchingNodes("//cite:Buildings/gml:boundedBy/gml:Envelope", doc) .getLength() > 0); }
@Test public void testFeatureBoudingOff() throws Exception { WFSInfo wfs = getWFS(); wfs.setFeatureBounding(false); getGeoServer().save(wfs); Document doc = getAsDOM( "wfs?request=GetFeature&typeName=" + getLayerId(SystemTestData.BUILDINGS) + "&version=1.0.0&service=wfs&propertyName=ADDRESS"); // print(doc); // check it's a feature collection assertXpathEvaluatesTo("1", "count(//wfs:FeatureCollection)", doc); // check the collection does not have bounds assertXpathEvaluatesTo("0", "count(//wfs:FeatureCollection/gml:boundedBy/gml:Box)", doc); // check that each feature has non null bounds XpathEngine xpath = XMLUnit.newXpathEngine(); assertEquals( 0, xpath.getMatchingNodes("//cite:Buildings/gml:boundedBy/gml:Box", doc).getLength()); } }