The culmination of 13 long and arduous weeks as part of Google Summer of Code 2012 has produced a new prototype feature within Web Processing Service: the ability to take OpenStreetMap data and transform it on the fly into other GIS formats.
What does this mean?
We can now directly interface with OpenStreetMap servers (Overpass API) such that we can send custom queries for map data retrieval, and have it returned not as OSM XML files, but rather any GIS format that is supported by WPS. This is demonstrable through the WPS test client on the demo server. Here is a breakdown of the features implemented:
- Standard conversion of existing OSM XML files into other GIS formats (basic GML, KML, and Shapefiles)
- On-the-fly conversion of Overpass API output into other GIS formats
- Option for OSM passthrough
- Option for any of the GIS formats supported by WPS as output
- Option to show original Overpass query
Currently there are two sample algorithms that are bundled in this project:
- A sample implementation of a Bounding Box algorithm for retrieving specific areas of the OpenStreetMap planet.osm
- A generic implementation that takes any string query and sends it to the Overpass server, and retrieves the result for processing
This allows for adventurous developers to go in and create their own custom algorithms for WPS that interface directly with OpenStreetMap.
Some videos of this in action are available here:
- Demonstration of on-the-fly conversion of existing OSM data (both inline OSM text and externally referenced OSM files) into a variety of formats
- Demonstration of custom Overpass query conversion into KML
More details on installation, configuration, and development can be found on the wiki page for this project.
Comments and Future work
Of course, this is probably not the end. There exist many avenues of future work, some of which I have thought of during the process of development, and some which have been suggested to me. A short list of what would be useful next steps:
- Support for PBF format (smaller but non-human-readable)
- Adding more algorithms to the Overpass algorithm component (What would be some useful and common requests that would be made?)
- Adding support for bzipped/gzipped/otherwise-compressed OSM files
- Work with Geotools to integrate some of the OSM parsing component
- Add a OSM generator
- Adding a mechanism for exchangeable conversion rules
- Adding rules to the format conversion based on what is considered “common knowledge” in the OSM community. Currently the system simply requests all the possible tags and denotes them to be attributes of features.
- Optimization; when dealing with large datasets, reducing any unneeded overhead is always highly preferable and results in faster code and more satisfied users.
Lastly, I must thank the 52°North community for allowing me to work on this project for Google Summer of Code 2012. It was largely a fantastic experience for me in that, I got exposure with working on something that allowed me to learn a lot more about GIS software and the community.
Special thanks to my mentor Benjamin Proß, who answered all the questions I had about WPS, guided me to understanding how this intricate system worked, and provided tips on how to implement certain details.
Special thanks also to Daniel Nüst, who helped me with some last-minute testing, provided feedback and help on IRC during the last week, and continually reminding us of impending deadlines.