Package org.geotools.geometry.jts

Examples of org.geotools.geometry.jts.ReferencedEnvelope


        });

        Geometry geometry = (Geometry) currentFeature.getDefaultGeometry();
        Envelope envelope = geometry.getEnvelopeInternal();
        envelope.expandBy(zoomBuffer);
        ReferencedEnvelope ref = new ReferencedEnvelope(envelope, crs);
        try {
            ref = ref.transform(activeMap.getViewportModel().getCRS(), true);
        } catch (Exception e1) {
            // ignore
        }

        UndoableMapCommand selectCommand = SelectionCommandFactory.getInstance().createFIDSelectCommand(selectedLayer,
View Full Code Here


            layer=(Layer) provider.get();
        old=layer.getCRS(monitor);
        monitor.setTaskName(NAME);
        layer.setCRS(crs);
        ViewportModel viewportModel = layer.getMapInternal().getViewportModelInternal();
            ReferencedEnvelope bounds = (ReferencedEnvelope) layer.getMapInternal().getViewportModel().getBounds();
            if( layer.getMapInternal().getMapLayers().size()==1
                    && !bounds.intersects( (Envelope) layer.getBounds(monitor, viewportModel.getCRS()))){
                oldBounds=bounds;
               
                viewportModel.zoomToExtent();
            }
        monitor.done();
View Full Code Here

            this.layer=impl;
        }

        public ReferencedEnvelope getBounds() {
           
            ReferencedEnvelope tmp = info.getBounds();
            if (tmp == null ){
               
                ReferencedEnvelope referencedEnvelope = MapImpl.toReferencedEnvelope(getCRS().getDomainOfValidity(), getCRS());
                if( referencedEnvelope!=null )
                    return referencedEnvelope;
               
                tmp = UNKNOWN_BOUNDS;
            }

            if( tmp.isNull() ){
                return new ReferencedEnvelope(getCRS());
            }
            return tmp;
        }
View Full Code Here

     *
     * @param bounds the bounds to apply to the viewport model
     * @param crs The crs of the provided bounds.
     */
  public SetViewportBBoxCommand(Envelope bounds, CoordinateReferenceSystem crs) {
    this(new ReferencedEnvelope(bounds,crs));
  }
View Full Code Here

                "Error transforming from " + crs.getName() + " to " + model.getCRS().getName(), e); //$NON-NLS-1$//$NON-NLS-2$
      }
    }else{
      crs = model.getCRS();
    }
    model.setBounds(new ReferencedEnvelope(newbbox,crs), forceContainBBoxZoom);
  }
View Full Code Here

        try {
            end = JTS.transform(start, null, worldToScreenMathTransform().inverse(), 10);
        } catch (Exception e) {
            return null;
        }
        return new ReferencedEnvelope(end, getViewportModel().getCRS());
    }
View Full Code Here

        Coordinate center = pixelToWorld(screenLocation.x, screenLocation.y);
        Coordinate size = getPixelSize();
        double dw = (size.x / 2) * scalefactor;
        double dh = (size.y / 2) * scalefactor;
        Envelope e = new Envelope(center.x - dw, center.x + dw, center.y - dh, center.y + dh);
        return new ReferencedEnvelope(e, getCRS());
    }
View Full Code Here

                        // It is lat long so lets use the layer definition
                        env = layerDefinedEnv;
                        crs = DefaultGeographicCRS.WGS84;
                    } else {
                        crs = CRS.decode(bbox.getEPSGCode());
                        env = new ReferencedEnvelope(bbox.getMinX(), bbox.getMaxX(),
                                bbox.getMinY(), bbox.getMaxY(), crs);
                    }
                } catch (NoSuchAuthorityCodeException e) {
                    crs = DefaultGeographicCRS.WGS84;
                    env = layer.getEnvelope(crs);
                } catch (FactoryException e) {
                    crs = DefaultGeographicCRS.WGS84;
                    env = layer.getEnvelope(crs);
                }
            }
            bounds = new ReferencedEnvelope(new Envelope(env.getMinimum(0), env.getMaximum(0), env
                    .getMinimum(1), env.getMaximum(1)), crs);
        }
View Full Code Here

        try {
            crs = CRS.decode(bbox.getEPSGCode());
        } catch (Exception ex) {
            System.out.println("Cannot decode tile epsg code: " + bbox.getEPSGCode()); //$NON-NLS-1$
        }
        bboxSrs = new ReferencedEnvelope(bbox.getMinX(), bbox.getMaxX(), bbox.getMinY(), bbox
                .getMaxY(), crs);
        updateID();
    }
View Full Code Here

        // TODO Auto-generated method stub
        return new IGeoResourceInfo(){
            @Override
            public ReferencedEnvelope getBounds() {
                // TODO Auto-generated method stub
                return new ReferencedEnvelope(new Envelope(), null);
            }
            @Override
            public CoordinateReferenceSystem getCRS() {
                // TODO Auto-generated method stub
                return null;
View Full Code Here

TOP

Related Classes of org.geotools.geometry.jts.ReferencedEnvelope

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.