Examples of createPolygon()


Examples of com.vividsolutions.jts.geom.GeometryFactory.createPolygon()

    // form a closed linearRing.
    shellClosed = GeometryUtil.closeGeometry(shellClosed);
    LinearRing shellRing = fc.createLinearRing(shellClosed);

    result = fc.createPolygon(shellRing, holesRing);

    return result;
  }

  /**
 
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.createPolygon()

                new Coordinate(-128.6811, 59.0559), new Coordinate(-128.6817, 59.0538),
                new Coordinate(-128.683, 59.0526), new Coordinate(-128.6837, 59.052),
                new Coordinate(-128.685, 59.0512), new Coordinate(-128.6863, 59.0512),
                new Coordinate(-128.6889, 59.0493), new Coordinate(-128.6898, 59.0493)};
        GeometryFactory fac=new GeometryFactory();
        Polygon lake = fac.createPolygon(fac.createLinearRing(coords), new LinearRing[0]);
        Envelope env = lake.getEnvelopeInternal();
       
        ViewportModel model = ((ViewportModel) handler.getContext().getMap().getViewportModel());
        model.setBounds(env);
        model.setWidth(env.getWidth()*200);
 
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.createPolygon()

                                new Coordinate( 20,10), new Coordinate(40,10),
                                new Coordinate( 40,40), new Coordinate(20,40),
                                new Coordinate( 20,10)
                        }
                );
                geom=geomFac.createPolygon((LinearRing) geom, new LinearRing[0]);
            }
            source.modifyFeatures(feature.getFeatureType().getGeometryDescriptor(), geom, filterFac.id(FeatureUtils.stringToId(filterFac, feature.getID())));
            i++;
        }
        ((EditManager) handler.getContext().getEditManager()).commitTransaction();
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.createPolygon()

    public void testMovePointOnGeometry() throws Exception {
      GeometryFactory fac = new GeometryFactory();
     
      double[] coords = new double[]{10,10, 10,20, 10,30, 30,30, 20,30, 10,10};
    LinearRing ring = fac.createLinearRing(new PackedCoordinateSequenceFactory().create(coords , 2));
      Polygon poly = fac.createPolygon(ring, new LinearRing[0]);
     
      bb.clear();
      geom =  bb.addGeometry(poly, "poly").values().iterator().next();
     
      bb.moveCoords(10, 10, 0, 10);
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.createPolygon()

    public void setUp() throws Exception {
        GeometryFactory fac=new GeometryFactory();
        LineString line = fac.createLineString(new Coordinate[]{
           new Coordinate(0,10),new Coordinate(10,10), new Coordinate(20,10)
        });
        Polygon poly = fac.createPolygon(fac.createLinearRing(new Coordinate[]{
                new Coordinate(20,20),new Coordinate(40,20), new Coordinate(40,40),
                new Coordinate(20,40), new Coordinate(20,20)
             }), new LinearRing[0]);
   
        handler=new TestHandler();
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.createPolygon()

                new Coordinate(50,50),
                new Coordinate(50,55),
                new Coordinate(0,55),
                new Coordinate(0,50),
        });
        Polygon polygon = fac.createPolygon(ring, new LinearRing[0]);
        FeatureStore<SimpleFeatureType, SimpleFeature> store = map.getMapLayers().get(0).getResource(FeatureStore.class, new NullProgressMonitor());       
        FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
    store.modifyFeatures(features[0].getFeatureType().getGeometryDescriptor(), polygon,
                filterFactory.id(FeatureUtils.stringToId(filterFactory, features[0].getID())));
   
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.createPolygon()

                new Coordinate(50,0),
                new Coordinate(50,10),
                new Coordinate(0,10),
                new Coordinate(0,0),
        });
        Polygon polygon1 = fac.createPolygon(ring1, new LinearRing[0]);

        LinearRing ring2=fac.createLinearRing(new Coordinate[]{
                new Coordinate(0,50),
                new Coordinate(50,50),
                new Coordinate(50,60),
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.createPolygon()

                new Coordinate(50,50),
                new Coordinate(50,60),
                new Coordinate(0,60),
                new Coordinate(0,50),
        });
        Polygon polygon2 = fac.createPolygon(ring2, new LinearRing[0]);

        Geometry geom=fac.createMultiPolygon(new Polygon[]{polygon1, polygon2});
       
        FeatureStore<SimpleFeatureType, SimpleFeature> store = map.getMapLayers().get(0).getResource(FeatureStore.class, new NullProgressMonitor());
        FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.createPolygon()

            env=env.transform(crs, true);
        }catch(Exception e){
            IssuesActivator.log("", e); //$NON-NLS-1$
        }

        return factory.createPolygon(factory.createLinearRing(new Coordinate[]{
                new Coordinate(env.getMinX(), env.getMinY()),
                new Coordinate(env.getMaxX(), env.getMinY()),
                new Coordinate(env.getMaxX(), env.getMaxY()),
                new Coordinate(env.getMinX(), env.getMaxY()),
                new Coordinate(env.getMinX(), env.getMinY()),
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.createPolygon()

        new Coordinate(0,256),
        new Coordinate(0,0),
       
    });
   
    Polygon poly1=factory.createPolygon( ring1, new LinearRing[]{});
   
    LinearRing ring2=factory.createLinearRing(new Coordinate[]{
        new Coordinate(0,256),
        new Coordinate(512,256),
        new Coordinate(512,512),
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.