OpenStreetMap

Using the new OSMCha feature API endpoint

Posted by wille on 4 November 2018 in English.

On my last diary post I talked that we have a new features endpoint on our OSMCha API that makes it easy to the communities to add flagged features to OSMCha. Let’s check how you can use this new endpoint.

1. Get authorization

The first step is to open an issue on our GitHub repository and tell us what kind of feature modifications you want to flag.

You’ll need to deploy some software to monitor the features or you can just write an osm-compare function.

We will review your application and, if you prefer to run a monitoring software by yourself, we will update your user to allow it to post features to OSMCha.

2. Post features

The new endpoint is https://osmcha.mapbox.com/api/v1/changesets/add-feature/. You must do a POST request with the following content:

{ "osm_id": "4321", "changeset": 1234, "osm_type": "node", "reasons": ["Other reason", "Large building"], "version": 54, "name": "Tall Building", "primary_tags": {"office": "coworking", "building": "yes"}, "note": "details about the suspicion" }

Only the first four fields are mandatory. The other are optional. Any other field you add to the request content will not be saved on the database. Check the list of existing suspicion reasons, if you want to flag features with another reason, just add the name of the new reason inside the reasons field and it will be created when the request is received by the server.


If you need some additional help, open an issue on the osmcha-frontend repository or send an email to the OSMCha mailing list. We will be glad to help you validate more changes in OpenStreetMap!

Discussion

Log in to leave a comment