openstreetmap / openstreetmap-website

The Rails application that powers OpenStreetMap
https://www.openstreetmap.org/
GNU General Public License v2.0
2.21k stars 918 forks source link

Adds note tags support #5344

Open nenad-vujicic opened 2 days ago

nenad-vujicic commented 2 days ago

Description

PR adds support for note tags as described in #5294 Following changes are made:

  1. Created note_tags table, connected it with note table (using foreign key and associations), created NoteTag model file and NoteTagTest class with basic tests (PR #5323 does this)
  2. Added preparing and rendering of note tags in left sidebar using browse/tag_details partial, also, created test with multiple tags added rendering and checking if rendered HTML contains tags
  3. Updated (j)builder files to write note tags in XML, JSON, GPX, RSS and feed files and updated test to check existence of tags in each of above files (creation of tag is performed using ActiveLayer)
  4. Added support for creating tags at note creation time using POST HTTP request and improved tests to check existence of tags in each of generated files (creation of tag is performed using POST HTTP request). Also, added creating tag created_by, OpenStreetMaps-Website for notes created using OSM website.

Displayed resolved note: image

Displayed opened note: image

XML output for "opened note": image

Displayed note without tags (all current): image

Fixes #5294

How has this been tested?

Run tests from workflows, tested creating and displaying notes manually as administrator / moderator / regular user, tested displaying already existing notes (they will be displayed as earlier - without tags)

nenad-vujicic commented 22 hours ago

Here are a few more benefits of adding note tags to OSM, as implemented by this PR:

  1. Improves notes categorization (by e.g. adding descriptive tags for better organization like "Missing place" or similar):

image

  1. Improves collaboration & communication (by e.g. marking resolving some note requires outdoor survey):

image

  1. Now we are ready for advanced filtering by specific tags (needs development)

  2. Improves public outreach (by e.g. adding tags about mapathons)

image

  1. Improves multi-language support (by e.g. adding language in which note description is written)

image

@tyrasd @westnordost @Zverik @ToeBee @angoca @talllguy what do you think about this PR?

Thanks, Nenad.

westnordost commented 21 hours ago

Many of the use cases covered by this issue/PR are currently solved with hash tags (e.g. #surveyme) and tools are currently made to take these into account. Tools would need to be adapted to support tags as well. (Hashtags are not going away anytime soon)

The advantage of having tags implemented like this properly would be that there could be an efficient API with which to filter notes. (Right now, this is the only advantage I can think of over hash tags and stuff.) For example: