OsmSharp.IO.API 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package OsmSharp.IO.API --version 1.0.2                
NuGet\Install-Package OsmSharp.IO.API -Version 1.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OsmSharp.IO.API" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OsmSharp.IO.API --version 1.0.2                
#r "nuget: OsmSharp.IO.API, 1.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install OsmSharp.IO.API as a Cake Addin
#addin nuget:?package=OsmSharp.IO.API&version=1.0.2

// Install OsmSharp.IO.API as a Cake Tool
#tool nuget:?package=OsmSharp.IO.API&version=1.0.2                

OsmSharp.IO.API

This is a simple C# client to allow using OSM API easily over REST. Please read the API's documentation and use it responsibly. Misuse can have an adverse affect on the OSM ecosystem. Pull requests are welcome. You will need VisualStudio, VS Code or Rider to modify this project.

Features

  • Supports Logging using ILogger
  • Supports Authentication with username and password, OAuth 1 and OAuth 2
  • Supports every documented operation of the Osm Api v0.6
  • Has a nuget package
  • Is thread safe

Example Usage

// Create a client factory (pointing at the dev server)
var clientFactory = new ClientsFactory(null, new HttpClient(),
	"https://master.apis.dev.openstreetmap.org/api/");
// After testing, use "https://www.openstreetmap.org/api/" for production

Get a Node

var client = clientFactory.CreateNonAuthClient();
var node = await client.GetNode(100);

Delete a Node (map changes require BasicAuth or OAuth)

var authClient = clientFactory.CreateBasicAuthClient("username", "password");
var changeSetTags = new TagsCollection() { new Tag("comment", "Deleting a node.") };
var changeSetId = await client.CreateChangeset(changeSetTags);
node.Version = await client.DeleteElement(changeSetId, node);
await client.CloseChangeset(changeSetId);

See the functional tests for examples of each operation.

Supported Operations

🌕 = Does not use authentication

🌗 = With or without authentication (behavior may differ)

🌑 = Requires authentication

General Api Stuff

  • 🌕 Get Api versions
  • 🌕 Get Api capabilities
  • 🌕 Get a map section

Change Sets

  • 🌕 Get a specific changeset's metadata
  • 🌕 Get a specific changeset's changes
  • 🌕 Search for changesets
  • 🌑 Create a new changeset with metadata
  • 🌑 Add changes to an open changeset
  • 🌑 Update an open changeset's metadata
  • 🌑 Close an open changeset
  • 🌑 Add comments to a changeset
  • 🌑 Subscribe to a changeset
  • 🌑 UnSubscribe to a changeset

Map Elements

  • 🌕 Get an element
  • 🌕 Get an element's version history
  • 🌕 Get a specific version of an element
  • 🌕 Search for elements
  • 🌕 Get relations containing a specific element
  • 🌕 Get ways containing a specific node
  • 🌕 Get a relation and all of its elements
  • 🌕 Get a way and all of its nodes
  • 🌑 Create a new element
  • 🌑 Update an element
  • 🌑 Delete an element

Gpx Files

  • 🌕 Get trackpoints in an area
  • 🌗 Get a gpx file's metadata
  • 🌗 Get a gpx file's original upload data
  • 🌑 Get current user's gpx files
  • 🌑 Create a new gpx file
  • 🌑 Update a gpx file's metadata
  • 🌑 Delete a gpx file

User Info

  • 🌕 Get details about a user
  • 🌕 Get details about many users
  • 🌑 Get current user's permissions
  • 🌑 Get current user's details
  • 🌑 Get current user's preferences
  • 🌑 Update current user's preferences
  • 🌑 Get a current user's preference
  • 🌑 Update a current user's preference
  • 🌑 Delete a current user's preference

Notes

  • 🌕 Search for notes
  • 🌕 Get an RSS feed of notes in an area
  • 🌕 Get a note
  • 🌗 Create a new note
  • 🌑 Comment on a note
  • 🌑 Close a note
  • 🌑 ReOpen a note

Contribute

Issues and pull requests are welcome.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.4 4,161 12/30/2022
1.0.3 680 12/30/2022
1.0.2 679 12/30/2022
1.0.1 704 12/30/2022
0.0.9 678 12/30/2022