Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Open Source Programming

Getting Started Developing With OpenStreetMap Data 39

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.
This discussion has been archived. No new comments can be posted.

Getting Started Developing With OpenStreetMap Data

Comments Filter:
  • by Crashmarik ( 635988 ) on Tuesday April 07, 2015 @12:46PM (#49423449)

    And actually hacking. I think I may give this a try.

  • by ADRA ( 37398 ) on Tuesday April 07, 2015 @01:43PM (#49423819)

    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... [postgresql.org]
    http://postgis.net/docs/manual... [postgis.net]
    http://wiki.openstreetmap.org/... [openstreetmap.org] (Make sure to read carefully, becase its rather unforgiving and terse about bad environment setups)

    • by richlv ( 778496 )

      wouldn't those place properties be usually grouped by a relation like this one ?
      http://wiki.openstreetmap.org/... [openstreetmap.org]

      • by ADRA ( 37398 )

        Yeah, relations capture the net of the geographic region, but I find the individual node's contain better hierarical town/region/state/country layering which was more correct (at least in Canada where my test data was running against). Politically based relations are great when they exist, but far too often you'd have a relation representing X but no explicit connection besides the fact that the node was geographically found in the region. You may have a relation, but you often don't have relations that poi

    • by tom17 ( 659054 )

      Sounds like we have gone through similar. I too am working on a project and had to take a 'detour' while I learned about GIS. Also ending up with PostGIS, osm2pgsql and huge scads of time looking around the OSM data trying to work out route data & relations.

      It's been a taxing ride, but I think I have what I need from the GIS side of things now and can get back to the main part of the app. GIS is a tricky subject field and learning which areas you need to learn is a daunting task in itself when you are a

    • Boundless has a simple install for PostGIS along with Postgresql. I just reinstalled PostGIS using Boundless OpenGeo Suite on a Macbook Pro after replacing the hard drive. An easy installation. Place names are a problem. OSM continues to debate whether admin boundaries should be included. Right now we are good down to city level. Small localities such as neighborhoods and unincorporated hamlets are often just a node. Since OSM attempts to document ground truth, it is hard to create a polygon around an are
    • After 16 years of lurking I've finally created an id :-) I'm the primary author of Osmosis. The parent mentioned that there are no standalone java libraries available. This isn't strictly true. Osmosis exposes a command line interface and this is how most people use it, however it is built as a set of libraries that can be included as required in other Java applications. These libraries are all published to Maven Central. http://search.maven.org/#searc... [maven.org] Osmosis documentation is available on the Open
  • As a developer of GIS systems you can earn very good money indeed. Why would anyone want to do it for free?

  • by idji ( 984038 )
    I was doing some development with OSM and was using my own formulae to convert from latitude/longitude to OSM tile coordinates. I spent days getting the wrong results until I realised the problem was pi. i had been using pi=3.1415926535. It turns out that that is not GOOD enough to zoom into house level. I added 5 extra 5 or so digits of PI and then all my tiles were correct to the house level. I was awed that for a simple, practical task i needed 15 digits of pi!
    • by ncc74656 ( 45571 ) *

      I spent days getting the wrong results until I realised the problem was pi. i had been using pi=3.1415926535

      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.

  • I'm playing around with viewing OSM data. I like the MarbleWidget [kde.org]. (And despite the KDE link, it only needs Qt, not the whole KDE Stack.)
  • 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 op
    • 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.

      Interestingly, for one of my favourite mapping application -- establishing coastal sea-kayaking routes -- Google Maps is worse than useless. Google fuzzes out the offshore regions, leaving large blank areas where I know that islands/archipelagos exist. OSM does not do this, making it a much better tool for the job.

    • by healyp ( 1260440 )
      Part of the reason that Public Transit is so good on Google Maps is that Google developed, pushed and helped municipalities adopt the standards (GTFS) they came up with to represent transit data: https://developers.google.com/... [google.com]

      NYC MTA developer resources link: http://web.mta.info/developers... [mta.info]

The use of money is all the advantage there is to having money. -- B. Franklin

Working...