/** * Is WFS configured to return feature and collection bounds? * * @return */ protected boolean isFeatureBounding() { WFSInfo wfs = getInfo(); return wfs.isFeatureBounding(); }
@Override protected void wrapInternal(Map properties, SimpleHash model, WFSInfo wfsInfo) { WorkspaceInfo workspaceInfo = wfsInfo.getWorkspace(); properties.put("workspaceName", workspaceInfo != null ? workspaceInfo.getName() : "NO_WORKSPACE"); properties.put("enabled", wfsInfo.isEnabled() ? "true" : "false"); properties.put("name", wfsInfo.getName()); properties.put("title", wfsInfo.getTitle()); properties.put("maintainer", wfsInfo.getMaintainer()); properties.put("abstract", wfsInfo.getAbstract()); properties.put("accessConstraints", wfsInfo.getAccessConstraints()); properties.put("fees", wfsInfo.getFees()); properties.put("versions", wfsInfo.getVersions()); properties.put("keywords", wfsInfo.getKeywords()); properties.put("metadataLink", wfsInfo.getMetadataLink()); properties.put("citeCompliant", wfsInfo.isCiteCompliant() ? "true" : "false"); properties.put("onlineResource", wfsInfo.getOnlineResource()); properties.put("schemaBaseURL", wfsInfo.getSchemaBaseURL()); properties.put("verbose", wfsInfo.isVerbose() ? "true" : "false"); properties.put("maxFeatures", String.valueOf(wfsInfo.getMaxFeatures())); properties.put("isFeatureBounding", wfsInfo.isFeatureBounding() ? "true" : "false"); properties.put("serviceLevel", wfsInfo.getServiceLevel()); properties.put("isCanonicalSchemaLocation", wfsInfo.isCanonicalSchemaLocation() ? "true" : "false"); properties.put("encodeFeatureMember", wfsInfo.isEncodeFeatureMember() ? "true" : "false"); } });
@Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (!(obj instanceof WFSInfo)) return false; final WFSInfo other = (WFSInfo) obj; if (gml == null) { if (other.getGML() != null) return false; } else if (!gml.equals(other.getGML())) return false; if (maxFeatures != other.getMaxFeatures()) return false; if (featureBounding != other.isFeatureBounding()) return false; if (canonicalSchemaLocation != other.isCanonicalSchemaLocation()) return false; if (serviceLevel == null) { if (other.getServiceLevel() != null) return false; } else if (!serviceLevel.equals(other.getServiceLevel())) return false; if (encodeFeatureMember != other.isEncodeFeatureMember()) return false; if (hitsIgnoreMaxFeatures != other.isHitsIgnoreMaxFeatures()) return false; if (srs == null) { if (other.getSRS() != null) return false; } else if (!srs.equals(other.getSRS())) return false; return true; } }
@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); } }
@Test public void testGetFeatureWithAutoBoxGet() throws Exception { WFSInfo wfs = getWFS(); boolean oldFeatureBounding = wfs.isFeatureBounding(); wfs.setFeatureBounding(true); getGeoServer().save(wfs);
boolean oldFeatureBounding = wfs.isFeatureBounding(); wfs.setFeatureBounding(true); getGeoServer().save(wfs);
@Test public void testGetFeatureWithProjectedBoxGet() throws Exception { WFSInfo wfs = getWFS(); boolean oldFeatureBounding = wfs.isFeatureBounding(); wfs.setFeatureBounding(true); getGeoServer().save(wfs);
if (wfs.isFeatureBounding()) { configuration.getProperties().remove(GMLConfiguration.NO_FEATURE_BOUNDS); } else {
boolean oldFeatureBounding = wfs.isFeatureBounding(); wfs.setFeatureBounding(true); getGeoServer().save(wfs);
@Test public void testGetFeatureWithProjectedBoxPost() throws Exception { WFSInfo wfs = getWFS(); boolean oldFeatureBounding = wfs.isFeatureBounding(); wfs.setFeatureBounding(true); getGeoServer().save(wfs);
transformer.setPadWithZeros(padWithZeros); transformer.setForceDecimalEncoding(forcedDecimal); transformer.setFeatureBounding(wfs.isFeatureBounding()); transformer.setCollectionBounding(wfs.isFeatureBounding()); transformer.setEncoding(Charset.forName(settings.getCharset()));
boolean oldFeatureBounding = wfs.isFeatureBounding(); wfs.setFeatureBounding(false); getGeoServer().save(wfs);
if (wfs.isFeatureBounding()) { metaAllPropNames = addGeometryProperties(meta, metaPropNames); } else {
boolean before = wfs.isFeatureBounding(); wfs.setFeatureBounding(false); try {