/** * Computes the native bounds of a {@link ResourceInfo} taking into account the nature of the * data and the reprojection policy in act * * @param rinfo * @return the native bounds, or null if the could not be computed * @throws IOException */ public ReferencedEnvelope getNativeBounds(ResourceInfo rinfo) throws IOException { return getNativeBounds(rinfo, null); }
void doSetupBounds(ResourceInfo rinfo, Object data) throws IOException { // setup the native bbox if needed if (rinfo.getNativeBoundingBox() == null) { ReferencedEnvelope bounds = getNativeBounds(rinfo, data); rinfo.setNativeBoundingBox(bounds); } // setup the geographic bbox if missing and we have enough info rinfo.setLatLonBoundingBox(getLatLonBounds(rinfo.getNativeBoundingBox(), rinfo.getCRS())); }
@Override public void onSubmit(final AjaxRequestTarget target, Form form) { // perform manual processing otherwise the component contents won't be updated form.process(); ResourceInfo resource = (ResourceInfo) BasicResourceConfig.this.getDefaultModelObject(); try { CatalogBuilder cb = new CatalogBuilder(GeoServerApplication.get().getCatalog()); ReferencedEnvelope bounds = cb.getNativeBounds(resource); resource.setNativeBoundingBox(bounds); nativeBBox.setModelObject(bounds); } catch(IOException e) { LOGGER.log(Level.SEVERE, "Error computing the native BBOX", e); error("Error computing the native BBOX:" + e.getMessage()); } target.addComponent(nativeBBox); }
@Override public void onSubmit(final AjaxRequestTarget target, Form form) { // perform manual processing otherwise the component contents won't be updated form.process(null); ResourceInfo resource = (ResourceInfo) BasicResourceConfig.this.getDefaultModelObject(); try { CatalogBuilder cb = new CatalogBuilder(GeoServerApplication.get().getCatalog()); ReferencedEnvelope bounds = cb.getNativeBounds(resource); resource.setNativeBoundingBox(bounds); nativeBBox.setModelObject(bounds); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Error computing the native BBOX", e); error("Error computing the native BBOX:" + e.getMessage()); } target.add(nativeBBox); }
CatalogBuilder builder = new CatalogBuilder(catalog); try { resource.setNativeBoundingBox(builder.getNativeBounds(resource)); } catch (IOException e) { String errorMessage = "Error while calculating native bounds for layer: " + resource;
CatalogBuilder builder = new CatalogBuilder(catalog); try { message.setNativeBoundingBox(builder.getNativeBounds(message)); } catch (IOException e) { String errorMessage = "Error while calculating native bounds for layer: " + message;
@Override protected void onClick(AjaxRequestTarget target, Form form) { // perform manual processing of the required fields nativeBBox.processInput(); declaredCRS.processInput(); ReferencedEnvelope nativeBounds = (ReferencedEnvelope) nativeBBox.getModelObject(); try { // if the native bounds are not around compute them if(nativeBounds == null) { ResourceInfo resource = (ResourceInfo) BasicResourceConfig.this.getDefaultModelObject(); CatalogBuilder cb = new CatalogBuilder(GeoServerApplication.get().getCatalog()); nativeBounds = cb.getNativeBounds(resource); resource.setNativeBoundingBox(nativeBounds); nativeBBox.setModelObject(nativeBounds); target.addComponent(nativeBBox); } CatalogBuilder cb = new CatalogBuilder(GeoServerApplication.get().getCatalog()); latLonPanel.setModelObject(cb.getLatLonBounds(nativeBounds, declaredCRS.getCRS())); } catch(IOException e) { LOGGER.log(Level.SEVERE, "Error computing the geographic BBOX", e); error("Error computing the geographic bounds:" + e.getMessage()); } target.addComponent(latLonPanel); } };
ReferencedEnvelope nativeBounds = cb.getNativeBounds(resourceInfo); resourceInfo.setNativeBoundingBox(nativeBounds); resourceInfo.setLatLonBoundingBox(
@Override protected void onSubmit(AjaxRequestTarget target, Form<?> form) { // perform manual processing of the required fields form.process(null); form.visitFormComponents(new FeedbackMessageCleaner<>(FeedbackMessage.UNDEFINED)); ReferencedEnvelope nativeBounds = (ReferencedEnvelope) nativeBBox.getModelObject(); try { // if the native bounds are not around compute them if (nativeBounds == null) { ResourceInfo resource = (ResourceInfo) BasicResourceConfig.this.getDefaultModelObject(); CatalogBuilder cb = new CatalogBuilder(GeoServerApplication.get().getCatalog()); nativeBounds = cb.getNativeBounds(resource); resource.setNativeBoundingBox(nativeBounds); nativeBBox.setModelObject(nativeBounds); target.add(nativeBBox); } CatalogBuilder cb = new CatalogBuilder(GeoServerApplication.get().getCatalog()); latLonPanel.setModelObject( cb.getLatLonBounds(nativeBounds, declaredCRS.getCRS())); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Error computing the geographic BBOX", e); error("Error computing the geographic bounds:" + e.getMessage()); } target.add(latLonPanel); }
ReferencedEnvelope nativeBounds = cb.getNativeBounds(resource); resource.setNativeBoundingBox(nativeBounds); resource.setLatLonBoundingBox(cb.getLatLonBounds(nativeBounds, resource.getCRS()));
ReferencedEnvelope nativeBounds = cb.getNativeBounds(resource); resource.setNativeBoundingBox(nativeBounds); resource.setLatLonBoundingBox(cb.getLatLonBounds(nativeBounds,
ReferencedEnvelope nativeBounds = cb.getNativeBounds(resource); resource.setNativeBoundingBox(nativeBounds); resource.setLatLonBoundingBox(cb.getLatLonBounds(nativeBounds, resource.getCRS()));