Codota Logo
AllEdgesIterator.getAdjNode
Code IndexAdd Codota to your IDE (free)

How to use
getAdjNode
method
in
com.graphhopper.routing.util.AllEdgesIterator

Best Java code snippets using com.graphhopper.routing.util.AllEdgesIterator.getAdjNode (Showing top 20 results out of 315)

  • Common ways to obtain AllEdgesIterator
private void myMethod () {
AllEdgesIterator a =
  • Codota IconGraph graph;graph.getAllEdges()
  • Codota IconGraphHopperStorage graphHopperStorage;graphHopperStorage.getAllEdges()
  • Codota IconBaseGraph baseGraph;baseGraph.getAllEdges()
  • Smart code suggestions by Codota
}
origin: graphhopper/graphhopper

public static void printGraphForUnitTest(Graph g, FlagEncoder encoder, BBox bBox) {
  NodeAccess na = g.getNodeAccess();
  for (int node = 0; node < g.getNodes(); ++node) {
    if (bBox.contains(na.getLat(node), na.getLon(node))) {
      System.out.printf(Locale.ROOT, "na.setNode(%d, %f, %f);\n", node, na.getLat(node), na.getLon(node));
    }
  }
  AllEdgesIterator iter = g.getAllEdges();
  while (iter.next()) {
    if (bBox.contains(na.getLat(iter.getBaseNode()), na.getLon(iter.getBaseNode())) &&
        bBox.contains(na.getLat(iter.getAdjNode()), na.getLon(iter.getAdjNode()))) {
      printUnitTestEdge(encoder, iter);
    }
  }
}
origin: graphhopper/graphhopper

double lat = na.getLatitude(nodeIndex);
double lon = na.getLongitude(nodeIndex);
int nodeId = edge.getAdjNode();
double lat2 = na.getLatitude(nodeId);
double lon2 = na.getLongitude(nodeId);
origin: graphhopper/graphhopper

/**
 * This method makes edges crossing the specified border inaccessible to split a bigger area into smaller subnetworks.
 * This is important for the world wide use case to limit the maximum distance and also to detect unreasonable routes faster.
 */
