Package com.vividsolutions.jts.linearref

Examples of com.vividsolutions.jts.linearref.LinearLocation.compareTo()


            // now we want to see where this new point is in terms of the edge's geometry
            Coordinate newRouteCoord = routeSuccessor.getCoordinate(routeGeometry);
            LinearLocation newEdgeIndex = indexedEdge.project(newRouteCoord);

            Coordinate edgeCoord = newEdgeIndex.getCoordinate(edgeGeometry);
            if (newEdgeIndex.compareTo(edgeIndex) <= 0) {
                // we must make forward progress along the edge... or go to the next edge
                /* this should not require the try/catch, but there is a bug in JTS */
                try {
                    LinearLocation projected2 = indexedEdge.indexOfAfter(edgeCoord, edgeIndex);
                    //another bug in JTS
View Full Code Here


                LinearLocation routeProjectedEndIndex = indexedRoute.project(endCoord);
                Coordinate routeProjectedEndCoord = routeProjectedEndIndex
                        .getCoordinate(routeGeometry);

                if (routeProjectedEndIndex.compareTo(routeIndex) <= 0) {
                    try {
                        routeProjectedEndIndex = indexedRoute.indexOfAfter(routeProjectedEndCoord,
                                routeIndex);
                        if (Double.isNaN(routeProjectedEndIndex.getSegmentFraction())) {
                            // can't go forward
View Full Code Here

        LinearLocation index = startIndex;
        Coordinate previousCoordinate = startIndex.getCoordinate(geometry);

        it.next();
        index = it.getLocation();
        while (index.compareTo(endIndex) < 0) {
            Coordinate thisCoordinate = index.getCoordinate(geometry);
            double distance = distanceLibrary.fastDistance(previousCoordinate, thisCoordinate);
            total += distance;
            previousCoordinate = thisCoordinate;
            if (!it.hasNext())
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.