Package com.vividsolutions.jts.geom

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


    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);
  }

  /**
   * Rotate the given coordinate.
   *
 
View Full Code Here


          new Coordinate(25 * i+25, 25 * i+25), new Coordinate(25 * i, 25 * i+25),
          new Coordinate(25 * i, 25 * i),

      });

      polys[i] = factory.createPolygon(ring1, new LinearRing[] {});
      attrValues[i] = "value" + i; //$NON-NLS-1$
    }
    SimpleFeature[] features = createTestFeatures(typename, polys, attrValues,
        DefaultEngineeringCRS.GENERIC_2D);

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

     */
    private Geometry createReferenceGeom() {
        LinearRing ring = GeometryBuilder.create().safeCreateGeometry(LinearRing.class,
                shape.coordArray());
        GeometryFactory fac = new GeometryFactory();
        return fac.createPolygon(ring, new LinearRing[0]);

    }
    public void rollback( IProgressMonitor monitor ) throws Exception {
        GeometryOperationAnimation indicator = new GeometryOperationAnimation(
                PrimitiveShapeIterator.getPathIterator(shape).toShape(), new IsBusyStateProvider(
View Full Code Here

        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);

        GeoXACMLConfig.getXACMLRoleAuthority().transformUserDetails(readerDetails);
View Full Code Here

          Coordinate[] interior=decimate(line.getInteriorRingN(i)).getCoordinates();
          forceClosed(interior);
          if(interior.length>3)
            rings.add(gFac.createLinearRing(interior));
        }
        return gFac.createPolygon(ring, rings.toArray(new LinearRing[] {}));
      }
      return null;
    }
    return geom;
  }
View Full Code Here

    public void testHeterogeneousGeometry() throws Exception {
        GeometryFactory gf = new GeometryFactory();
        Point point = gf.createPoint(new Coordinate(10, 10));
        LineString line = gf.createLineString(new Coordinate[] {
                new Coordinate(50, 50), new Coordinate(100, 100) });
        Polygon polygon = gf.createPolygon(gf
                .createLinearRing(new Coordinate[] { new Coordinate(0, 0),
                        new Coordinate(0, 200), new Coordinate(200, 200),
                        new Coordinate(200, 0), new Coordinate(0, 0) }), null);
       
        SimpleFeatureTypeBuilder ftb = new SimpleFeatureTypeBuilder();
View Full Code Here

        result=remover.cutHole();
      }
    }
    // return a new polygon from the new boundary
    LinearRing resultRing=gFac.createLinearRing(result.getCoordinates());
    return gFac.createPolygon(resultRing, new LinearRing[] {});
  }

 
 
  private static boolean skipHole(LineString hole,double scale) {
View Full Code Here

 
 
  private static boolean skipHole(LineString hole,double scale) {
    GeometryFactory gFac=new GeometryFactory(hole.getPrecisionModel(),hole.getSRID());
    LinearRing ext=gFac.createLinearRing(hole.getCoordinates());
    Polygon holePoly=gFac.createPolygon(ext, new LinearRing[] {});
    // if hole area is less than the tolerance, skip it
    if(holePoly.getArea()<HOLE_AREA_TOLERANCE*scale*scale)     
      return true;
   
    return false;
View Full Code Here

        coords[3] = new Coordinate(upperLeft.x, lowerRight.y);
        coords[4] = coords[0];

        GeometryFactory geomFac = new GeometryFactory();
        LinearRing boundary = geomFac.createLinearRing(coords); // this needs to be done with each FT so it can be reprojected
        Polygon pixelRect = geomFac.createPolygon(boundary, null);
        return pixelRect;
    }

    private FeatureCollection<SimpleFeatureType, SimpleFeature> wrapPixelInFeatureCollection(
            GridCoverage2D coverage, double[] pixelValues, Name coverageName)
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.