[Routing] Tools for getting from OSM to a routable network
Geoff Leyland
geoff_leyland at fastmail.fm
Fri Sep 26 03:49:32 UTC 2014
Hi Nic,
On 23/09/2014, at 6:09 pm, Nic Roets <nroets at gmail.com> wrote:
> AFAIK, Hilbert curves require n iterations for n bits. Morton codes require only log(n) iterations for n bits (Not as a computer scientist, but from the point of few of an x86 hacker). But the encoding speed is not really important as it's not needed inside the routing loop.
>
> Here is my current encoder, (there certainly will be faster code on the web):
> uint64_t hilbert_order (uint32_t x, uint32_t y)
> {
> uint64_t h = 0, m = ((uint64_t) x << 32) | y;
> uint64_t s = m ^ (((uint64_t)y << 32) | x), nots = ~s;
> #define G(z) \
> if ((1ULL<<(z+32))&m) h |= ((1U<<z) & m) ? 2ULL<<(z+z) : 1ULL<<(z+z); \
> else if ((1U<<z) & m) { h |= 3ULL<<(z+z); m ^= nots; } else m ^= s;
> G(31) G(30) G(29) G(28) G(27) G(26) G(25) G(24) G(23) G(22) G(21) G(20)
> G(19) G(18) G(17) G(16) G(15) G(14) G(13) G(12) G(11) G(10) G( 9) G( 8)
> G( 7) G( 6) G( 5) G( 4) G( 3) G( 2) G( 1) G( 0)
> #undef G
> return h;
> }
Is this in the Gosmore repository? I can’t find it anywhere. As you say, time isn’t critical at this end of the workflow.
> So my storage format is very close to the underlying OSM data. it would relatively easy for me to earn Frederick badge for realtime updates. But I already have enough badges.
So is it that the “wayType *wayDetails;” in your doubleArc is not a pointer to a way, but a pointer to an object that says “this arc corresponds to this section of this way, all of this way, and the first section of a third way”?
Thanks heaps for your time!
Geoff
More information about the Routing
mailing list