@Test public void totalBounds() throws Exception { List<Feature> ff = queryFeatures(featureSource, new IntegerAttributeCriterionDto("myInt", "<", new Integer(100)), 3, 0, null); Assert.assertEquals(3, ff.size()); Bbox bounds = command.getTotalBounds(ff); Assert.assertTrue(BboxService.equals(bounds, new Bbox(1, 1, 2, 2), 0.001)); }
protected Bbox getTotalBounds(List<Feature> features) { Bbox total = null; for (Feature featureDto : features) { org.geomajas.geometry.Geometry geom = featureDto.getGeometry(); if (geom != null) { Bbox b = GeometryService.getBounds(geom); if (total == null) { total = b; } else { total = BboxService.union(total, b); } } } return total; }
WfsGetFeatureCommand implements CommandHasRequest<WfsGetFeatureRequest, WfsGetFeatureResponse> { protected Bbox getTotalBounds(List<Feature> features) { Bbox total = null; for (Feature featureDto : features) { org.geomajas.geometry.Geometry geom = featureDto.getGeometry(); if (geom != null) { Bbox b = GeometryService.getBounds(geom); if (total == null) { total = b; } else { total = BboxService.union(total, b); } } } return total; } }
WfsGetFeatureCommand implements CommandHasRequest<WfsGetFeatureRequest, WfsGetFeatureResponse> { protected Bbox getTotalBounds(List<Feature> features) { Bbox total = null; for (Feature featureDto : features) { org.geomajas.geometry.Geometry geom = featureDto.getGeometry(); if (geom != null) { Bbox b = GeometryService.getBounds(geom); if (total == null) { total = b; } else { total = BboxService.union(total, b); } } } return total; } WfsGetFeatureCommand(); }
WfsGetFeatureCommand implements CommandHasRequest<WfsGetFeatureRequest, WfsGetFeatureResponse> { protected Bbox getTotalBounds(List<Feature> features) { Bbox total = null; for (Feature featureDto : features) { org.geomajas.geometry.Geometry geom = featureDto.getGeometry(); if (geom != null) { Bbox b = GeometryService.getBounds(geom); if (total == null) { total = b; } else { total = BboxService.union(total, b); } } } return total; } WfsGetFeatureCommand(); void setDataStoreFactory(WfsDataStoreFactory dataStoreFactory); void setCriterionToFilterFactory(CriterionToFilterConverterFactory criterionToFilterFactory); void setHttpClientFactory(WfsHttpClientFactory httpClientFactory); @Override void execute(WfsGetFeatureRequest request, WfsGetFeatureResponse response); @Override WfsGetFeatureRequest getEmptyCommandRequest(); @Override WfsGetFeatureResponse getEmptyCommandResponse(); }
WfsGetFeatureCommand implements CommandHasRequest<WfsGetFeatureRequest, WfsGetFeatureResponse> { protected Bbox getTotalBounds(List<Feature> features) { Bbox total = null; for (Feature featureDto : features) { org.geomajas.geometry.Geometry geom = featureDto.getGeometry(); if (geom != null) { Bbox b = GeometryService.getBounds(geom); if (total == null) { total = b; } else { total = BboxService.union(total, b); } } } return total; } WfsGetFeatureCommand(); void setDataStoreFactory(WfsDataStoreFactory dataStoreFactory); void setCriterionToFilterFactory(CriterionToFilterConverterFactory criterionToFilterFactory); void setHttpClientFactory(WfsHttpClientFactory httpClientFactory); @Override void execute(WfsGetFeatureRequest request, WfsGetFeatureResponse response); @Override WfsGetFeatureRequest getEmptyCommandRequest(); @Override WfsGetFeatureResponse getEmptyCommandResponse();  }