Skip to content

An alternative to OpenStreetMap user's notes page + web UI for OSM note search API

License

Notifications You must be signed in to change notification settings

AntonKhorev/osm-note-viewer

Repository files navigation

osm-note-viewer

View OpenStreetMap notes on a map and in a table with all their comments. Originally an alternative to OpenStreetMap user's notes page: https://www.openstreetmap.org/user/username/notes. Now more generally a web UI for OSM notes API search and bounding box calls. The fetched notes can be filtered further by an expression matching a sequence of actions performed on a note, such as being opened by user A and later commented by user B. Can run as a static files served from any web server or from a local filesystem.

Try it out here.

Features

Search notes for user / text / date range

Get notes with /api/0.6/notes/search call. Allows searching for notes containing a given text, modified by a given user, created/updated inside a given date range. Enable Advanced mode to see how parameters of this call correspond to note-viewer's form fields.

Alternative tools:

  • NotesReview: doesn't use the osm api directly, which allows to do some queries that are impossible with the osm api. These include fetching only closed notes or notes only by anonymous users. Its possible to achieve that in note-viewer with a filter, but the filter is applied after downloading, and notes that don't pass through the filter also need to be downloaded.

View user's notes

This is the original feature. Now it is available as part of search. To see a set of notes similar to one on user's note page, you need to enter a username in the search form, leaving text and date range fields blank. Below these fields select fetch both open and closed matching notes sorted by last update date, newest first. Note that sorting defaults to creation date because it's more stable: no note update between fetches can alter the note sequence, so maybe you want to keep this order.

Other alternatives for viewing user's notes:

  • My OpenStreetMap Notes: shows only unresolved notes
  • NotesReview, click Filter, enter username in User, select Status = All, set Limit to as high as possible: unfortunately the max limit is just 100

Get notes inside rectangular area (Bbox)

Get notes with /api/0.6/notes call, which is what happens if you enable the notes layer on the osm website. Enable Advanced mode to see parameter details. There's a limit on the area size. The request will work with city-sized areas, but may fail on country-sized ones. The search functionality described above provides the opposite extreme by querying the entire planet.

Alternative tools:

  • ResultMaps/osm-notes: has note webpages and feeds for countries. Notes are presented in a table without a map.

Get notes from a list of note ids

Ids can be provided either directly as comma/space-separated list of numbers or in a HTML/XML file with a CSS selector specified to find them. There's a shortcut for extracting ids from ResultMaps/osm-notes feeds.

Integration with other apps and services

Custom API/tile/Nominatim/Overpass servers

Use the Servers section in the About tab to configure and switch servers. You can also configure servers by editing servers.json and building your copy of note-viewer. servers.json uses the same syntax as described in About > Servers > Custom server configuration syntax.

Editors with remote control

It's possible to load the selected notes and the currently visible map area using remote control feature of OpenStreetMap editors. JOSM is the most widely used of those. Remote control in JOSM has to be enabled in preferences. Go to Edit > Preferences > Remote Control and check Enable remote control.

The remote control tools are available in RC section of the tools panel below the notes table. If you press any button there and its outline turns red, hover over it to read the error message. The buttons require the following Permitted actions to be enabled in the preferences:

  • Load selected notes button requires Import data from URL.
  • Load map area button requires Load data from API. This operation may fail silently if the permission is not granted.

OSM Smart Menu

note-viewer can be added to OSM Smart Menu browser plugin using a URL template. The following template enables switching to note-viewer from any webpage recognized by OSM Smart Menu that contains an osm username:

https://antonkhorev.github.io/osm-note-viewer/#mode=search&display_name={osm_user_name}

You can also add a template for opening a map location:

https://antonkhorev.github.io/osm-note-viewer/#map={zoom}/{latitude}/{longitude}

Installation

If you don't want to run note-viewer from github, you can run if off any server that can serve static files, including a local filesystem (file:///). The files that are served by github are in the gh-pages branch of the repository. You can download all of them here. If you want to be able to do anything requiring login, such as editing notes, you'll have to register your copy of note-viewer as an OAuth 2 application. See About > Register app for details.

Note-viewer won't run entirely locally because the whole point of it is to access OSM API. Some optional functions access Nominatim, Overpass and other services. To render the map, Leaflet is served from its default CDN. The map requires access to OSM tile server.

To build from source you need Node.js. v20 is enough, may also work on earlier versions because Node.js is used only for building and testing. Run npm install and npm run build to get the build in dist directory. jsdom package is not kept at its latest version because this and this.

Testing

  • npm test runs unit tests
  • npm test test-browser runs slower in-browser tests
  • npm --visible test test-browser runs in-browser tests in a visible browser window
  • npm test -- test-browser -g "test name" runs a specific in-browser test

About

An alternative to OpenStreetMap user's notes page + web UI for OSM note search API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published