Package org.openstreetmap.josm.data.coor

Examples of org.openstreetmap.josm.data.coor.EastNorth.distance()


            for (Pair<Node, Node> chunk : streetPart.getNodePairs(false)) {
                EastNorth p1 = chunk.a.getEastNorth();
                EastNorth p2 = chunk.b.getEastNorth();
                if (p1 != null && p2 != null) {
                    EastNorth closest = Geometry.closestPointToSegment(p1, p2, centroid);
                    if (closest.distance(centroid) <= maxDistance) {
                        return;
                    }
                } else {
                    Main.warn("Addresses test skipped chunck "+chunk+" for street part "+streetPart+" because p1 or p2 is null");
                }
View Full Code Here


        EastNorth resultCandidate = Geometry.getLineLineIntersection(sp1, sp2,
                ap, ap2);

        // Filtering result
        if (resultCandidate != null
                && resultCandidate.distance(sp1) * .999 < segmentLenght
                && resultCandidate.distance(sp2) * .999 < segmentLenght) {
            return resultCandidate;
        } else {
            return null;
        }
View Full Code Here

                ap, ap2);

        // Filtering result
        if (resultCandidate != null
                && resultCandidate.distance(sp1) * .999 < segmentLenght
                && resultCandidate.distance(sp2) * .999 < segmentLenght) {
            return resultCandidate;
        } else {
            return null;
        }
    }
View Full Code Here

            if (movement == null) {
                //if direction parallel to segment.
                continue;
            }

            double distanceFromMouseMovement = movement.distance(mouseMovement);
            if (bestDistance > distanceFromMouseMovement) {
                bestDistance = distanceFromMouseMovement;
                activeMoveDirection = direction;
                bestMovement = movement;
            }
View Full Code Here

        }

        EastNorth n1en = selectedSegment.getFirstNode().getEastNorth();
        EastNorth n2en = selectedSegment.getSecondNode().getEastNorth();
        if (n1en.distance(prevNode.getEastNorth())<1e-4 ||
            n2en.distance(nextNode.getEastNorth())<1e-4 ) {
            return false;
        }

        boolean prevSegmentParallel = Geometry.segmentsParallel(n1en, prevNode.getEastNorth(), n1en, n2en);
        boolean nextSegmentParallel = Geometry.segmentsParallel(n2en, nextNode.getEastNorth(), n1en, n2en);
View Full Code Here

                firstPosition = Geometry.closestPointToSegment(refPoint, refPoint2, firstPosition);
                secondPosition = Geometry.closestPointToSegment(refPoint, refPoint2, secondPosition);
            }

            double distanceFirst = firstPosition.distance(refPoint);
            double distanceSecond = secondPosition.distance(refPoint);
            double difference =  distanceFirst - distanceSecond;

            if (difference > 0.0) return 1;
            if (difference < 0.0) return -1;
            return 0;
View Full Code Here

                EastNorth foundPoint = n.getEastNorth();
                // project found node to snapping line
                newEN = snapHelper.getSnapPoint(foundPoint);
                // do not add new node if there is some node within snapping distance
                double tolerance = Main.map.mapView.getDist100Pixel() * toleranceMultiplier;
                if (foundPoint.distance(newEN) > tolerance) {
                    n = new Node(newEN); // point != projected, so we create new node
                    newNode = true;
                }
            } else { // n==null, no node found in clicked area
                EastNorth mouseEN = Main.map.mapView.getEastNorth(e.getX(), e.getY());
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.