Package org.opengis.geometry.primitive

Examples of org.opengis.geometry.primitive.Surface


    Ring exteriorRing = primf.createRingByDirectPositions(directPositionList);
    List<Ring> interiors = new ArrayList<Ring>();
   
    SurfaceBoundaryImpl surfaceBoundary1 = primf.createSurfaceBoundary(exteriorRing, interiors );
    Surface surface = primf.createSurface(surfaceBoundary1);
   
    Set<OrientableSurface> surfaces = new HashSet<OrientableSurface>();
    surfaces.add(surface);
    MultiSurfaceImpl ms = (MultiSurfaceImpl) agf.createMultiSurface(surfaces);
    //System.out.println(ms);
View Full Code Here


        pointsB[0] = createDirectPosition(0.0, 0.0);
        pointsB[1] = createDirectPosition(1.0, 0.0);
        pointsB[2] = createDirectPosition(1.0, 1.0);
        pointsB[3] = createDirectPosition(0.0, 0.0);

        Surface sA = createSurface(pointsA);
        assertEquals(0.5, sA.getArea(), 1.0e-8);
        assertEquals(1.0 + 1.0 + Math.sqrt(2.0), sA.getPerimeter());

        Surface sB = createSurface(pointsB);
        assertEquals(0.5, sB.getArea(), 1.0e-8);
        assertEquals(1.0 + 1.0 + Math.sqrt(2.0), sB.getPerimeter());

        TransfiniteSet result = sA.intersection(sB);
        assertTrue(result instanceof Surface);
        Surface surfaceResult = (Surface)result;
        assertEquals(1.0 + Math.sqrt(2.0), surfaceResult.getPerimeter());
    }
View Full Code Here

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

         }
         Curve curve = builder.createCurve( segmentList );
         curves.add( curve);        
         Ring ring = builder.createRing( curves );
         SurfaceBoundary boundary = builder.createSurfaceBoundary(ring );
         Surface surface = builder.createSurface(boundary);        
    }
View Full Code Here

   
    List<? extends SurfacePatch> triangleList = createTestTriangle1(builder);
   
    List<SurfacePatch> surfacePatches1 = (List<SurfacePatch>)triangleList;

    Surface surface1 = tPrimFactory.createSurface(surfacePatches1);
   
    //System.out.print("\n******************* SURFACE GENERATED BY SURFACEPATCHES");
    this.testSurfaces((SurfaceImpl) surface1);
  }
View Full Code Here

        pointsB[0] = createDirectPosition(1.0, 0.0);
        pointsB[1] = createDirectPosition(1.0, 1.0);
        pointsB[2] = createDirectPosition(0.0, 1.0);
        pointsB[3] = createDirectPosition(1.0, 0.0);

        Surface sA = createSurface(pointsA);
        assertEquals(0.5, sA.getArea(), 1.0e-8);
        assertEquals(1.0 + 1.0 + Math.sqrt(2.0), sA.getPerimeter());

        Surface sB = createSurface(pointsB);
        assertEquals(0.5, sB.getArea(), 1.0e-8);
        assertEquals(1.0 + 1.0 + Math.sqrt(2.0), sB.getPerimeter());

        TransfiniteSet result = sA.intersection(sB);
        assertTrue(result instanceof Curve);
        Curve curveResult = (Curve)result;
        assertEquals(0.0, curveResult.getStartParam(), 1.0e-8);
View Full Code Here

    Ring exteriorRing = (Ring) tPrimFactory.createRingByDirectPositions(directPositionList);
    List<Ring> interiors = new ArrayList<Ring>();
   
    SurfaceBoundaryImpl surfaceBoundary1 = tPrimFactory.createSurfaceBoundary(exteriorRing, interiors );
   
    Surface surface2 = tPrimFactory.createSurface(surfaceBoundary1);
   
    //System.out.print("\n******************* SURFACE GENERATED BY SURFACEBOUNDARY");

   
    this.testSurfaces((SurfaceImpl) surface2);
   
    // ***** clone()
    SurfaceImpl surface3 = null;
    try {
      surface3 = (SurfaceImpl) surface2.clone();
    } catch (CloneNotSupportedException e) {
      e.printStackTrace();
    }
    assertTrue(surface2 != surface3);
    this.testSurfaces((SurfaceImpl) surface3);
   
    // ***** getRepresentativePoint()
    double[] dp = surface2.getRepresentativePoint().getCoordinate();
    assertTrue(dp[0] == 20);
    assertTrue(dp[1] == 10);


    return surface2;
View Full Code Here

                0.5, 0.5,
                0.5, 0.0,
                0.0, 0.0};
        PointArray closedPoints = builder.createPointArray( closed );
        SurfaceBoundary closedBoundary = builder.createSurfaceBoundary( closedPoints );
        Surface closedSurface = builder.createSurface( closedBoundary );
       
        // this example is not closed and would fail
        // if we were not calling createSurfaceBoundary
        double open[] = new double[]{
                0.0, 0.0,
                0.0, 0.5,
                0.5, 0.5,
                0.5, 0.0,};                     
        PointArray openPoints = builder.createPointArray( open );
        SurfaceBoundary openBoundary = builder.createSurfaceBoundary( openPoints );
        Surface openSurface = builder.createSurface( openBoundary );
       
        assertEquals( "close array", openSurface, closedSurface );               
    }
View Full Code Here

                0.0, 0.0,
                0.0, 0.5,
                0.5, 0.5,
                0.5, 0.0,
                0.0, 0.0};
        Surface closedSurface = createSurfaceFast(closed);
       
       
        // this example is not closed and would fail
        // if we were not calling createSurfaceBoundary
        double open[] = new double[]{
                0.0, 0.0,
                0.0, 0.5,
                0.5, 0.5,
                0.5, 0.0,};                     
        PointArray openPoints = builder.createPointArray( open );
        SurfaceBoundary openBoundary = builder.createSurfaceBoundary( openPoints );
        Surface openSurface = builder.createSurface( openBoundary );
       
        assertEquals( "close array", openSurface, closedSurface );
       
        Surface surface = transmit(closedSurface);
        assertEquals( closedSurface, surface );
       
        DirectPosition aPoint = surface.getRepresentativePoint();
        DirectPosition point = transmit( aPoint );
        assertEquals( aPoint, point );
    }
View Full Code Here

                -123.4550070827961,48.54290089070186,
                -123.47009555832284,48.543261561072285
        };
        PointArray points = builder.createPointArray(array);
        SurfaceBoundary boundary = builder.createSurfaceBoundary(points);
        Surface surface = builder.createSurface(boundary);
        assertNotNull( surface );
       
        Surface surface2 = (Surface) surface.transform( wsg2, t );
        assertNotNull( surface2 );
       
        assertTrue( "object equals", surface.equals( (Object) surface2 ));
        assertTrue( "geometry equals", surface.equals( surface2 ));
  }
View Full Code Here

TOP

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

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.