protected IntHashSet findBorderEdgeIds(SpatialRuleLookup ruleLookup) {
  AllEdgesIterator allEdgesIterator = graph.getAllEdges();
  NodeAccess nodeAccess = graph.getNodeAccess();
  IntHashSet inaccessible = new IntHashSet();
  while (allEdgesIterator.next()) {
    int adjNode = allEdgesIterator.getAdjNode();
    SpatialRule ruleAdj = ruleLookup.lookupRule(nodeAccess.getLatitude(adjNode), nodeAccess.getLongitude(adjNode));
    int baseNode = allEdgesIterator.getBaseNode();
    SpatialRule ruleBase = ruleLookup.lookupRule(nodeAccess.getLatitude(baseNode), nodeAccess.getLongitude(baseNode));
    if (ruleAdj != ruleBase) {
      inaccessible.add(allEdgesIterator.getEdge());
    }
  }
  return inaccessible;
}
origin: graphhopper/graphhopper

  node = iter.getBaseNode();
} else {
  node = iter.getAdjNode();
origin: graphhopper/graphhopper

  node = iter.getBaseNode();
} else {
  node = iter.getAdjNode();
  continue;
int toNode = iter.getAdjNode();
double toLat = nodeAccess.getLatitude(toNode);
double toLon = nodeAccess.getLongitude(toNode);
origin: graphhopper/graphhopper

/**
 * @return the specified toGraph which is now filled with data from fromGraph
 */
// TODO very similar to createSortedGraph -> use a 'int map(int)' interface
public static Graph copyTo(Graph fromGraph, Graph toGraph) {
  AllEdgesIterator eIter = fromGraph.getAllEdges();
  while (eIter.next()) {
    int base = eIter.getBaseNode();
    int adj = eIter.getAdjNode();
    eIter.copyPropertiesTo(toGraph.edge(base, adj));
  }
  NodeAccess fna = fromGraph.getNodeAccess();
  NodeAccess tna = toGraph.getNodeAccess();
  int nodes = fromGraph.getNodes();
  for (int node = 0; node < nodes; node++) {
    if (tna.is3D())
      tna.setNode(node, fna.getLatitude(node), fna.getLongitude(node), fna.getElevation(node));
    else
      tna.setNode(node, fna.getLatitude(node), fna.getLongitude(node));
  }
  return toGraph;
}
origin: graphhopper/graphhopper

static Graph createSortedGraph(Graph fromGraph, Graph toSortedGraph, final IntIndexedContainer oldToNewNodeList) {
  AllEdgesIterator eIter = fromGraph.getAllEdges();
  while (eIter.next()) {
    int base = eIter.getBaseNode();
    int newBaseIndex = oldToNewNodeList.get(base);
    int adj = eIter.getAdjNode();
    int newAdjIndex = oldToNewNodeList.get(adj);
    // ignore empty entries
    if (newBaseIndex < 0 || newAdjIndex < 0)
      continue;
    eIter.copyPropertiesTo(toSortedGraph.edge(newBaseIndex, newAdjIndex));
  }
  int nodes = fromGraph.getNodes();
  NodeAccess na = fromGraph.getNodeAccess();
  NodeAccess sna = toSortedGraph.getNodeAccess();
  for (int old = 0; old < nodes; old++) {
    int newIndex = oldToNewNodeList.get(old);
    if (sna.is3D())
      sna.setNode(newIndex, na.getLatitude(old), na.getLongitude(old), na.getElevation(old));
    else
      sna.setNode(newIndex, na.getLatitude(old), na.getLongitude(old));
  }
  return toSortedGraph;
}
origin: graphhopper/graphhopper

assertEquals(iter.getAdjNode(), eState2.getBaseNode());
assertEquals(iter.getBaseNode(), eState2.getAdjNode());
assertFalse(iter.next());
origin: com.graphhopper/graphhopper-core

public static void printGraphForUnitTest(Graph g, FlagEncoder encoder, BBox bBox) {
  NodeAccess na = g.getNodeAccess();
  for (int node = 0; node < g.getNodes(); ++node) {
    if (bBox.contains(na.getLat(node), na.getLon(node))) {
      System.out.printf(Locale.ROOT, "na.setNode(%d, %f, %f);\n", node, na.getLat(node), na.getLon(node));
    }
  }
  AllEdgesIterator iter = g.getAllEdges();
  while (iter.next()) {
    if (bBox.contains(na.getLat(iter.getBaseNode()), na.getLon(iter.getBaseNode())) &&
        bBox.contains(na.getLat(iter.getAdjNode()), na.getLon(iter.getAdjNode()))) {
      printUnitTestEdge(encoder, iter);
    }
  }
}
origin: com.rgi-corp/graphhopper

/**
 * This method makes edges crossing the specified border inaccessible to split a bigger area into smaller subnetworks.
 * This is important for the world wide use case to limit the maximum distance and also to detect unreasonable routes faster.
 */
protected IntHashSet findBorderEdgeIds(SpatialRuleLookup ruleLookup) {
  AllEdgesIterator allEdgesIterator = graph.getAllEdges();
  NodeAccess nodeAccess = graph.getNodeAccess();
  IntHashSet inaccessible = new IntHashSet();
  while (allEdgesIterator.next()) {
    int adjNode = allEdgesIterator.getAdjNode();
    SpatialRule ruleAdj = ruleLookup.lookupRule(nodeAccess.getLatitude(adjNode), nodeAccess.getLongitude(adjNode));
    int baseNode = allEdgesIterator.getBaseNode();
    SpatialRule ruleBase = ruleLookup.lookupRule(nodeAccess.getLatitude(baseNode), nodeAccess.getLongitude(baseNode));
    if (ruleAdj != ruleBase)
      inaccessible.add(allEdgesIterator.getEdge());
  }
  return inaccessible;
}
origin: com.graphhopper/graphhopper-core

/**
 * This method makes edges crossing the specified border inaccessible to split a bigger area into smaller subnetworks.
 * This is important for the world wide use case to limit the maximum distance and also to detect unreasonable routes faster.
 */
protected IntHashSet findBorderEdgeIds(SpatialRuleLookup ruleLookup) {
  AllEdgesIterator allEdgesIterator = graph.getAllEdges();
  NodeAccess nodeAccess = graph.getNodeAccess();
  IntHashSet inaccessible = new IntHashSet();
  while (allEdgesIterator.next()) {
    int adjNode = allEdgesIterator.getAdjNode();
    SpatialRule ruleAdj = ruleLookup.lookupRule(nodeAccess.getLatitude(adjNode), nodeAccess.getLongitude(adjNode));
    int baseNode = allEdgesIterator.getBaseNode();
    SpatialRule ruleBase = ruleLookup.lookupRule(nodeAccess.getLatitude(baseNode), nodeAccess.getLongitude(baseNode));
    if (ruleAdj != ruleBase) {
      inaccessible.add(allEdgesIterator.getEdge());
    }
  }
  return inaccessible;
}
origin: com.graphhopper/graphhopper-core

  node = iter.getBaseNode();
} else {
  node = iter.getAdjNode();
origin: com.rgi-corp/graphhopper

  node = iter.getBaseNode();
} else {
  node = iter.getAdjNode();
origin: com.graphhopper/graphhopper

} else
  node = iter.getAdjNode();
