Package org.geotools.geometry.iso.primitive

Examples of org.geotools.geometry.iso.primitive.PrimitiveImpl


    // indirect: public SurfaceBoundaryImpl createSurfaceBoundary(Ring exterior, List<Ring> interiors);
    // indirect: public Ring createRingByDirectPositions(List<DirectPosition> directPositions);
    DirectPosition dp1 = posf.createDirectPosition(new double[]{10, 10});
    DirectPosition dp2 = posf.createDirectPosition(new double[]{70, 30});
    Envelope env1 = cf.createEnvelope(dp1, dp2);
    PrimitiveImpl prim1 = (PrimitiveImpl) pf.createPrimitive(env1);
    assertNotNull(prim1);
   
  }
View Full Code Here


    } else if (geom instanceof SurfaceImpl) {
      updateLocationInfo(locate(p, (SurfaceImpl) geom));
    } else if (geom instanceof MultiPrimitiveImpl) {
      Iterator<? extends Primitive> iterator = ((MultiPrimitiveImpl)geom).getElements().iterator();
      while (iterator.hasNext()) {
        PrimitiveImpl prim = ((PrimitiveImpl)iterator.next());
        updateLocationInfo(locate(p, prim));
      }
    }
   
    // else if (geom instanceof MultiLineString) {
View Full Code Here

      }
    } else if (geom instanceof MultiPrimitiveImpl) {
      positions = new HashSet<PointImpl>();
      Iterator<? extends Primitive> iterator = ((MultiPrimitiveImpl)geom).getElements().iterator();
      while (iterator.hasNext()) {
        PrimitiveImpl prim = ((PrimitiveImpl)iterator.next());
       
        // if this is a point, it has no boundary so just add the point
        if (prim instanceof PointImpl) {
          positions.add(prim);
        }
        else {
          // this is not a point, so get its convexhull and add those
          // points to this hull
          Geometry hull = prim.getConvexHull();
         
          if (hull instanceof CurveImpl) {
            CurveImpl curve = (CurveImpl) prim.getConvexHull();
            positions.addAll( ((CurveImpl)curve).asDirectPositions() );
          }
          else if (hull instanceof SurfaceImpl) {
            SurfaceImpl surface = (SurfaceImpl) prim.getConvexHull();
            positions.addAll( ((RingImplUnsafe)((SurfaceImpl)surface).getBoundary().getExterior()).asDirectPositions() );
          }
         
          /*
          // this is not a point, so get its boundary and add its
View Full Code Here

TOP

Related Classes of org.geotools.geometry.iso.primitive.PrimitiveImpl

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.