Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.LinearRing


        HolesRemover remover=new HolesRemover(result,hole,gFac);
        result=remover.cutHole();
      }
    }
    // return a new polygon from the new boundary
    LinearRing resultRing=gFac.createLinearRing(result.getCoordinates());
    return gFac.createPolygon(resultRing, new LinearRing[] {});
  }
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;
   
View Full Code Here

                Coordinate[] coords = {
                        new Coordinate(hpad, vpad), new Coordinate(hpad, vpad + h),
                        new Coordinate(hpad + w, vpad + h), new Coordinate(hpad + w, vpad),
                        new Coordinate(hpad, vpad)
                    };
                LinearRing shell = geomFac.createLinearRing(coords);
                Polygon geom = geomFac.createPolygon(shell, null);

                try {
                    this.sampleRect = new LiteShape2(geom, null, null, false);
                } catch (Exception e) {
View Full Code Here

            y -= dy;
        }
        coords.add(new Coordinate(westBoundLongitude, southBoundLatitude));

        Coordinate[] coordinates = coords.toArray(new Coordinate[coords.size()]);
        LinearRing shell = gf.createLinearRing(coordinates);
        Polygon polygon = gf.createPolygon(shell, null);
        return polygon;
    }
View Full Code Here

        coords[2] = lowerRight;
        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;
    }
View Full Code Here

      Coordinate c = new Coordinate(v.getLng(), v.getLat());
      coords[i] = c;
    }
   
    // now create a line string from the coordinates array where null = no holes in the polygon
    LinearRing ring = new GeometryFactory().createLinearRing(coords);
    Geometry geometry = new GeometryFactory().createPolygon(ring, null);
   
    // create a point from the mapCenter vertex
    // TODO: mapCenter is null when creating a new study region.
    Vertex mapCenterVertex = studyRegion.getMapCenter();
View Full Code Here

  public static Geometry toPolygon(Vertex[] v) {
    Coordinate[] ringPts = new Coordinate[] { v[0].getCoordinate(),
        v[1].getCoordinate(), v[2].getCoordinate(), v[0].getCoordinate() };
    GeometryFactory fact = new GeometryFactory();
    LinearRing ring = fact.createLinearRing(ringPts);
    Polygon tri = fact.createPolygon(ring, null);
    return tri;
  }
View Full Code Here

  public static Geometry toPolygon(QuadEdge[] e) {
    Coordinate[] ringPts = new Coordinate[] { e[0].orig().getCoordinate(),
        e[1].orig().getCoordinate(), e[2].orig().getCoordinate(),
        e[0].orig().getCoordinate() };
    GeometryFactory fact = new GeometryFactory();
    LinearRing ring = fact.createLinearRing(ringPts);
    Polygon tri = fact.createPolygon(ring, null);
    return tri;
  }
View Full Code Here

    Coordinate[] ring = getCoordinates();
    return CGAlgorithms.isPointInRing(pt, ring);
  }

  public Polygon getGeometry(GeometryFactory fact) {
    LinearRing ring = fact.createLinearRing(getCoordinates());
    Polygon tri = fact.createPolygon(ring, null);
    return tri;
  }
View Full Code Here

  // - if the ring is CW then the result line must be this: first
  // intersection coordinate--> second intersection coordinate.
  // - if the ring is CCW the the result line must be this: second
  // intersection coordinate --> first intersection coordinate.
  GeometryFactory factory = intersectingSegment.getFactory();
  LinearRing linearRing = factory.createLinearRing(ring
    .toArray(new Coordinate[ring.size()]));

  LineString adjustedSegment = null;
  if (isCW(linearRing)) {
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.geom.LinearRing

Copyright © 2018 www.massapicom. 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.