Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.CoordinateSequence


      constraints.add(lineSegmentXZToJTSLineString(segment));
    }
   
    ArrayList<Point> jtsPoints = new ArrayList<Point>();
    for (VectorXZ p : points) {
      CoordinateSequence coordinateSequence =
        new CoordinateArraySequence(new Coordinate[] {
            vectorXZToJTSCoordinate(p)});
      jtsPoints.add(new Point(coordinateSequence, GF));
    }
   
View Full Code Here


      }
      return gFac.createGeometryCollection(result);
     
    } else if (geom instanceof LineString) {
      LineString line = (LineString) geom;
      CoordinateSequence seq = (CoordinateSequence) line
          .getCoordinateSequence();
      LiteCoordinateSequence lseq=new LiteCoordinateSequence(seq.toCoordinateArray());
     
      if (decimateOnEnvelope(line, lseq)) {
        if(lseq.size()>=2)
          return gFac.createLineString(lseq);
      }
View Full Code Here

    final List sections = new ArrayList();

    g.apply(new GeometryComponentFilter() {

      public void filter(Geometry geom) {
        CoordinateSequence seq = null;
        if (geom instanceof LineString) {
          seq = ((LineString) geom).getCoordinateSequence();
          addFacetSequences(seq, sections);
        }
        else if (geom instanceof Point) {
View Full Code Here

   */
  @Override
  public CoordinateSequence transform(final CoordinateSequence sequence, final MathTransform transform)
    throws TransformException {

    CoordinateSequence cs = super.transform(sequence, transform);

    return this.csFactory.create(cs);
  }
View Full Code Here

  }

  @Override
  public void reset(double x, double y) {
    assert ! isEmpty();
    CoordinateSequence cSeq = pointGeom.getCoordinateSequence();
    cSeq.setOrdinate(0, CoordinateSequence.X, x);
    cSeq.setOrdinate(0, CoordinateSequence.Y, y);
  }
View Full Code Here

   * @param poly the polygon to determine the plane for
   * @return the best-fit plane
   */
  private Plane3D findBestFitPlane(Polygon poly)
  {
    CoordinateSequence seq = poly.getExteriorRing().getCoordinateSequence();
    Coordinate basePt = averagePoint(seq);
    Vector3D normal = averageNormal(seq);
    return new Plane3D(normal, basePt);
  }
View Full Code Here

    }
    return true;
  }

  private int locate(Coordinate pt, LineString ring) {
    CoordinateSequence seq = ring.getCoordinateSequence();
    CoordinateSequence seqProj = project(seq, facingPlane);
    Coordinate ptProj = project(pt, facingPlane);
    return RayCrossingCounter.locatePointInRing(ptProj, seqProj);
  }
View Full Code Here

    Coordinate ptProj = project(pt, facingPlane);
    return RayCrossingCounter.locatePointInRing(ptProj, seqProj);
  }
 
  public boolean intersects(Coordinate pt, LineString ring) {
    CoordinateSequence seq = ring.getCoordinateSequence();
    CoordinateSequence seqProj = project(seq, facingPlane);
    Coordinate ptProj = project(pt, facingPlane);
    return Location.EXTERIOR != RayCrossingCounter.locatePointInRing(ptProj, seqProj);
  }
View Full Code Here

      if (isDone) return;
    }
  }

  private Coordinate intersection(PlanarPolygon3D poly,LineString line) {
    CoordinateSequence seq = line.getCoordinateSequence();
    if (seq.size() == 0)
      return null;

    // start point of line
    Coordinate p0 = new Coordinate();
    seq.getCoordinate(0, p0);
    double d0 = poly.getPlane().orientedDistance(p0);
   
    // for each segment in the line
    Coordinate p1 = new Coordinate();
    for (int i = 0; i < seq.size() - 1; i++) {
      seq.getCoordinate(i, p0);
      seq.getCoordinate(i + 1, p1);
      double d1 = poly.getPlane().orientedDistance(p1);

      /**
       * If the oriented distances of the segment endpoints have the same sign,
       * the segment does not cross the plane, and is skipped.
View Full Code Here

    final List sections = new ArrayList();

    g.apply(new GeometryComponentFilter() {

      public void filter(Geometry geom) {
        CoordinateSequence seq = null;
        if (geom instanceof LineString) {
          seq = ((LineString) geom).getCoordinateSequence();
          addFacetSequences(seq, sections);
        }
        else if (geom instanceof Point) {
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.geom.CoordinateSequence

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.