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  4.0762542 39.8982309 4729248
#> 2  4.2276978 39.8218328 4725634
#> 3  4.2371843 39.8169038 4724015
#> 4  4.2428997 39.8166616 4723970
#> 5  4.2457265 39.8169421 4723941
#> 6  3.8242677 40.0510000 4714920
#> 7  3.8240197 40.0505226 4714919
#> 8  4.2705990 39.9498139 4707249
#> 9  4.3026763 39.8650801 4650872
#> 10 4.2588437 39.8876073 4650867
#>                                                        url
#> 1  https://api.openstreetmap.org/api/0.6/notes/4729248.xml
#> 2  https://api.openstreetmap.org/api/0.6/notes/4725634.xml
#> 3  https://api.openstreetmap.org/api/0.6/notes/4724015.xml
#> 4  https://api.openstreetmap.org/api/0.6/notes/4723970.xml
#> 5  https://api.openstreetmap.org/api/0.6/notes/4723941.xml
#> 6  https://api.openstreetmap.org/api/0.6/notes/4714920.xml
#> 7  https://api.openstreetmap.org/api/0.6/notes/4714919.xml
#> 8  https://api.openstreetmap.org/api/0.6/notes/4707249.xml
#> 9  https://api.openstreetmap.org/api/0.6/notes/4650872.xml
#> 10 https://api.openstreetmap.org/api/0.6/notes/4650867.xml
#>                                                        comment_url
#> 1  https://api.openstreetmap.org/api/0.6/notes/4729248/comment.xml
#> 2                                                             <NA>
#> 3  https://api.openstreetmap.org/api/0.6/notes/4724015/comment.xml
#> 4  https://api.openstreetmap.org/api/0.6/notes/4723970/comment.xml
#> 5  https://api.openstreetmap.org/api/0.6/notes/4723941/comment.xml
#> 6  https://api.openstreetmap.org/api/0.6/notes/4714920/comment.xml
#> 7  https://api.openstreetmap.org/api/0.6/notes/4714919/comment.xml
#> 8  https://api.openstreetmap.org/api/0.6/notes/4707249/comment.xml
#> 9  https://api.openstreetmap.org/api/0.6/notes/4650872/comment.xml
#> 10 https://api.openstreetmap.org/api/0.6/notes/4650867/comment.xml
#>                                                        close_url
#> 1  https://api.openstreetmap.org/api/0.6/notes/4729248/close.xml
#> 2                                                           <NA>
#> 3  https://api.openstreetmap.org/api/0.6/notes/4724015/close.xml
#> 4  https://api.openstreetmap.org/api/0.6/notes/4723970/close.xml
#> 5  https://api.openstreetmap.org/api/0.6/notes/4723941/close.xml
#> 6  https://api.openstreetmap.org/api/0.6/notes/4714920/close.xml
#> 7  https://api.openstreetmap.org/api/0.6/notes/4714919/close.xml
#> 8  https://api.openstreetmap.org/api/0.6/notes/4707249/close.xml
#> 9  https://api.openstreetmap.org/api/0.6/notes/4650872/close.xml
#> 10 https://api.openstreetmap.org/api/0.6/notes/4650867/close.xml
#>           date_created status                                    comments
#> 1  2025-04-26 17:42:48   open        1 comment from 2025-04-26 by DaveC46
#> 2  2025-04-24 11:13:58 closed     2 comments from 2025-04-24 by Chem-Chem
#> 3  2025-04-23 09:41:55   open        1 comment from 2025-04-23 by DVDGC13
#> 4  2025-04-23 09:21:53   open        1 comment from 2025-04-23 by DVDGC13
#> 5  2025-04-23 09:07:19   open        1 comment from 2025-04-23 by DVDGC13
#> 6  2025-04-17 17:15:30   open        1 comment from 2025-04-17 by DVDGC13
#> 7  2025-04-17 17:15:28   open        1 comment from 2025-04-17 by DVDGC13
#> 8  2025-04-12 14:50:58   open       1 comment from 2025-04-12 by glimgran
#> 9  2025-03-04 11:13:40   open 1 comment from 2025-03-04 by anonymous user
#> 10 2025-03-04 11:11:19   open 1 comment from 2025-03-04 by anonymous user