OpenStreetMap

​​Introducing OSMCha API

Posted by wille on 12 October 2017 in English (English)

Recently we released the new version of OSMCha, an application to help the OpenStreetMap community to review the changesets in the map. In this new version, the frontend was rewritten, we changed the backend to serve the data as a REST API and we have added some new interesting features. Let’s talk about some of the new possibilities that came in with these changes.

The REST API allowed us to build a faster and more efficient frontend and it opened up avenues for other applications being able to use OSMCha data. Yes, It’s now possible to build a JOSM plugin to update the status of a changeset or a feature in OSM. The API documentation to make this happen can be found here → https://osmcha.mapbox.com/api-docs/

The main API endpoint is the /api/v1/changesets/ as it allows us to get changesets. It accepts many filters and one ordering parameters. We also have some sub-urls, like /api/v1/changesets/checked/, /api/v1/changesets/unchecked/, /api/v1/changesets/suspect/, etc. That makes it easy to filter the changesets by some boolean fields and accepts filters parameters too.

Filters & Areas of Interest (AoI)

The new version of OSMCha comes with many additional options of fields to filter changesets that weren’t present in the previous version. Almost all filter options are available in the frontend, but you can also check the API docs to verify if you can benefit from some special API capability. One resource that is not still unavailable in the frontend is the possibility to filter changesets by using any geometry type you want, not just limiting to a bbox.

Furthermore, now you can set a filter query and save it as an Area of Interest (AoI), that way you won’t need to set the query parameters again, all you need is to access your AoI URL. Each AoI also has a GeoRSS feed that you can use to be notified for the new edits. You can also easily share your AoIs with other users by sending them the URL.

To save an Area of Interest, make a POST request to its endpoint with the name you want to give to your AoI and the filter parameters, which are the same that we use to query the changesets. The API also supports saving an Area of Interest with any geometry type you want.

Statistics

Do you need stats about an AoI, a user or about a changeset query? We provide it with some endpoints: /api/v1/stats/ gives us stats about the changesets (total number, quantity of harmful, checked and quantity by suspicion reason and by tag). This endpoints supports the filter params. We have the same stats to an Area of interest in /api/v1/aoi/{id}/stats/ and finally the stats of a user in /api/v1/user-stats/{uid}/.

Protection rules and documentation

The API has a throttling mechanism that limits the number of requests by user by minute to avoid our database of being misused. There are some endpoints, like the ones that add and remove suspicion reasons, that were made to help with administrative issues like fix a wrong detection and whose access is restricted to the admin users.

So checkout the documentation and use OSMCha to monitor your areas of edits! If you have some suggestion, feedback or ideas, post a comment or open an issue in github. It will be great to have new insights from the OSM community!

Leave a comment

Parsed with Markdown

  • Headings

    # Heading
    ## Subheading

  • Unordered list

    * First item
    * Second item

  • Ordered list

    1. First item
    2. Second item

  • Link

    [Text](URL)
  • Image

    ![Alt text](URL)

Login to leave a comment