congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
AllEdgesIterator.copyPropertiesTo
Code IndexAdd Tabnine to your IDE (free)

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

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

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: 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.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-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.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.utilAllEdgesIteratorcopyPropertiesTo

Popular methods of AllEdgesIterator

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

Popular in Java

  • Making http requests using okhttp
  • setContentView (Activity)
  • setScale (BigDecimal)
  • setRequestProperty (URLConnection)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now