Skip to content

Files

Latest commit

44183b4 · Apr 29, 2020

History

History
37 lines (22 loc) · 1.19 KB

README.md

File metadata and controls

37 lines (22 loc) · 1.19 KB

replication

Build status

A package to use the OSM replication infrastructure.

  • OsmSharp.Replication: NuGet Badge

OsmSharp enables you to use the OSM replication system from the OSM planet server (and similar services) to keep local OSM data up to date. This package allows to:

  • Get all changes between two dates/times.
  • Download the associated diffs.

OsmSharp can then be used to apply the diffs.

Install

PM> Install-Package OsmSharp.Replication

Usage

The most common use case is to stream diffs from a date/time in the past:

var thePast = DateTime.Now.AddHours(-2).AddDays(-5);
var catchupEnumerator = new CatchupReplicationDiffEnumerator(thePast);

while (await catchupEnumerator.MoveNext())
{
    var current = catchupEnumerator.State;

    var diff = await catchupEnumerator.Diff();
    
    // do something with the diff here!
}