Examples of expandToInclude()


Examples of org.geotools.geometry.iso.topograph2D.Envelope.expandToInclude()

  }

  public static Node createExpanded(Node node, Envelope addEnv) {
    Envelope expandEnv = new Envelope(addEnv);
    if (node != null)
      expandEnv.expandToInclude(node.env);

    Node largerNode = createNode(expandEnv);
    if (node != null)
      largerNode.insertNode(node);
    return largerNode;
View Full Code Here

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

                            ymax = env.getMaximum(1);
                    }
                } else if (ext instanceof GeographicBoundingBox) {
                    GeographicBoundingBox gbb = (GeographicBoundingBox) ext;
                    ReferencedEnvelope env = new ReferencedEnvelope(DefaultGeographicCRS.WGS84);
                    env.expandToInclude(gbb.getWestBoundLongitude(), gbb.getNorthBoundLatitude());
                    env.expandToInclude(gbb.getEastBoundLongitude(), gbb.getSouthBoundLatitude());
                    env = env.transform(crs, true);
                    if (env.getMinX() < xmin)
                        xmin = env.getMinX();
                    if (env.getMaxX() > xmax)
View Full Code Here

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

                    }
                } else if (ext instanceof GeographicBoundingBox) {
                    GeographicBoundingBox gbb = (GeographicBoundingBox) ext;
                    ReferencedEnvelope env = new ReferencedEnvelope(DefaultGeographicCRS.WGS84);
                    env.expandToInclude(gbb.getWestBoundLongitude(), gbb.getNorthBoundLatitude());
                    env.expandToInclude(gbb.getEastBoundLongitude(), gbb.getSouthBoundLatitude());
                    env = env.transform(crs, true);
                    if (env.getMinX() < xmin)
                        xmin = env.getMinX();
                    if (env.getMaxX() > xmax)
                        xmax = env.getMaxX();
View Full Code Here

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

        final ToolContext context = ApplicationGISInternal.createContext(getLayer().getMap());
        final CoordinateReferenceSystem crs=getLayer().getCRS( );
        ReferencedEnvelope bounds = new ReferencedEnvelope(getFeature().getBounds());
        double deltax=bounds.getWidth()/4;
        double deltay=bounds.getHeight()/4;
        bounds.expandToInclude(bounds.getMinX()-deltax, bounds.getMinY()-deltay);
        bounds.expandToInclude(bounds.getMaxX()+deltax, bounds.getMaxY()+deltay);
        UndoableComposite composite = new UndoableComposite();
        IAction tool = ApplicationGIS.getToolManager().getToolAction("org.locationtech.udig.tools.selectionTool", "org.locationtech.udig.tool.edit.edit"); //$NON-NLS-1$ //$NON-NLS-2$
        // could be null if tool.edit plug-in is not in distribution.
        if( tool !=null ){
View Full Code Here

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

        final CoordinateReferenceSystem crs=getLayer().getCRS( );
        ReferencedEnvelope bounds = new ReferencedEnvelope(getFeature().getBounds());
        double deltax=bounds.getWidth()/4;
        double deltay=bounds.getHeight()/4;
        bounds.expandToInclude(bounds.getMinX()-deltax, bounds.getMinY()-deltay);
        bounds.expandToInclude(bounds.getMaxX()+deltax, bounds.getMaxY()+deltay);
        UndoableComposite composite = new UndoableComposite();
        IAction tool = ApplicationGIS.getToolManager().getToolAction("org.locationtech.udig.tools.selectionTool", "org.locationtech.udig.tool.edit.edit"); //$NON-NLS-1$ //$NON-NLS-2$
        // could be null if tool.edit plug-in is not in distribution.
        if( tool !=null ){
          tool.run();
View Full Code Here

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

                FeatureCollection fc = (FeatureCollection) it.next();
                if(env == null) {
                    env = fc.getBounds();
                }
                else {
                    env.expandToInclude(fc.getBounds());
                }
               
                // workaround bogus collection implementation that won't return the crs
                if(env != null &&  env.getCoordinateReferenceSystem() == null) {
                    CoordinateReferenceSystem crs = fc.getSchema().getCoordinateReferenceSystem();
View Full Code Here

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

                    FeatureCollection collection = (FeatureCollection) resultsList
                    .get(i);
                    if (e == null) {
                        e = collection.getBounds();
                    } else {
                        e.expandToInclude(collection.getBounds());
                    }

                }

                if (e != null) {
View Full Code Here

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

        LayerInfo l = lg.getLayers().get( 0 );
        ReferencedEnvelope bounds = transform( l.getResource().getLatLonBoundingBox(), crs );
       
        for ( int i = 1; i < lg.getLayers().size(); i++ ) {
            l = lg.getLayers().get( i );
            bounds.expandToInclude( transform( l.getResource().getLatLonBoundingBox(), crs ) );
        }
        lg.setBounds( bounds );
    }
   
    /**
 
View Full Code Here

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

            features = getReader(query);
        }
        ReferencedEnvelope bounds = new ReferencedEnvelope(crs);
        try {
            while (features.hasNext()) {
                bounds.expandToInclude((ReferencedEnvelope) features.next().getBounds());
            }
        } finally {
            features.close();
        }
        return bounds;
View Full Code Here

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

        try {
            int count = 0;
            ReferencedEnvelope env = new ReferencedEnvelope(features.getSchema().getCoordinateReferenceSystem());
            while(it.hasNext()) {
                SimpleFeature f = it.next();
                env.expandToInclude(ReferencedEnvelope.reference(f.getBounds()));
                count++;
            }
            assertEquals(2, count);
            //assertEquals(env, features.getBounds());
            assertTrue(areReferencedEnvelopesEuqal(env, features.getBounds()));
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.