<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:8pt"><div class="" style=""><span class="" style="">Thanks for the snippet Diego. I did not know about this possibility. I already got the blacklist running with the extended storage, if you are interested it is on </span><a href="https://github.com/brunesto/graphhopper" class="" style="background-color: rgb(255, 255, 255); font-size: 8pt;">https://github.com/brunesto/graphhopper</a><span style="font-size: 8pt;" class=""> . The code has some additional changes in the base classes, mainly to support multiple extended storages.</span></div><div class="" style="color: rgb(0, 0, 0); font-size: 8pt; font-family: 'Courier New', courier, monaco, monospace, sans-serif; background-color: transparent; font-style: normal;"><span style="font-size: 8pt;" class=""><br></span></div><div class="" style="color: rgb(0, 0, 0); font-size:
 11px; font-family: 'Courier New', courier, monaco, monospace, sans-serif; background-color: transparent; font-style: normal;"><span style="font-size: 8pt;" class="">Bruno</span></div><div class="" style="background-color: transparent;"><br class="" style=""></div><div class="" style="color: rgb(0, 0, 0); font-size: 11px; font-family: 'Courier New', courier, monaco, monospace, sans-serif; background-color: transparent; font-style: normal;"><br class="" style=""></div><div class="" style="color: rgb(0, 0, 0); font-size: 11px; font-family: 'Courier New', courier, monaco, monospace, sans-serif; background-color: transparent; font-style: normal;"><br class="" style=""></div>  <div style="font-family: Courier New, courier, monaco, monospace, sans-serif; font-size: 8pt;" class=""> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;" class=""> <div dir="ltr" class="" style=""> <hr size="1"
 class="" style="">  <font size="2" face="Arial" class="" style=""> <b class="" style=""><span style="font-weight:bold;" class="">From:</span></b> Diego Guidi <diegoguidi@gmail.com><br class="" style=""> <b class="" style=""><span style="font-weight: bold;" class="">To:</span></b> Bruno Carle <brunocarle@yahoo.com>; GraphHopper Java routing engine <graphhopper@openstreetmap.org> <br class="" style=""> <b class="" style=""><span style="font-weight: bold;" class="">Sent:</span></b> Monday, April 21, 2014 9:29 PM<br class="" style=""> <b class="" style=""><span style="font-weight: bold;" class="">Subject:</span></b> Re: [GraphHopper] ExtendedStorage for OSM ids<br class="" style=""> </font> </div> <div class="" style=""><br class="" style="">On Fri, Mar 28, 2014 at 2:43 PM, Bruno Carle <<a shape="rect" ymailto="mailto:brunocarle@yahoo.com" href="mailto:brunocarle@yahoo.com" class="" style="">brunocarle@yahoo.com</a>> wrote:<br
 clear="none" class="" style="">> At the moment I would like to be able to blacklist both nodes and edges, so<br clear="none" class="" style="">> I will stick with the ExtendedStorage.<br clear="none" class="" style=""><br clear="none" class="" style="">I've made a slightly different thing.<br clear="none" class="" style="">I've created a "support map" that stores osmid for each node, using<br clear="none" class="" style="">this code (in the extended OsmReader that is similar that the one you<br clear="none" class="" style="">posted):<br clear="none" class="" style=""><br clear="none" class="" style="">  @Override<br clear="none" class="" style="">  protected boolean addNode(OSMNode node) {<br clear="none" class="" style="">    boolean added = super.addNode(node);<br clear="none" class="" style="">    if (!added) {<br clear="none" class="" style="">      return false;<br clear="none" class=""
 style="">    }<br clear="none" class="" style=""><br clear="none" class="" style="">    long osmid = node.getId();<br clear="none" class="" style="">    int graphid = this.getInternalNodeIdOfOsmNode(osmid);<br clear="none" class="" style="">    map.put(graphid, osmid);<br clear="none" class="" style="">    return true;<br clear="none" class="" style="">  }<br clear="none" class="" style=""><br clear="none" class="" style=""><br clear="none" class="" style="">The I've stored this map as an external "support file" inside graph folder:<br clear="none" class="" style=""><br clear="none" class="" style="">  private File createSupportFile() throws IOException {<br clear="none" class="" style="">    String dir = this.getGraphStorage().getDirectory().getLocation();<br clear="none" class="" style="">    File file = new File(dir + "/support");<br clear="none" class="" style=""> 
   String path = file.getAbsolutePath();<br clear="none" class="" style="">    if (file.exists()) {<br clear="none" class="" style="">      file.delete();<br clear="none" class="" style="">    }<br clear="none" class="" style="">    if (!file.createNewFile()) {<br clear="none" class="" style="">      throw new IllegalStateException("file not created: " + path);<br clear="none" class="" style="">    }<br clear="none" class="" style=""><br clear="none" class="" style="">    String newline = System.getProperty("line.separator");<br clear="none" class="" style="">    Writer fw = new FileWriter(file);<br clear="none" class="" style="">    BufferedWriter bw = new BufferedWriter(fw);<div class="" id="yqtfd10625" style=""><br clear="none" class="" style="">    try {</div><br clear="none" class="" style="">      for (Integer key :
 map.keySet()) {<br clear="none" class="" style="">        Long val = map.get(key);<br clear="none" class="" style="">        bw.write(String.format("%d|%d%s", key, val, newline));<br clear="none" class="" style="">      }<br clear="none" class="" style="">    } finally {<br clear="none" class="" style="">      bw.close();<br clear="none" class="" style="">    }<br clear="none" class="" style="">    return file;<br clear="none" class="" style="">  }<br clear="none" class="" style=""><br clear="none" class="" style="">Pretty unelegant (ExtendedStorage is the right way to do things, I<br clear="none" class="" style="">suppose) but simple and well working for small graphs (my osm source<br clear="none" class="" style="">file is 22mb).<br clear="none" class="" style=""><br clear="none" class="" style="">Hope this can help someone.<br clear="none" class=""
 style=""><br clear="none" class="" style=""><br clear="none" class="" style="">Diego Guidi<div class="" id="yqtfd17499" style=""><br clear="none" class="" style=""></div><br class="" style=""><br class="" style=""></div> </div> </div>  </div></body></html>