Skip to contents

Returns the existing notes in the specified bounding box. The notes will be ordered by the date of their last change, the most recent one will be first.

Usage

osm_read_bbox_notes(
  bbox,
  limit = 100,
  closed = 7,
  format = c("R", "sf", "xml", "rss", "json", "gpx")
)

Arguments

bbox

Coordinates for the area to retrieve the notes from (left,bottom,right,top). Floating point numbers in degrees, expressing a valid bounding box, not larger than the configured size limit, 25 square degrees, not overlapping the dateline.

limit

Specifies the number of entries returned at max. A value between 1 and 10000 is valid. Default to 100.

closed

Specifies the number of days a note needs to be closed to no longer be returned. A value of 0 means only open notes are returned. A value of -1 means all notes are returned. Default to 7.

format

Format of the output. Can be "R" (default), "sf" "xml", "rss", "json" or "gpx".

Value

If format = "R", returns a data frame with one map note per row. If format = "sf", returns a sf object from sf.

format = "xml"

Returns a xml2::xml_document with the following format:

<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="OpenStreetMap server" copyright="OpenStreetMap and contributors" attribution="https://www.openstreetmap.org/copyright" license="https://opendatacommons.org/licenses/odbl/1-0/">
  <note lon="0.1000000" lat="51.0000000">
    <id>16659</id>
    <url>https://master.apis.dev.openstreetmap.org/api/0.6/notes/16659</url>
    <comment_url>https://master.apis.dev.openstreetmap.org/api/0.6/notes/16659/comment</comment_url>
    <close_url>https://master.apis.dev.openstreetmap.org/api/0.6/notes/16659/close</close_url>
    <date_created>2019-06-15 08:26:04 UTC</date_created>
    <status>open</status>
    <comments>
      <comment>
        <date>2019-06-15 08:26:04 UTC</date>
        <uid>1234</uid>
        <user>userName</user>
        <user_url>https://master.apis.dev.openstreetmap.org/user/userName</user_url>
        <action>opened</action>
        <text>ThisIsANote</text>
        <html>&lt;p&gt;ThisIsANote&lt;/p&gt;</html>
      </comment>
      ...
    </comments>
  </note>
  ...
</osm>

format = "json"

Returns a list with the following json structure:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {"type": "Point", "coordinates": [0.1000000, 51.0000000]},
      "properties": {
        "id": 16659,
        "url": "https://master.apis.dev.openstreetmap.org/api/0.6/notes/16659.json",
        "comment_url": "https://master.apis.dev.openstreetmap.org/api/0.6/notes/16659/comment.json",
        "close_url": "https://master.apis.dev.openstreetmap.org/api/0.6/notes/16659/close.json",
        "date_created": "2019-06-15 08:26:04 UTC",
        "status": "open",
        "comments": [
          {"date": "2019-06-15 08:26:04 UTC", "uid": 1234, "user": "userName", "user_url": "https://master.apis.dev.openstreetmap.org/user/userName", "action": "opened", "text": "ThisIsANote", "html": "<p>ThisIsANote</p>"},
          ...
        ]
      }
    }
  ]
}

format = "rss" & format = "gpx"

For format in "rss", and "gpx", a xml2::xml_document with the corresponding format.

Note

The comment properties (uid, user, user_url) will be omitted if the comment was anonymous.

See also

Other get notes' functions: osm_feed_notes(), osm_get_notes(), osm_search_notes()

Examples

notes <- osm_read_bbox_notes(bbox = c(3.7854767, 39.7837403, 4.3347931, 40.1011851), limit = 10)
## bbox as a character value also works (bbox = "3.7854767,39.7837403,4.3347931,40.1011851").
notes
#>          lon        lat      id
#> 1  3.8421558 40.0028523 4406499
#> 2  3.8331880 39.9946760 4744904
#> 3  3.8320747 40.0007837 1715409
#> 4  3.8398672 40.0018138 4406584
#> 5  3.8397408 40.0021913 3949461
#> 6  3.8392711 39.9981393  554396
#> 7  3.8335419 39.9721870  451271
#> 8  3.9058717 40.0338726  719406
#> 9  4.0763478 40.0647740 4947049
#> 10 4.2249808 39.8648249 4946024
#>                                                        url
#> 1  https://api.openstreetmap.org/api/0.6/notes/4406499.xml
#> 2  https://api.openstreetmap.org/api/0.6/notes/4744904.xml
#> 3  https://api.openstreetmap.org/api/0.6/notes/1715409.xml
#> 4  https://api.openstreetmap.org/api/0.6/notes/4406584.xml
#> 5  https://api.openstreetmap.org/api/0.6/notes/3949461.xml
#> 6   https://api.openstreetmap.org/api/0.6/notes/554396.xml
#> 7   https://api.openstreetmap.org/api/0.6/notes/451271.xml
#> 8   https://api.openstreetmap.org/api/0.6/notes/719406.xml
#> 9  https://api.openstreetmap.org/api/0.6/notes/4947049.xml
#> 10 https://api.openstreetmap.org/api/0.6/notes/4946024.xml
#>                                                        comment_url
#> 1                                                             <NA>
#> 2                                                             <NA>
#> 3                                                             <NA>
#> 4                                                             <NA>
#> 5                                                             <NA>
#> 6                                                             <NA>
#> 7                                                             <NA>
#> 8                                                             <NA>
#> 9  https://api.openstreetmap.org/api/0.6/notes/4947049/comment.xml
#> 10 https://api.openstreetmap.org/api/0.6/notes/4946024/comment.xml
#>                                                        close_url
#> 1                                                           <NA>
#> 2                                                           <NA>
#> 3                                                           <NA>
#> 4                                                           <NA>
#> 5                                                           <NA>
#> 6                                                           <NA>
#> 7                                                           <NA>
#> 8                                                           <NA>
#> 9  https://api.openstreetmap.org/api/0.6/notes/4947049/close.xml
#> 10 https://api.openstreetmap.org/api/0.6/notes/4946024/close.xml
#>           date_created status
#> 1  2024-08-28 07:04:07 closed
#> 2  2025-05-06 09:41:41 closed
#> 3  2019-03-18 18:23:59 closed
#> 4  2024-08-28 08:00:54 closed
#> 5  2023-10-20 09:17:58 closed
#> 6  2016-04-25 07:29:26 closed
#> 7  2015-10-14 07:28:00 closed
#> 8  2016-09-20 09:16:53 closed
#> 9  2025-09-04 21:31:33   open
#> 10 2025-09-04 09:50:20   open
#>                                                           comments
#> 1  2 comments from 2024-08-28 to 2025-09-14 by xuv, Hugoren Mar...
#> 2  2 comments from 2025-05-06 to 2025-09-14 by NA, Hugoren Mart...
#> 3  4 comments from 2019-03-18 to 2025-09-14 by menorcaindex, Hu...
#> 4  2 comments from 2024-08-28 to 2025-09-14 by xuv, Hugoren Mar...
#> 5  2 comments from 2023-10-20 to 2025-09-14 by BinimarsentMenor...
#> 6  2 comments from 2016-04-25 to 2025-09-14 by Sam Wilson, Hugo...
#> 7  2 comments from 2015-10-14 to 2025-09-14 by TrekkingTourist,...
#> 8  2 comments from 2016-09-20 to 2025-09-13 by Pepito821, sanch...
#> 9                               1 comment from 2025-09-04 by diibv
#> 10                     1 comment from 2025-09-04 by anonymous user