origin: com.graphhopper/graphhopper-core

/**
 * @return the specified toGraph which is now filled with data from fromGraph
 */
// TODO very similar to createSortedGraph -> use a 'int map(int)' interface
public static Graph copyTo(Graph fromGraph, Graph toGraph) {
  AllEdgesIterator eIter = fromGraph.getAllEdges();
  while (eIter.next()) {
    int base = eIter.getBaseNode();
    int adj = eIter.getAdjNode();
    eIter.copyPropertiesTo(toGraph.edge(base, adj));
  }
  NodeAccess fna = fromGraph.getNodeAccess();
  NodeAccess tna = toGraph.getNodeAccess();
  int nodes = fromGraph.getNodes();
  for (int node = 0; node < nodes; node++) {
    if (tna.is3D())
      tna.setNode(node, fna.getLatitude(node), fna.getLongitude(node), fna.getElevation(node));
    else
      tna.setNode(node, fna.getLatitude(node), fna.getLongitude(node));
  }
  return toGraph;
}
origin: com.rgi-corp/graphhopper

/**
 * @return the specified toGraph which is now filled with data from fromGraph
 */
// TODO very similar to createSortedGraph -> use a 'int map(int)' interface
public static Graph copyTo(Graph fromGraph, Graph toGraph) {
  AllEdgesIterator eIter = fromGraph.getAllEdges();
  while (eIter.next()) {
    int base = eIter.getBaseNode();
    int adj = eIter.getAdjNode();
    eIter.copyPropertiesTo(toGraph.edge(base, adj));
  }
  NodeAccess fna = fromGraph.getNodeAccess();
  NodeAccess tna = toGraph.getNodeAccess();
  int nodes = fromGraph.getNodes();
  for (int node = 0; node < nodes; node++) {
    if (tna.is3D())
      tna.setNode(node, fna.getLatitude(node), fna.getLongitude(node), fna.getElevation(node));
    else
      tna.setNode(node, fna.getLatitude(node), fna.getLongitude(node));
  }
  return toGraph;
}
origin: com.graphhopper/graphhopper

/**
 * @return the specified toGraph which is now filled with data from fromGraph
 */
// TODO very similar to createSortedGraph -> use a 'int map(int)' interface
public static Graph copyTo( Graph fromGraph, Graph toGraph )
{
  AllEdgesIterator eIter = fromGraph.getAllEdges();
  while (eIter.next())
  {
    int base = eIter.getBaseNode();
    int adj = eIter.getAdjNode();
    eIter.copyPropertiesTo(toGraph.edge(base, adj));
  }
  NodeAccess fna = fromGraph.getNodeAccess();
  NodeAccess tna = toGraph.getNodeAccess();
  int nodes = fromGraph.getNodes();
  for (int node = 0; node < nodes; node++)
  {
    if (tna.is3D())
      tna.setNode(node, fna.getLatitude(node), fna.getLongitude(node), fna.getElevation(node));
    else
      tna.setNode(node, fna.getLatitude(node), fna.getLongitude(node));
  }
  return toGraph;
}
origin: com.graphhopper/graphhopper-core

