Examples of Ring


Examples of org.opengis.geometry.primitive.Ring

        Curve curve = primitiveFactory.createCurve(segmentList);
       
        List<OrientableCurve> curves = new ArrayList<OrientableCurve>();       
        curves.add(curve);
       
        Ring ring = primitiveFactory.createRing(curves);
        SurfaceBoundary surfaceBoundary = primitiveFactory.createSurfaceBoundary( ring, Collections.EMPTY_LIST );      
        return primitiveFactory.createSurface(surfaceBoundary);
    }
View Full Code Here

Examples of org.opengis.geometry.primitive.Ring

   
  }
 
  private List<DirectPosition> surfaceToPositions(Surface s) {
    List<? extends DirectPosition> pos;
    Ring ext = ((SurfaceBoundary)s.getBoundary()).getExterior();
    pos = ((RingImplUnsafe)ext).asDirectPositions();
    return (List<DirectPosition>) pos;   
  }
View Full Code Here

Examples of org.opengis.geometry.primitive.Ring

   
    List<OrientableCurve> edges = new ArrayList<OrientableCurve>();
    edges.add( new CurveImpl( edge1 ));
    edges.add( new CurveImpl( edge2 ));
    edges.add( new CurveImpl( edge3 ));
    Ring exterior = new RingImpl( edges );
   
    // build interior ring
    DirectPosition one2 = pf.createDirectPosition(new double[]{420,360});
    DirectPosition two2 = pf.createDirectPosition(new double[]{200,360});
    DirectPosition three2 = pf.createDirectPosition(new double[]{320,180});
View Full Code Here

Examples of org.opengis.geometry.primitive.Ring

        if (nextToken.equals(EMPTY)) {
            return null;
        }
        Curve curve = readLinearRingText(tokenizer);
        List curveList = Collections.singletonList(curve);
        Ring shell = primitiveFactory.createRing(curveList);
        //Ring shell = readLinearRingText(tokenizer);
        List holes = new ArrayList();
        nextToken = getNextCloserOrComma(tokenizer);
        while (nextToken.equals(COMMA)) {
          Curve holecurve = readLinearRingText(tokenizer);
            List holeList = Collections.singletonList(holecurve);
            Ring hole = primitiveFactory.createRing(holeList);
            //Ring hole = readLinearRingText(tokenizer);
            holes.add(hole);
            nextToken = getNextCloserOrComma(tokenizer);
        }
        SurfaceBoundary sb = primitiveFactory.createSurfaceBoundary(shell, holes);
View Full Code Here

Examples of org.opengis.geometry.primitive.Ring

   * @return containing EdgeRing, if there is one
   * @return null if no containing EdgeRing is found
   */
  private EdgeRing findEdgeRingContaining(EdgeRing testEr, List shellList) {

    Ring testRing = testEr.getRing();
    org.geotools.geometry.iso.coordinate.EnvelopeImpl env = (EnvelopeImpl) testRing
        .getEnvelope();
    Envelope testEnv = new Envelope(env.getLowerCorner().getOrdinate(X), env
        .getUpperCorner().getOrdinate(X), env.getLowerCorner().getOrdinate(Y), env
        .getUpperCorner().getOrdinate(Y));
    // Take a point on the ring to do the point in ring test
    DirectPosition dp = testRing.getRepresentativePoint();
    Coordinate testPt = new Coordinate(dp.getCoordinate());

    EdgeRing minShell = null;
    Envelope minEnv = null;
    for (Iterator it = shellList.iterator(); it.hasNext();) {
      EdgeRing tryShell = (EdgeRing) it.next();
      Ring tryRing = tryShell.getRing();

      env = (EnvelopeImpl) tryRing.getEnvelope();
      Envelope tryEnv = new Envelope(env.getLowerCorner().getOrdinate(X), env
          .getUpperCorner().getOrdinate(X), env.getLowerCorner().getOrdinate(Y), env
          .getUpperCorner().getOrdinate(Y));

      if (minShell != null) {
View Full Code Here

Examples of org.opengis.geometry.primitive.Ring

  /**
   * This method will cause the ring to be computed. It will also check any
   * holes, if they have been assigned.
   */
  public boolean containsPoint(Coordinate p) {
    Ring shell = this.getRing();

    // TODO: auskommentiert; anpassen!
    // Envelope env = shell.getEnvelopeInternal();
    // if (!env.contains(p))
    // return false;
View Full Code Here

Examples of org.opengis.geometry.primitive.Ring

    // use the new rings to build a new Surface and return that.
    PrimitiveFactory primitiveFactory = new PrimitiveFactoryImpl(newCRS, getPositionFactory());
   
    List<Ring> currentRings = this.getBoundaryRings();
    Iterator<Ring> iter = currentRings.iterator();
    Ring newExterior = null;
    List<Ring> newInteriors = new ArrayList<Ring>();
    while (iter.hasNext()) {
      Ring thisRing = (Ring) iter.next();
     
      // exterior Ring should be first element in the list
      if (newExterior == null) {
        newExterior = (Ring) thisRing.transform(newCRS, transform );
      }
      else {
        newInteriors.add((Ring) thisRing.transform(newCRS, transform));
      }
    }
   
    // use the new Ring list to build a new Surface and return it
    SurfaceBoundaryImpl surfaceBoundary = (SurfaceBoundaryImpl) primitiveFactory.createSurfaceBoundary(newExterior, newInteriors);
View Full Code Here

Examples of org.opengis.geometry.primitive.Ring

    LineString lineString = geometryFactory.createLineString(newpositions);
    List curveSegmentList = Collections.singletonList(lineString);
    CurveImpl newCurve = (CurveImpl) primitiveFactory.createCurve(curveSegmentList);
    ArrayList<OrientableCurve> curveList = new ArrayList<OrientableCurve>();
    curveList.add(newCurve);
    Ring newRing = primitiveFactory.createRing(curveList);
    return newRing;
     
  }
View Full Code Here

Examples of org.opengis.geometry.primitive.Ring

   * @see org.geotools.geometry.featgeom.root.GeometryImpl#clone()
   */
  public SurfaceBoundaryImpl clone() throws CloneNotSupportedException {
    // Test OK   
    // Clone exterior ring and interior rings
    Ring newExterior = (Ring) this.getExterior().clone();
    List<Ring> newInteriors = new ArrayList<Ring>();
    Iterator<Ring> interiors = this.getInteriors().iterator();
    while (interiors.hasNext()) {
      newInteriors.add((Ring) interiors.next().clone());
    }
View Full Code Here

Examples of org.opengis.geometry.primitive.Ring

            segments.add(ls);
            Curve result = pf.createCurve(segments);
            return result;
       
        } else if (geomType.equalsIgnoreCase("LinearRing")) {
            Ring result = linearRingToRing(
                    (com.vividsolutions.jts.geom.LinearRing) jtsGeom, crs);
            return result;
       
        } else if (geomType.equalsIgnoreCase("Polygon")) {
            com.vividsolutions.jts.geom.Polygon jtsPolygon =
                (com.vividsolutions.jts.geom.Polygon) jtsGeom;
            Ring externalRing = linearRingToRing(
                    (com.vividsolutions.jts.geom.LinearRing) jtsPolygon.getExteriorRing(),
                    crs);
            int n = jtsPolygon.getNumInteriorRing();
            ArrayList internalRings = new ArrayList();
            for (int i=0; i<n; 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.