wanna-be •I think I have a little Prosopagnosia (Face-blindness) (臉盲症) •Wanna see what’s like to be one? •http://tinyurl.com/mlesk4n •OSM newbie (and probably will be for a long time) A little about myself
offline viewing (at least not on iOS) •Can’t store requested Google map Point of Interests (POIs). •Can’t save routes and directions for query •No real time navigation allowed
best path? • The easy answer is: try it all and then get the best (or shortest) one. • There is Dijkstra’s algorithm. Really, it tries everything from origin to destination, just efficiently. We’ll leave it as that. ?
level Say, 12 to 15. ! You need to be careful with tiles. With each increase in level, you get more tiles then you all prior lower zoom levels combined! ! At the maximum zoom level (20), the whole world is a square of 262,144 screens wide and 262,144 screens tall (assuming a screen is 1024 resolution in width and height)
= MBTilesBuilder(filepath='output.mbtiles', tiles_url='http://tile.stamen.com/watercolor/{z}/{x}/ {y}.jpg') mb.add_coverage(bbox=(-122.1099,37.4531,-121.8768,37.6107), zoomlevels=range(12, 16)) mb.run() If no URL given, it’ll just grab from the official OpenStreetMaps server. Guarantee ugly tiles (sorry, OSM), but easy peasy. Python script to get images from server
IP and port and expose it ! ! ! ! ! •Trust the connection to the database to my computer In /var/lib/postgresql/data/postgresql.conf In /var/lib/postgresql/data/pg_hba.conf
lines of stylesheet to make this! •I can’t find any editors for it. •Documents are also difficult to come by •Someone wrote a pdf explaining version 0.7 (it’s 2.2.0 now?) and seems difficult but understandable
landez import MBTilesBuilder ! mb = MBTilesBuilder(stylefile="yourstyle.xml") mb.add_coverage(bbox=(-122.1099,37.4531,-121.8768,37.6107), zoomlevels=range(12, 16)) mb.run() Get XML from server using the bounding box and zoom range Watch out for bugs, though
data •Uses Mapnik to generate tiles internally. •Generate MBTiles directly •Takes a CSS-like stylesheet called Carto (derived from Cascadenik) WYSIWYG editor
OSM data into map images. ! •One way is to just grab tiles from others using Landez. ! •The other way is to generate ourselves. •You can either use Mapnik directly, or Landez, or Cascadenik •Or uses TileMill which renders using… Mapnik.
Map images offline map & routing •Starting with iOS 7, MapKit itself supports tiles with MKTileOverLay and can completely tell it not to load Apple’s map.
including street, bus route, each with a different “cost” for shortest path computation Data parsing, database creation, graph creation, human-readable narratives
GraphServer uses… •Well, almost. Except I am too smart for that, I uses SpatiaLite •Compiling SpatiaLite to iOS, and use FMDB to interface it •Sometimes work, sometimes not (may be my own fault) GraphServer calls this “OSMDB”, stores the node and way information OSMDB
narratives? 52978580 52978515 32817060 32816488 52978591 “Start at Herschel Ave. Turn right on Torrey Pines Rd. Turn left on Girard Ave. Slight right onto Forward St. Straight to Market St. Arrive at destination.”
52978515 32817060 32816488 52978591 GDB GDB is only stores ID numbers of nodes and edges. And it doesn’t have any human understandable information. OSMDB Hi! Me!