Package org.opengis.geometry.primitive

Examples of org.opengis.geometry.primitive.SurfaceBoundary


  }

  private PrimitiveImpl processRingToPrimitive(Envelope bounds, Ring ring, int dimension) {
    int D = crs.getCoordinateSystem().getDimension();
    if( dimension == D ){ // create Surface from ring and return     
      SurfaceBoundary boundary = new SurfaceBoundaryImpl( crs, ring, Collections.EMPTY_LIST );
      return new SurfaceImpl( boundary );
    }   
    CoordinateSystemAxis axis = crs.getCoordinateSystem().getAxis( dimension );
    if( axis.getDirection() == AxisDirection.OTHER ){
      return processRingToPrimitive( bounds, ring, dimension+1 );
View Full Code Here


  public SurfaceImpl createSurfaceByDirectPositions(
      List<DirectPosition> positions) {
    // Test ok
    Ring extRing = this.createRingByDirectPositions(positions);
    List<Ring> intRings = new ArrayList<Ring>();
    SurfaceBoundary sfb = this.createSurfaceBoundary(extRing, intRings);
    return this.createSurface(sfb);
  }
View Full Code Here

        }
        return new DirectPosition[0];
    }
   
    public static DirectPosition[] getExteriorDirectPositions(final Polygon polygon) {
        final SurfaceBoundary surfaceBoundary = polygon.getBoundary();
        final Ring exteriorRing = surfaceBoundary.getExterior();
        return GeometryUtils.getDirectPositions(exteriorRing);
    }
View Full Code Here

        final Ring exteriorRing = surfaceBoundary.getExterior();
        return GeometryUtils.getDirectPositions(exteriorRing);
    }
   
    public static DirectPosition[][] getInteriorDirectPositions(final Polygon polygon) {
        final SurfaceBoundary surfaceBoundary = polygon.getBoundary();
        final List interiorRings = surfaceBoundary.getInteriors();
        final DirectPosition[][] returnable = new DirectPosition[interiorRings.size()][];
        for (int i = 0; i < interiorRings.size(); i++) {
            returnable[i] = getDirectPositions((Ring)interiorRings.get(i));
        }
        return returnable;
View Full Code Here

        for (int i = 0; i < interiorRingsPoints.length; i++) {
            final DirectPosition[] interiorRingPoints = interiorRingsPoints[i];
            interiorRingList.add(createRing(primitiveFactory,interiorRingPoints));
        }
       
        final SurfaceBoundary surfaceBoundary =
            primitiveFactory.createSurfaceBoundary(exteriorRing, interiorRingList);
       
        return geometryFactory.createPolygon(surfaceBoundary);
    }
View Full Code Here

                    new ArrayList();
        for (int i = 0; i < interiorRingsPoints.length; i++) {
            interiorRingList.add(createRing(primitiveFactory, interiorRingsPoints[i]));
        }
       
        final SurfaceBoundary surfaceBoundary =
            primitiveFactory.createSurfaceBoundary(exteriorRing, interiorRingList);
        return surfaceBoundary;
    }
View Full Code Here

             segmentList.add( segment );
         }
         Curve curve = primitiveFactory.createCurve( segmentList );
         curves.add( curve);
         Ring ring = primitiveFactory.createRing( curves );
         SurfaceBoundary boundary = primitiveFactory.createSurfaceBoundary(ring,new ArrayList());
         SurfaceImpl surface = (SurfaceImpl) primitiveFactory.createSurface(boundary);
        
         Geometry peer = surface.computeJTSPeer();
    }
View Full Code Here

    /**
     * @return
     * @see com.polexis.lite.spatialschema.geometry.primitive.SurfacePatchImpl#calculateJTSPeer()
     */
    public com.vividsolutions.jts.geom.Geometry calculateJTSPeer() {
        SurfaceBoundary boundary = getBoundary();
        Ring exterior = boundary.getExterior();
        List interiors = boundary.getInteriors();
        com.vividsolutions.jts.geom.Geometry g = ((JTSGeometry) exterior).getJTSGeometry();
        int numHoles = (interiors != null) ? interiors.size() : 0;
        com.vividsolutions.jts.geom.LinearRing jtsExterior =
            JTSUtils.GEOMETRY_FACTORY.createLinearRing(g.getCoordinates());
        com.vividsolutions.jts.geom.LinearRing [] jtsInterior =
View Full Code Here

//     create the interior ring and a list of empty interior rings (holes)
    Ring extRing = tPrimFactory.createRing(orientableCurves);
    List<Ring> intRings = new ArrayList<Ring>();

//     create the surfaceboundary from the rings
    SurfaceBoundary sb = tPrimFactory.createSurfaceBoundary(extRing, intRings);
       
//     create the surface
    Surface surface22 = tPrimFactory.createSurface(sb);   
   
    // get rings
    SurfaceBoundary sb2 = (SurfaceBoundary) surface22.getBoundary();
    Ring exterior = sb2.getExterior();
    List<Ring> interiors2 = sb2.getInteriors();
    Collection<? extends Primitive> extCurve = exterior.getElements();
    Iterator<? extends Primitive> iter = extCurve.iterator();
    PointArray samplePoints = null;
    while (iter.hasNext()) {
      Curve curve2 = (Curve) iter.next();
View Full Code Here

    while (nextToken.equals(COMMA)) {
      Ring hole = readLinearRingText();
      holes.add(hole);
      nextToken = getNextCloserOrComma();
    }
    SurfaceBoundary sfb = new SurfaceBoundaryImpl(crs,
        shell, holes); //this.primitiveFactory.createSurfaceBoundary(shell, holes);
    return new SurfaceImpl(sfb); //this.primitiveFactory.createSurface(sfb);
  }
View Full Code Here

TOP

Related Classes of org.opengis.geometry.primitive.SurfaceBoundary

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.