Package com.vividsolutions.jts.linearref

Examples of com.vividsolutions.jts.linearref.LocationIndexedLine.project()


              for(TripPatternStop patternStop : patternStops) {
               
               
                Point p = (Point) JTS.transform(patternStop.stop.locationPoint(), mt);
               
                LinearLocation l = indexLine.project(p.getCoordinate());
                patternStop.defaultDistance = LengthLocationMap.getLength(ls, l);
                patternStop.save();
              }
            }
           
View Full Code Here


                LocationIndexedLine indexedRoute = new LocationIndexedLine(routeGeometry);

                // FIXME: it would be better to do this project/indexOfAfter in one step
                // as the two-step version could snap to a bad place and be unable to escape.

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

                if (routeProjectedEndIndex.compareTo(routeIndex) <= 0) {
                    try {
View Full Code Here

                double travelAlongOldEdge = distanceAlongGeometry(edgeGeometry, edgeIndex, null);

                for (Edge e : getOutgoingMatchableEdges(toVertex)) {
                    Geometry newEdgeGeometry = e.getGeometry();
                    LocationIndexedLine newIndexedEdge = new LocationIndexedLine(newEdgeGeometry);
                    newEdgeIndex = newIndexedEdge.project(newRouteCoord);
                    Coordinate newEdgeCoord = newEdgeIndex.getCoordinate(newEdgeGeometry);
                    positionError = distance(newEdgeCoord, newRouteCoord);
                    travelAlongEdge = travelAlongOldEdge + distanceAlongGeometry(newEdgeGeometry, new LinearLocation(), newEdgeIndex);
                    travelError = Math.abs(travelAlongRoute - travelAlongEdge);
View Full Code Here

        // compute initial states
        for (Edge initialEdge : nearbyEdges) {
            Geometry edgeGeometry = initialEdge.getGeometry();
           
            LocationIndexedLine indexedEdge = new LocationIndexedLine(edgeGeometry);
            LinearLocation initialLocation = indexedEdge.project(routeStartCoordinate);
           
            double error = MatchState.distance(initialLocation.getCoordinate(edgeGeometry), routeStartCoordinate);
            MidblockMatchState state = new MidblockMatchState(null, routeGeometry, initialEdge, startIndex, initialLocation, error, 0.01);
            states.insert(state, 0); //make sure all initial states are visited by inserting them at 0
        }
View Full Code Here

        Expression lineExpression = parameters.get(1);
        Geometry line = lineExpression.evaluate(object, Geometry.class);
   
        LocationIndexedLine index = new LocationIndexedLine(line);
   
        LinearLocation location = index.project(point.getCoordinate());
   
        Coordinate snap = index.extractPoint(location);
   
        Point pt = point.getFactory().createPoint(snap);
   
View Full Code Here

    while (records.hasNext()) {
      SpatialDatabaseRecord record = records.next();
      Geometry geom = record.getGeometry();
      if (geom instanceof LineString) {
        LocationIndexedLine line = new LocationIndexedLine(geom);
        LinearLocation here = line.project(point.getCoordinate());
        Coordinate snap = line.extractPoint(here);
        double distance = snap.distance(point.getCoordinate());
        results.add(new PointResult(layer.getGeometryFactory()
            .createPoint(snap), record, distance));
      } else if (geom instanceof Point) {
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.