Giter VIP home page Giter VIP logo

osmapiclient's Introduction

Build is

OsmApiClient

This is a simple C# client to allow using OSM API easily. 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 or VS Code to modify this project.

Features

  • Supports Logging using ILogger
  • Supports BasicAuth and OAuth
  • Supports every operation of the Osm Api v0.6
  • Has a nuget package
  • Is thread safe

Example Usage

// Create a client factory
var clientFactory = new ClientsFactory(null, new HttpClient(),
	"https://master.apis.dev.openstreetmap.org/api/");

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.

osmapiclient's People

Contributors

blackboxlogic avatar harelm avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.