Examples of RingImplUnsafe


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

        PointImpl p2 = new PointImpl( iterator2.next());
        assertEquals(p1, p2, epsilon);
      }
    }
    else if (geom1 instanceof RingImpl && geom2 instanceof RingImplUnsafe) {
      RingImplUnsafe ring1 = (RingImplUnsafe) geom1;
      RingImplUnsafe ring2 = (RingImplUnsafe) geom2;
      List<DirectPosition> list1 = ring1.asDirectPositions();
      List<DirectPosition> list2 = ring2.asDirectPositions();
      Iterator<DirectPosition> iterator1 = list1.iterator();
      Iterator<DirectPosition> iterator2 = list2.iterator();
      while (iterator1.hasNext() && iterator2.hasNext()) {
        PointImpl p1 = new PointImpl(iterator1.next());
        PointImpl p2 = new PointImpl(iterator2.next());
        assertEquals(p1, p2, epsilon);
      }
    }
    else if (geom1 instanceof RingImpl && geom2 instanceof RingImpl) {
      RingImpl ring1 = (RingImpl) geom1;
      RingImpl ring2 = (RingImpl) geom2;
      List<DirectPosition> list1 = ring1.asDirectPositions();
      List<DirectPosition> list2 = ring2.asDirectPositions();
      Iterator<DirectPosition> iterator1 = list1.iterator();
      Iterator<DirectPosition> iterator2 = list2.iterator();
      while (iterator1.hasNext() && iterator2.hasNext()) {
        PointImpl p1 = new PointImpl(iterator1.next());
        PointImpl p2 = new PointImpl(iterator2.next());
        assertEquals(p1, p2, epsilon);
      }
    }
    else if (geom1 instanceof SurfaceImpl && geom2 instanceof SurfaceImpl) {
      SurfaceImpl surface1 = (SurfaceImpl) geom1;
      SurfaceImpl surface2 = (SurfaceImpl) geom2;
      List<Ring> list1 = surface1.getBoundaryRings();
      List<Ring> list2 = surface2.getBoundaryRings();
      Iterator<Ring> iterator1 = list1.iterator();
      Iterator<Ring> iterator2 = list2.iterator();
      while (iterator1.hasNext() && iterator2.hasNext()) {
        RingImplUnsafe r1 = (RingImplUnsafe) iterator1.next();
        RingImplUnsafe r2 = (RingImplUnsafe) iterator2.next();
        assertEquals(r1, r2, epsilon);
      }
    }
    else {
      assertTrue("unsupported or unmatching geometries", false);
View Full Code Here

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

       
    /* Build Ring from Curve */
    ArrayList<OrientableCurve> curveList = new ArrayList<OrientableCurve>();
    curveList.add(curve1);
   
    RingImplUnsafe ring1 = (RingImplUnsafe) primitiveFactory.createRing(curveList);
    RingImplUnsafe ring2 = (RingImplUnsafe) ring1.transform(crs2);
   
    // create expected result
    PositionFactory expectedPosF2 = new PositionFactoryImpl(crs2, new PrecisionModel());
    PrimitiveFactory expectedPrimF2 = new PrimitiveFactoryImpl(crs2, expectedPosF2);
    GeometryFactory ExpectedGeomF2 = new GeometryFactoryImpl(crs2, expectedPosF2);
   
    List<Position> expectedPoints = new ArrayList<Position>();
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1187128.000000001, 395268.0000000004} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1187127.9999999998, 396026.99999999825} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1188245.0000000007, 396027.0000000039} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1188245.0000000005, 395268.0000000018} ));
    expectedPoints.add(expectedPrimF2.createPoint( new double[]{1187128.000000001, 395268.0000000004} ));
        LineString expectedLineString = ExpectedGeomF2.createLineString(expectedPoints);
        List expectedCurveSegmentList = Collections.singletonList(expectedLineString);
       
        CurveImpl expectedCurve = (CurveImpl) expectedPrimF2.createCurve(expectedCurveSegmentList);
       
    /* Build Ring from Curve */
    ArrayList<OrientableCurve> expectedCurveList = new ArrayList<OrientableCurve>();
    expectedCurveList.add(expectedCurve);
   
    RingImplUnsafe expectedRing = (RingImplUnsafe) expectedPrimF2.createRing(expectedCurveList);
       
    //System.out.println(ring1);
    //System.out.println(ring2);
    //System.out.println(expectedRing);
   
View Full Code Here

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

    }

    // The point lies in the ring defined by the coordinatearray
    // representation of the exterior ring?
    for (int i = 1; i < rings.size(); i++) {
      RingImplUnsafe hole = (RingImplUnsafe) rings.get(i);
      // if so, return false
      if (CGAlgorithms.isPointInRing(p, CoordinateArrays
          .toCoordinateArray(hole.asDirectPositions()))) {
        return false;
      }
    }

    // the point lies inside the exterior ring, and outside the holes, so
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.