Package com.vividsolutions.jts.geom

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


     * @throws Exception
     */
    @Test
    public void testSetTransformScale() throws Exception {
        GeometryFactory factory = new GeometryFactory();
        LinearRing linearRing = factory.createLinearRing(new Coordinate[]{
                new Coordinate(10, 10),
                new Coordinate(10, 20.5),
                new Coordinate(10, 20),
                new Coordinate(20, 20),
                new Coordinate(10, 10)
View Full Code Here


   
    @Test
    public void testSetGeometries() throws Exception {
        GeometryFactory factory = new GeometryFactory();
        int offset=0;
        LinearRing linearRing = factory.createLinearRing(new Coordinate[]{
                new Coordinate(offset+5, 7),
                new Coordinate(offset+8, 7),
                new Coordinate(offset+8, 8),
                new Coordinate(offset+5, 8),
                new Coordinate(offset+5, 7)
View Full Code Here

            }else if( i==1 ){
                geom=geomFac.createLineString(new Coordinate[]{
                        new Coordinate( 10,10), new Coordinate(10,20)
                });
            }else{
                geom=geomFac.createLinearRing(
                        new Coordinate[]{
                                new Coordinate( 20,10), new Coordinate(40,10),
                                new Coordinate( 40,40), new Coordinate(20,40),
                                new Coordinate( 20,10)
                        }
View Full Code Here

    @Test
    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();
     
View Full Code Here

    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

    @Test
    public void testDiffOnMultipleGeoms() throws Exception {
        handler.resetEditBlackboard();
        GeometryFactory fac=new GeometryFactory();
        LinearRing ring=fac.createLinearRing(new Coordinate[]{
                new Coordinate(0,50),
                new Coordinate(50,50),
                new Coordinate(50,55),
                new Coordinate(0,55),
                new Coordinate(0,50),
View Full Code Here

   
    @Test
    public void testMultiGeometry() throws Exception {
        handler.resetEditBlackboard();
        GeometryFactory fac=new GeometryFactory();
        LinearRing ring1=fac.createLinearRing(new Coordinate[]{
                new Coordinate(0,0),
                new Coordinate(50,0),
                new Coordinate(50,10),
                new Coordinate(0,10),
                new Coordinate(0,0),
View Full Code Here

                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),
                new Coordinate(0,60),
                new Coordinate(0,50),
View Full Code Here

        // add the first coordinate has last coordinate in order to close the ring
        coordList.add(coordList.get(0));
        Coordinate[] linearRingCoords =  coordList.toArray(new Coordinate[ coordList.size() ]);
       
        GeometryFactory factory = adaptedRingSegmentList.get(0).getFactory();
        LinearRing ring = factory.createLinearRing(linearRingCoords);
      
        return ring;
    }

    /**
 
View Full Code Here

            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

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.