Getting Started Developing With OpenStreetMap Data
Nerval's Lobster writes In 2004, Steve Coast set up OpenStreetMap (OSM) in the U.K. It subsequently spread worldwide, powered by a combination of donations and volunteers willing to do ground surveys with tools such as handheld GPS units, notebooks, and digital cameras. JavaScript libraries and plugins for WordPress, Django and other content-management systems allow users to display their own maps. But how do you actually develop for the platform? Osmcode.org is a good place to start, home to the Osmium library (libosmium). Fetch and build Libosmium; on Linux/Unix systems there are a fair number of dependencies that you'll need as well; these are listed within the links. If you prefer JavaScript or Python, there are bindings for those. As an alternative for Java developers, there's Osmosis, which is a command-line application for processing OSM data.
And actually hacking. I think I may give this a try.
For a project I'm working on, I started to play around with the OpenStreetMap data as a source for locations (from a guy who's never used GIS info systems), so I think I'd be a good insight into getting started with using this great resource.
Notes:
- I develop in Java mostly, but I have a generally well rounded skill set.
Firstly, I had to make the jump to Postgress and PostGIS, which are annoying to setup if you're not familiar with them. I had a MySQL instance running, but for the life of me, I couldn't get osmosis to import before getting the setup just right, which unfortunately wasnt' as simple and stright forward as I'd have liked to see in any docs. So after finally banging PostGIS over the head enough to accept the import, I was hit with a huge knowledge gap on how to actually access spatial and hstore based data. Admittedly, once you get the handle of them, the SQL access the data is quite expressive and powerful.
For DB imports, I used Osmosis for data import. I couldn't find any stand-alone Java based libaries for actually using the DB data which would help a lot (maybe I'll end up writing an open source one if it doesn't already exist). So, I basically dropped down to writing PostGIS based SQL queries, which is really quite expressive and well structured when the data is good (depends on the world region, mostly good for North America from what I found so far).
Secondly, there was the OpenStreetMap data itself. As someone who primarily wants to work on geographic barriers and political boundaries, there's a big disconnect between the polygons of the system and the political ones. Generally, there's always a node (think of a pin on a map) to represent a proper place name (New york city for instance) and a polygon that encompass what New York's political boundaries are, but quite often there won't be explicit ties between the two, so you're left with bridging the two yourself constructing queries for where nodes are within city / state / country / etc.. Anyways, thats as far as I've gotten so far, so good luck!
Some links that helped me:
http://www.postgresql.org/docs...
http://postgis.net/docs/manual...
http://wiki.openstreetmap.org/... (Make sure to read carefully, becase its rather unforgiving and terse about bad environment setups)
Bye!
Why are you trying to represent an irrational number with a rational number of unnecessarily limited precision? If pi isn't defined as a constant in whatever language you're using, calculate it yourself and store it in a variable for future reference. 4*atan(1) is fairly common and simple for this purpose, and you'll get as many digits as the underlying datatype will support.
20 January 2017: the End of an Error.
I'm all for using open source software and information but it has to be at least 90% as good as the commercial alternatives especially if those commercial alternatives are reasonably priced. I'm going on a trip to Las Vegas, a city with extremely complex infrastructure including multiple monorail systems, a public bus system, complex streets, taxi and bus specific lanes, and a high density of shops and restaurants residing on multiple levels in extremely large buildings. I figured it would be the perfect opportunity for OSM to show off the best it has to offer.
Google appears so overwhelmingly better at handling all of those complex mapping scenarios to the point where OSM can't be seriously considered for people trying to use it to navigate that city. Most business data is out of date, public transit stops aren't as detailed, and it doesn't have the internal structures of buildings that take up multiple city blocks.
Interestingly enough my own city's OSM data is top notch, easily surpassing Google's data. Clearly there seems to be wide range of map data in the database, but I would think large cities that people travel to often seems like the place you really want high quality data and visualization if you want non-ideological users to switch. Had I not looked at my own community I would have written off OSM as a totally underdeveloped open source project with no chance of competing, and it seems like that's the exact opposite of the potential it has, but clearly there needs to be more outreach in some larger cities.