Package org.opengis.geometry.coordinate

Examples of org.opengis.geometry.coordinate.LineSegment


    GeometryFactoryImpl gf = (GeometryFactoryImpl) c.getComponentInstanceOfType( GeometryFactory.class );
    PositionFactory pf = (PositionFactory ) c.getComponentInstanceOfType( PositionFactory.class );
   
    DirectPosition dp1 = pf.createDirectPosition(new double[]{10, 30});
    DirectPosition dp2 = pf.createDirectPosition(new double[]{70, 15});
    LineSegment line1 = gf.createLineSegment(dp1, pf.createDirectPosition(new double[]{20, 40}));
    LineSegment line2 = gf.createLineSegment(dp2, pf.createDirectPosition(new double[]{45, 25}));
    Set<OrientableCurve> curves = new HashSet<OrientableCurve>();
    curves.add( new CurveImpl( line1 ) );
    curves.add( new CurveImpl( line2 ) );
    MultiCurve mc = af.createMultiCurve(curves);
   
View Full Code Here


   
    // build exterior ring
    DirectPosition one = pf.createDirectPosition(new double[]{280,560});
    DirectPosition two = pf.createDirectPosition(new double[]{60,180});
    DirectPosition three = pf.createDirectPosition(new double[]{720,80});
    LineSegment edge1 = new LineSegmentImpl( one, two, 0.0 );
    LineSegment edge2 = new LineSegmentImpl( two, three, 0.0 );
    LineSegment edge3 = new LineSegmentImpl( three, one, 0.0 );
   
    // 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});
    LineSegment edge1_1 = new LineSegmentImpl( one2, two2, 0.0 );
    LineSegment edge2_1 = new LineSegmentImpl( two2, three2, 0.0 );
    LineSegment edge3_1 = new LineSegmentImpl( three2, one2, 0.0 );
   
    // create multiprimitive object
    List<CurveSegment> curves = new ArrayList<CurveSegment>();
    curves.add( edge1 );
    curves.add( edge2 );
View Full Code Here

      LineStringImpl tLineString = (LineStringImpl) tSegment;

      Iterator<LineSegment> tLineSegmentIter = tLineString
          .asLineSegments().iterator();
      while (tLineSegmentIter.hasNext()) {
        LineSegment tLineSegment = tLineSegmentIter.next();
        // Add new Coordinate, which is the start point of the actual
        // LineSegment
        rList.add( tLineSegment.getStartPoint().getDirectPosition() );
      }
    }
    // Add new Coordinate, which is the end point of the last curveSegment
    rList.add( tSegment.getEndPoint() );
    return rList;
View Full Code Here

        LineStringImpl tLineString = (LineStringImpl) tSegment;

        Iterator<LineSegment> tLineSegmentIter = tLineString
            .asLineSegments().iterator();
        while (tLineSegmentIter.hasNext()) {
          LineSegment tLineSegment = tLineSegmentIter.next();
          // Add new Coordinate, which is the start point of the
          // actual LineSegment
          rList.add( tLineSegment.getStartPoint());
        }
      }
      // Add new Coordinate, which is the end point of the last
      // curveSegment
      rList.add( tSegment.getEndPoint());
View Full Code Here

  public PrimitiveImpl createPrimitive(Envelope bounds)
      throws MismatchedReferenceSystemException,
      MismatchedDimensionException {
    //final int D = crs.getCoordinateSystem().getDimension();
   
    LineSegment segment = processBoundsToSegment(bounds);   
    return processSegmentToPrimitive( bounds, segment, 1 );   
  }
View Full Code Here

    three.setOrdinate( D, bounds.getMaximum(D) );
   
    DirectPosition four = positionFactory.createDirectPosition(one.getCoordinate()); //new DirectPositionImpl( one );
    four.setOrdinate( D, bounds.getMaximum(D) );
   
    LineSegment edge1 = new LineSegmentImpl( one, two, 0.0 );
    LineSegment edge2 = new LineSegmentImpl( two, three, 0.0 );
    LineSegment edge3 = new LineSegmentImpl( three, four, 0.0 );
    LineSegment edge4 = new LineSegmentImpl( four, one, 0.0 );
   
    List<OrientableCurve> edges = new ArrayList<OrientableCurve>();
    edges.add( new CurveImpl( edge1 ));
    edges.add( new CurveImpl( edge2 ));
    edges.add( new CurveImpl( edge3 ));
View Full Code Here

         for( int i=0; i<points.size();i++){
             int start = i;
             int end = (i+1)%points.size();
             DirectPosition point1 = points.getDirectPosition( start, null );
             DirectPosition point2 = points.getDirectPosition( end, null );
             LineSegment segment = geometryFactory.createLineSegment( point1, point2 );
             segmentList.add( segment );
         }
         Curve curve = primitiveFactory.createCurve( segmentList );
         curves.add( curve);
         Ring ring = primitiveFactory.createRing( curves );
View Full Code Here

        for( int i=0; i<points.size();i++){
            int start = i;
            int end = (i+1)%points.size();
            DirectPosition point1 = points.getDirectPosition( start, null );
            DirectPosition point2 = points.getDirectPosition( end, null );
            LineSegment segment = createLineSegment( point1, point2 );
            segmentList.add( segment );
        }
        return getPrimitiveFactory().createCurve( segmentList );
    }
View Full Code Here

    DirectPosition copy = (DirectPosition) getPositionFactory().createDirectPosition(position.getDirectPosition().getCoordinate());
    return getPrimitiveFactory().createPoint(copy);
  }

  public Primitive createPrimitive(Envelope envelope) throws MismatchedReferenceSystemException, MismatchedDimensionException {
    LineSegment segment = processBoundsToSegment(envelope);   
    setCoordianteReferenceSystem(envelope.getCoordinateReferenceSystem());
    return processSegmentToPrimitive( envelope, segment, 1 )
  }
View Full Code Here

    three.setOrdinate( D, bounds.getMaximum(D) );
   
    DirectPosition four =  getPositionFactory().createDirectPosition(one.getCoordinate());
    four.setOrdinate( D, bounds.getMaximum(D) );
   
    LineSegment edge1 = getGeometryFactory().createLineSegment(one, two);
    LineSegment edge2 = getGeometryFactory().createLineSegment(two, three);
    LineSegment edge3 = getGeometryFactory().createLineSegment(three, four);
    LineSegment edge4 = getGeometryFactory().createLineSegment(four, one);
   
    List<OrientableCurve> edges = new ArrayList<OrientableCurve>();
    edges.add( createCurve( Arrays.asList(edge1) ));
    edges.add( createCurve( Arrays.asList(edge2) ));
    edges.add( createCurve( Arrays.asList(edge3) ));
View Full Code Here

TOP

Related Classes of org.opengis.geometry.coordinate.LineSegment

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.