Package org.geotools.graph.traverse.standard.DijkstraIterator

Examples of org.geotools.graph.traverse.standard.DijkstraIterator.EdgeWeighter


        Node source = nodeHelper.getNearestGraphNode(lineStringGen, networkGraph, originPoint, coordinateReferenceSystem);
        //distance between the origin location and the nearest graph node
        distanceOriginToGraph = nodeHelper.getDistanceFromGraphNode();

        //weight the edges of the graph using the distance of each linestring
        EdgeWeighter edgeWeighter = new EdgeWeighter() {
            public double getWeight(org.geotools.graph.structure.Edge edge) {
                SimpleFeature aLineString = (SimpleFeature) edge.getObject();
                Geometry geom = (Geometry) aLineString.getDefaultGeometry();
                return geom.getLength();
            }
View Full Code Here

TOP

Related Classes of org.geotools.graph.traverse.standard.DijkstraIterator.EdgeWeighter

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.