GitHub - ethan-nelson/osm_diff_tool: Tool for working with OpenStreetMap diff files. (original) (raw)

This module is a tool to download and extract data from OpenStreetMap diff files (*.osc).

Diff are available at https://planet.openstreetmap.org/replication for anyone to download in minutely, hourly, or daily segments.

Installation

Releases

Versioned releases are available from PyPI for use with Python pip:

Bleeding Edge

You can also install the bleeding edge version of the tool:

Method 1

Method 2

$pip install git+https://github.com/ethan-nelson/osm_diff_tool.git

Usage

To use the tool, call import osmdt.

Calls right now include:

Example call sequence:

import osmdt

data_stream = osmdt.fetch('25866')  # Retrieves the 000/025/866 diff
data_object = osmdt.process(data_stream)  # Parse the data stream
changesets = osmdt.extract_changesets(data_object) # Extract changeset information
users = osmdt.extract_users(data_object) # Extract user information
objects = osmdt.extract_objects(data_object) # Extract object information

Alternatively, you can use osmdt.run to run all the commands with one call:

import osmdt

changesets, objects, users = osmdt.run('25866')

This tool is used in the OSM Hall Monitor project.