Skip to content

DAXGRID/dawa-address

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DAWA Address

Provides a simple streaming interface to the DAWA Address API. It does simple translation from Danish to English and enables access to both full-load and the changes API.

You can get the NuGet package here.

Get latest transaction

var httpClient = new HttpClient();
var client = new DawaClient(httpClient);

var transaction = await client.GetLatestTransactionAsync();

Get all access addresses

var httpClient = new HttpClient();
var client = new DawaClient(httpClient);

var transaction = await client.GetLatestTransactionAsync();

await foreach (var accessAddress in client.GetAllAccessAddresses(transaction.Id))
{
    // Do your logic here
}

Get all access addresses

var httpClient = new HttpClient();
var client = new DawaClient(httpClient);

var transaction = await client.GetLatestTransactionAsync();

await foreach (var unitAddress in client.GetAllUnitAddresses(transaction.Id))
{
    // Do your logic here
}

Get all roads

var httpClient = new HttpClient();
var client = new DawaClient(httpClient);

var transaction = await client.GetLatestTransactionAsync();

await foreach (var accessAddress in client.GetAllRoadsAsync(transaction.Id))
{
    // Do your logic here
}

Get all post codes

var httpClient = new HttpClient();
var client = new DawaClient(httpClient);

var transaction = await client.GetLatestTransactionAsync();

await foreach (var postCode in client.GetAllPostCodesAsync(transaction.Id))
{
    // Do your logic here
}

Get all named road municipal districts

var httpClient = new HttpClient();
var client = new DawaClient(httpClient);

var transaction = await client.GetLatestTransactionAsync();

await foreach (var postCode in client.GetAllNamedRoadMunicipalDistrictAsync(transaction.Id))
{
    // Do your logic here
}

Get access address changes

var httpClient = new HttpClient();
var client = new DawaClient(httpClient);

var transaction = await client.GetLatestTransactionAsync();
// You should use your own fromTransactionId here.
var fromTransactionId = transaction.Id - 1000;
var toTransactionId = transaction.Id;

await foreach (var change in client.GetChangesAccessAddressAsync(fromTransactionId, toTransactionId))
{
    // Do your logic here
}

Get unit address changes

var httpClient = new HttpClient();
var client = new DawaClient(httpClient);

var transaction = await client.GetLatestTransactionAsync();
// You should use your own fromTransactionId here.
var fromTransactionId = transaction.Id - 1000;
var toTransactionId = transaction.Id;

await foreach (var change in client.GetChangesUnitAddressAsync(fromTransactionId, toTransactionId))
{
    // Do your logic here
}

Get road code changes

var httpClient = new HttpClient();
var client = new DawaClient(httpClient);

var transaction = await client.GetLatestTransactionAsync();
// You should use your own fromTransactionId here.
var fromTransactionId = transaction.Id - 1000;
var toTransactionId = transaction.Id;

await foreach (var change in client.GetChangesRoadsAsync(fromTransactionId, toTransactionId))
{
    // Do your logic here
}

Get post code changes

var httpClient = new HttpClient();
var client = new DawaClient(httpClient);

var transaction = await client.GetLatestTransactionAsync();
// You should use your own fromTransactionId here.
var fromTransactionId = transaction.Id - 1000;
var toTransactionId = transaction.Id;

await foreach (var change in client.GetChangesPostCodesAsync(fromTransactionId, toTransactionId))
{
    // Do your logic here
}

Get named road municipal district changes

var httpClient = new HttpClient();
var client = new DawaClient(httpClient);

var transaction = await client.GetLatestTransactionAsync();
// You should use your own fromTransactionId here.
var fromTransactionId = transaction.Id - 1000;
var toTransactionId = transaction.Id;

await foreach (var change in client.GetChangesNamedRoadMunicipalDistrictAsync(fromTransactionId, toTransactionId))
{
    // Do your logic here
}