static Graph createSortedGraph(Graph fromGraph, Graph toSortedGraph, final IntIndexedContainer oldToNewNodeList) {
  AllEdgesIterator eIter = fromGraph.getAllEdges();
  while (eIter.next()) {
    int base = eIter.getBaseNode();
    int newBaseIndex = oldToNewNodeList.get(base);
    int adj = eIter.getAdjNode();
    int newAdjIndex = oldToNewNodeList.get(adj);
    // ignore empty entries
    if (newBaseIndex < 0 || newAdjIndex < 0)
      continue;
    eIter.copyPropertiesTo(toSortedGraph.edge(newBaseIndex, newAdjIndex));
  }
  int nodes = fromGraph.getNodes();
  NodeAccess na = fromGraph.getNodeAccess();
  NodeAccess sna = toSortedGraph.getNodeAccess();
  for (int old = 0; old < nodes; old++) {
    int newIndex = oldToNewNodeList.get(old);
    if (sna.is3D())
      sna.setNode(newIndex, na.getLatitude(old), na.getLongitude(old), na.getElevation(old));
    else
      sna.setNode(newIndex, na.getLatitude(old), na.getLongitude(old));
  }
  return toSortedGraph;
}
origin: com.rgi-corp/graphhopper

static Graph createSortedGraph(Graph fromGraph, Graph toSortedGraph, final IntIndexedContainer oldToNewNodeList) {
  AllEdgesIterator eIter = fromGraph.getAllEdges();
  while (eIter.next()) {
    int base = eIter.getBaseNode();
    int newBaseIndex = oldToNewNodeList.get(base);
    int adj = eIter.getAdjNode();
    int newAdjIndex = oldToNewNodeList.get(adj);
    // ignore empty entries
    if (newBaseIndex < 0 || newAdjIndex < 0)
      continue;
    eIter.copyPropertiesTo(toSortedGraph.edge(newBaseIndex, newAdjIndex));
  }
  int nodes = fromGraph.getNodes();
  NodeAccess na = fromGraph.getNodeAccess();
  NodeAccess sna = toSortedGraph.getNodeAccess();
  for (int old = 0; old < nodes; old++) {
    int newIndex = oldToNewNodeList.get(old);
    if (sna.is3D())
      sna.setNode(newIndex, na.getLatitude(old), na.getLongitude(old), na.getElevation(old));
    else
      sna.setNode(newIndex, na.getLatitude(old), na.getLongitude(old));
  }
  return toSortedGraph;
}
origin: com.graphhopper/graphhopper

static Graph createSortedGraph( Graph fromGraph, Graph toSortedGraph, final TIntList oldToNewNodeList )
{
  AllEdgesIterator eIter = fromGraph.getAllEdges();
  while (eIter.next())
  {
    int base = eIter.getBaseNode();
    int newBaseIndex = oldToNewNodeList.get(base);
    int adj = eIter.getAdjNode();
    int newAdjIndex = oldToNewNodeList.get(adj);
    // ignore empty entries
    if (newBaseIndex < 0 || newAdjIndex < 0)
      continue;
    eIter.copyPropertiesTo(toSortedGraph.edge(newBaseIndex, newAdjIndex));
  }
  int nodes = fromGraph.getNodes();
  NodeAccess na = fromGraph.getNodeAccess();
  NodeAccess sna = toSortedGraph.getNodeAccess();
  for (int old = 0; old < nodes; old++)
  {
    int newIndex = oldToNewNodeList.get(old);
    if (sna.is3D())
      sna.setNode(newIndex, na.getLatitude(old), na.getLongitude(old), na.getElevation(old));
    else
      sna.setNode(newIndex, na.getLatitude(old), na.getLongitude(old));
  }
  return toSortedGraph;
}
com.graphhopper.routing.utilAllEdgesIteratorgetAdjNode

Popular methods of AllEdgesIterator

  • getBaseNode
  • next
  • detach
  • length
  • copyPropertiesTo
  • getEdge
  • isBackward
  • isForward
  • getFlags
  • getMaxId
  • getDistance
  • setFlags
  • getDistance,
  • setFlags

Popular in Java

  • Start an intent from android
  • setContentView (Activity)
  • findViewById (Activity)
  • getExternalFilesDir (Context)
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now