City Blueprints

Posted on by Idorobots

I didn't make it on time with (car '(3)) and it's been quite a while without any updates, so let's have a quicky with a little tool I've made lately. The assignment was to load a part of the OpenStreetMap and give the good ol' Dijkstra a spin in it, pretty simple yet quite fun.

I figured it would look nicer with some sweet GUI so... I didn't make any. Instead, I went with some minimal OpenGL window and a buncha' lines and squares. Still cool, right? I called it City Blueprints and you can get it here (the page has been deleted since I graduated). Some screenshots follow.

Simple graph of a small town:

cityblue.png City Blueprints shows a way from where you are ATM ("You are here.") to wherever you wish to go. Select starting node with RMB and end node with LMB.

Krakow, Poland: 1

Works fine for bigger maps too.

More Krakow, Poland: 2

Although it sometimes may be a little slow. O(N*logN*my_sloppy_implementation_factor) after all.

Krakow yet again: 3

You can scale the map. Simply use the scroll wheel.

JFK's airport, NY: 4

You can drag stuff too, just hold LMB or MMB and move arround.

Some technical details

City Blueprints is written in the D programming language. It uses GLFW 2.7 for OpenGL context and input handling as well as a quick hack of FTGL for font rendering (I didn't feel like fixing old D bindings nor writing new ones, so I wrapped a few C++ FTGL classes in C and then in D functions and... Yo dawg, I heard you like wrappings...).You need to export a piece of OpenStreetMap to an XML using their exporting utility, or use the planet.osm they provide.City Blueprints uses a simple XML parser, so there's no memory wastage and it's quite fast.To open other .osm files simply run City Blueprints binary with the filename as a parameter. Ha, ha, I'm lazy.Lastly, path lengths totally rape geographic good taste and whatnot.

Deal with it, I'm not a geograpist or anything...

consternation

Wait, I didn't–

awkward silence

2016-02-20: Adjusted some links & tags.