Package com.vividsolutions.jts.geom

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


  @Before
  public void setUp() throws Exception {
    GeometryFactory factory=new GeometryFactory();
   
    LinearRing ring1=factory.createLinearRing(new Coordinate[]{
        new Coordinate(0,0),
        new Coordinate(512,0),
        new Coordinate(512,256),
        new Coordinate(0,256),
        new Coordinate(0,0),
View Full Code Here


       
    });
   
    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),
        new Coordinate(0,512),
        new Coordinate(0,256),
View Full Code Here

        Coordinate actualCoord = holeCoords[i];
        rotationHole.add(rotate(actualCoord, pivot, angle));
      }
      Coordinate[] rotatedHole = rotationHole.toArray(new Coordinate[rotationHole.size()]);
      holes.add(gf.createLinearRing(rotatedHole));
    }

    Coordinate[] newCoords = rotationShell.toArray(new Coordinate[rotationShell.size()]);
    LinearRing shell = gf.createLinearRing(newCoords);
View Full Code Here

      Coordinate[] rotatedHole = rotationHole.toArray(new Coordinate[rotationHole.size()]);
      holes.add(gf.createLinearRing(rotatedHole));
    }

    Coordinate[] newCoords = rotationShell.toArray(new Coordinate[rotationShell.size()]);
    LinearRing shell = gf.createLinearRing(newCoords);

    LinearRing[] rings = holes.toArray(new LinearRing[holes.size()]);

    return gf.createPolygon(shell, rings);
  }
View Full Code Here

    Polygon[] polys = new Polygon[numFeatures];
    String[] attrValues = new String[numFeatures];

    for (int i = 0; i < polys.length; i++) {

      LinearRing ring1 = factory.createLinearRing(new Coordinate[] {
          new Coordinate(25 * i, 25 * i), new Coordinate(25 * i+25, 25 * i),
          new Coordinate(25 * i+25, 25 * i+25), new Coordinate(25 * i, 25 * i+25),
          new Coordinate(25 * i, 25 * i),

      });
 
View Full Code Here

      // close the geometry.
      Coordinate[] closedLine = closeGeometry(lineCoor);
      // try to create a linearRing.
      LinearRing ring;
      try {
        ring = factory.createLinearRing(closedLine);
        // Create the polygon geometry and add to the list.
        Geometry polygonGeometry = factory.createPolygon(ring, null);
        ringsList.add(polygonGeometry);
      } catch (Exception e) {
        // Couldn't create a ring from this geometry,so continue.
View Full Code Here

                   if (i == positionToInsertOnRing) {
                       updatedHole.add(coorToInsert);
                   }
               }
               Coordinate[] modifiedRingCoords = updatedHole.toArray(new Coordinate[updatedHole.size()]);
               LinearRing modifiedRing = gf.createLinearRing(modifiedRingCoords);
               rings[nRing] = modifiedRing;
           }
       }

       // create the polygon.
View Full Code Here

           }
       }

       // create the polygon.
       assert shellCoords != null : "there should be at least shell coordinates to build a polygon."; //$NON-NLS-1$
       LinearRing shellRing = gf.createLinearRing(shellCoords);
       Polygon newPolygon = gf.createPolygon(shellRing, rings);
      
       AdaptedPolygon rebuildedPolygon = new AdaptedPolygon(newPolygon);

       return rebuildedPolygon;
View Full Code Here

        UserDetailsImpl readerDetails = new UserDetailsImpl("reader", "pwreader",
                new GrantedAuthority[] { new GrantedAuthorityImpl("READER") });
        readerDetails.setPersNr(4711);
        GeometryFactory fac = new GeometryFactory();
        LinearRing r = fac.createLinearRing(new Coordinate[] { new Coordinate(11, 11),
                new Coordinate(14, 11), new Coordinate(14, 14), new Coordinate(11, 14),
                new Coordinate(11, 11), });
        Polygon poly = fac.createPolygon(r, new LinearRing[] {});
        poly.setUserData("EPSG:4326");
        readerDetails.setGeometryRestriction(poly);
View Full Code Here

    } else if (geom instanceof Polygon) {
      Polygon line = (Polygon) geom;
      Coordinate[] exterior=decimate(line.getExteriorRing()).getCoordinates();
      forceClosed(exterior);
      if(exterior.length>3) {
        LinearRing ring=gFac.createLinearRing(exterior);
             
        final int numRings = line.getNumInteriorRing();       
        List<LinearRing> rings=new ArrayList<LinearRing>();
       
        for (int i = 0; i < numRings; i++) {
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.