Package org.geotools.geometry.jts

Examples of org.geotools.geometry.jts.ReferencedEnvelope.transform()


      public boolean isTrue()  { 
                try{

                    ReferencedEnvelope env = new ReferencedEnvelope(features[0].getBounds());
                    Envelope transformed = (Envelope)env.transform(layer.getCRS(), true,5);
        return features[0].equals(map.getEditManager().getEditFeature()) &&
        map.getViewportModel().getBounds().contains(transformed);
                }catch (Exception e) {
                    throw (RuntimeException)new RuntimeException().initCause(e);
                }
View Full Code Here


        assertTrue(layer.getFilter() instanceof Id);
        assertEquals(features[0].getID(), ((Id)layer.getFilter()).getIDs().toArray(new String[0])[0]);
        assertEquals(features[0], map.getEditManager().getEditFeature());
        assertEquals("active map should be the map of the issue", map, ApplicationGIS.getActiveMap()); //$NON-NLS-1$
        ReferencedEnvelope env = new ReferencedEnvelope(features[0].getBounds());
        assertTrue("Map must contain feature", map.getViewportModel().getBounds().contains((Envelope)env.transform(layer.getCRS(), true,5))); //$NON-NLS-1$
  }
   
    @Test
    public void testSetDescriptionEvents() throws Exception {
        FeatureIssue issue=IssuesListTestHelper.createFeatureIssue("Issue"); //$NON-NLS-1$
View Full Code Here

                }
            }

            if (env != null) {
                try {
                    env = env.transform(crs, true);
                } catch (TransformException e) {
                    ProjectPlugin.log(
                            "error transforming " + env + " to " + crs.getName().toString(), e); //$NON-NLS-1$ //$NON-NLS-2$
                } catch (FactoryException e) {
                    ProjectPlugin.log(
View Full Code Here

                            if (!copiedFeatures.hasNext())
                                return false;
                            next = copiedFeatures.next();
                            ReferencedEnvelope newbounds = new ReferencedEnvelope(next.getBounds());
                            try {
                                newbounds = newbounds.transform(env.crs(), true);
                                env.expandToInclude(newbounds);
                            } catch (TransformException e) {
                                ProjectPlugin.log("", e); //$NON-NLS-1$
                            } catch (FactoryException e) {
                                ProjectPlugin.log("", e); //$NON-NLS-1$
View Full Code Here

            if (validBounds.isNull()){
                return;
            }
            try {
                monitor.setTaskName("rendering features - area");
                validBounds.transform(getContext().getLayer().getCRS(), true);
            } catch (TransformException te) {
                RendererPlugin.log("viewable area is available in the layer CRS", te); //$NON-NLS-1$
                endMessage = Messages.BasicFeatureRenderer_warning1;
                endStatus = ILayer.WARNING;
                return;
View Full Code Here

        }

        // transforms the bbox to the layer crs
        ReferencedEnvelope bbox = handler.getContext().getBoundingBox(e.getPoint(), snapRadious);
        try {
            bbox = bbox.transform(handler.getEditLayer().getCRS(), true);
        } catch (TransformException te) {
            te.printStackTrace();
        } catch (FactoryException fe) {
            fe.printStackTrace();
        }
View Full Code Here

        }

        // transforms the bbox to the layer crs
        ReferencedEnvelope bbox = handler.getContext().getBoundingBox(e.getPoint(), snapRadious);
        try {
            bbox = bbox.transform(handler.getEditLayer().getCRS(), true);
        } catch (TransformException te) {
            te.printStackTrace();
        } catch (FactoryException fe) {
            fe.printStackTrace();
        }
View Full Code Here

        try {
            ReferencedEnvelope bounds = resource.getInfo(null).getBounds();
            if (bounds == null) {
                return true; // bounds are unknown!
            }
            bounds = bounds.transform(DefaultGeographicCRS.WGS84, true);
            return bbox.intersects(bounds);
        } catch (Throwable e) {
            CatalogPlugin.log(null, e);
            return false;
        }
View Full Code Here

        if( crs==null )
            crs=DefaultGeographicCRS.WGS84;
       
        GeometryFactory factory=new GeometryFactory();
        try{
            env=env.transform(crs, true);
        }catch(Exception e){
            IssuesActivator.log("", e); //$NON-NLS-1$
        }

        return factory.createPolygon(factory.createLinearRing(new Coordinate[]{
View Full Code Here

  }
 
  private static double calculateScale(Envelope envelope, CoordinateReferenceSystem coordinateReferenceSystem,int imageWidth,int imageHeight) throws Exception
  {
        ReferencedEnvelope bounds=new ReferencedEnvelope(envelope, coordinateReferenceSystem);
        bounds.transform(DefaultGeographicCRS.WGS84, true);
       
    double diagonalGroundDistance = DefaultGeographicCRS.WGS84.distance(new double[] {bounds
                .getMinX(), bounds.getMinY()}, new double[] {bounds
                .getMaxX(), bounds.getMaxY()}).doubleValue();
         // pythagorus theorm
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.