Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.Point


            SplitLineSegmentIntersectionNode segmentNode = this.splitLineSegmentWithIntersectionList
                    .get(segmentPosition);
            if (!segmentNode.getIntersectionList().isEmpty()) {

                Point point = segmentNode.searchNearestIntersection();
                IntersectionLink link = this.intersectionLinks.get(point);
                LineString ringSegment = link.getRingSegment();

                this.cursor = new IntersectCursor();
                this.cursor.setCurrentIntersection(segmentPosition, point, ringSegment);
View Full Code Here


        this.backCursor = (IntersectCursor) this.cursor.clone();
       
        // the next intersection could be in the same segment or in the next segments.
        // thus the search must begin in the last visited segment.
        final int lastVisitedSegment = this.cursor.getSegmentPosition();
        final Point lastVistedIntersection = this.cursor.getIntersectionPoint();

        // search the next intersection point in the latest segment
        SplitLineSegmentIntersectionNode node = this.splitLineSegmentWithIntersectionList
                .get(lastVisitedSegment);
        Point intersectionFound = node.searchNearestIntersectionFrom(lastVistedIntersection);
        if (intersectionFound != null) {
            // found a new intersection in the last visited segment

            IntersectionLink link = this.intersectionLinks.get(intersectionFound);
            LineString ringSegment = link.getRingSegment();
View Full Code Here

            // The unsorted list has got almost two elements. Initializes the sorted list with the
            // first
            List<Point> sortedList = new GeometryList<Point>();
            sortedList.add(0, unSortedList.get(0));

            final Point firstVertex = this.geometryFactory.createPoint(this.segment
                    .getCoordinateN(0));

            for( int i = 1; i < unSortedList.size(); i++ ) {

                Point curPoint = unSortedList.get(i);
                double newDistance = DistanceOp.distance(firstVertex, curPoint);
                assert newDistance >= 0;

                boolean wasInserted = false;
                for( int j = 0; j < sortedList.size(); j++ ) {

                    Point sortedPoint = sortedList.get(j);
                    double sortedDistance = DistanceOp.distance(firstVertex, sortedPoint);
                    assert sortedDistance >= 0;
                    if (newDistance < sortedDistance) {

                        sortedList = addPointInListFilterEquals(sortedList, j, curPoint);
View Full Code Here

            // found the position of reference point
            int positionOfReferencePoint = -1;
            for( int i = 0; i < this.intersectionList.size(); i++ ) {

                Point point = this.intersectionList.get(i);
                Coordinate pointCoordinate = point.getCoordinate();
                Coordinate referenceCoordinate = referencePoint.getCoordinate();
                if (pointCoordinate.equals2D(referenceCoordinate)) {
                    positionOfReferencePoint = i;
                    break;
                }
            }
            if (positionOfReferencePoint == -1) {
                return null; // not found
            }
            // It was found then return the next position, if there are a next element in the
            // intersection list
            Point nexIntersection = null;
            if ((positionOfReferencePoint + 1) < this.intersectionList.size()) {

                nexIntersection = this.intersectionList.get(positionOfReferencePoint + 1);
            }
            return nexIntersection;
View Full Code Here

      return original;
    }

    assert intersectGeom instanceof Point : "The intersection between trim line and the feature must be a point.";

    Point intersection = (Point) intersectGeom;
    Coordinate intersectionPoint = intersection.getCoordinate();

    final Coordinate lineFrom = getCoordinateBeforePoint(trimmingLine, intersectionPoint);
    // if it happened that the intersection point is the starting point of
    // the trimming line
    // then lineTo is the next coordinate. Otherwise it is the intersection
View Full Code Here

      // to be over the line as it was produced by intersecting both lines
      // so we're using little buffer to determine if the point lies over the
      // segment
      Geometry lineSegment = gf.createLineString(segment);
      lineSegment = lineSegment.buffer(DELTA_DISTANCE, 2);
      Point point = gf.createPoint(pointInLine);
      Geometry intersection = lineSegment.intersection(point);
      if (point.equals(intersection)) {
        return segment[0];
      }
    }

    final String msg = MessageFormat.format(Messages.TrimGeometryStrategy_point_not_on_line, pointInLine, line);
View Full Code Here

    public void testPoint() throws Exception {
        Drawing d = Drawing.create();
        Display display = Display.getCurrent();
        GeometryFactory factory = new GeometryFactory();

        Point point = factory.createPoint(new Coordinate(7, 7));

        StyleBuilder builder = new StyleBuilder();
        Mark mark = builder.createMark(StyleBuilder.MARK_SQUARE);
        mark.setStroke(builder.createStroke(Color.BLUE));
        mark.setFill(builder.createFill(Color.BLUE));
View Full Code Here

       
        int nameIndex = csv.getHeader("name");
        Coordinate worldLocation = new Coordinate();
        String [] row;
        while ((row = reader.readNext()) != null) {
            Point point = csv.getPoint(row);
            Coordinate dataLocation = point.getCoordinate();
            try {
                JTS.transform(dataLocation, worldLocation, dataToWorld);
            } catch (TransformException e) {
                continue;
            }
View Full Code Here

    }

    @Override
    protected Geometry toCollection( Geometry geometry ) {
        if( geometry instanceof Point ){
            Point point=(Point) geometry;
            GeometryFactory factory=point.getFactory();
            return factory.createMultiPoint(new Point[]{point});
        }
        return geometry;
    }
View Full Code Here

      throws Exception
  {
    // create a factory using default values (e.g. floating precision)
    GeometryFactory fact = new GeometryFactory();

    Point p1 = fact.createPoint(new Coordinate(0,0));
    System.out.println(p1);

    Point p2 = fact.createPoint(new Coordinate(1,1));
    System.out.println(p2);

    MultiPoint mpt = fact.createMultiPoint(new Coordinate[] { new Coordinate(0,0), new Coordinate(1,1) } );
    System.out.println(mpt);
View Full Code Here

TOP

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

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.