<div dir="ltr">It doesn't look like PhantomNode's forward_node_id and reverse_node_id are indexes into InternalDataFacade's m_coordinate_list (and hence the m_osmnodeid_list I created). When I look up forward_node_id/reverse_node_id I get OSM nodes that are far away from the query point. (PhantomNode.name_id and PhantomNode.location *are* set correctly however).<div><br></div><div>So I should probably follow Patrick's suggestion and have a separate loop that reads the .nodes file? Does the .nodes file contain ExternalMemoryNodes or QueryNodes? (graph_loader.hpp reads one and internal_datafacade.hpp reads the other, although it won't matter if the two structs have the same size due to padding).</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 1, 2016 at 9:25 AM, Daniel Patterson <span dir="ltr"><<a href="mailto:daniel@mapbox.com" target="_blank">daniel@mapbox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hi Kerrick,</div><div><br></div><div> Yup, the node ids are renumbered to pack them more densely and ensure that values fit inside an unsigned int (32 bits).</div><div><br></div><div> The mapping *is* written to the `.nodes` file though, here:</div><div><br></div><div><a href="https://github.com/Project-OSRM/osrm-backend/blob/d189339495e223a6ceea21a73bb7e434775172fa/src/extractor/extractor.cpp#L550-L561" target="_blank">https://github.com/Project-OSRM/osrm-backend/blob/d189339495e223a6ceea21a73bb7e434775172fa/src/extractor/extractor.cpp#L550-L561</a></div><div><br></div><div> when this file is later read, we only load the coordinates from it, so the OSM values are there, but not used:</div><div><br></div><div><a href="https://github.com/Project-OSRM/osrm-backend/blob/d189339495e223a6ceea21a73bb7e434775172fa/include/engine/datafacade/internal_datafacade.hpp#L116-L129" target="_blank">https://github.com/Project-OSRM/osrm-backend/blob/d189339495e223a6ceea21a73bb7e434775172fa/include/engine/datafacade/internal_datafacade.hpp#L116-L129</a></div><div><br></div><div> here, you could add the OSM node values to a new array, then you'd have the lookup table you need to map the NodeIDs you have to the original OSM values.</div><div><br></div><div> This will require extra RAM, which may or may not be a problem for you.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>daniel</div><div> </div><br></font></span><div><blockquote type="cite"><div><div class="h5"><div>On Feb 1, 2016, at 9:03 AM, Kerrick Staley <<a href="mailto:kstaley@lyft.com" target="_blank">kstaley@lyft.com</a>> wrote:</div><br></div></div><div><div><div class="h5"><p dir="ltr">I want to create a binary that will take an input lat/long and give the two OSMNodeIDs representing the nearest road segment. I was able to hack something together using NearestPhantomNodes in the OSRM codebase, but I can't figure out how to go from the NodeIDs in the PhantomNode to OSMNodeIDs.</p><p dir="ltr">It looks like the NodeID -> OSMNodeID mapping is dropped in osrm-extract/osrm-prepare. Is this the case? Can I use the .osrm or .osrm.nodes file to re-build the mapping?</p><p dir="ltr">Thanks,<br>
Kerrick</p></div></div>
_______________________________________________<span class=""><br>OSRM-talk mailing list<br><a href="mailto:OSRM-talk@openstreetmap.org" target="_blank">OSRM-talk@openstreetmap.org</a><br><a href="https://lists.openstreetmap.org/listinfo/osrm-talk" target="_blank">https://lists.openstreetmap.org/listinfo/osrm-talk</a><br></span></div></blockquote></div><br></div><br>_______________________________________________<br>
OSRM-talk mailing list<br>
<a href="mailto:OSRM-talk@openstreetmap.org">OSRM-talk@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/osrm-talk" rel="noreferrer" target="_blank">https://lists.openstreetmap.org/listinfo/osrm-talk</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">- Kerrick</div></div>
</div>