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. It can be specified by a character, matrix, vector,bboxobject from sf, aSpatExtentfrom terra. Unnamed vectors and matrices will be sorted appropriately and must merely be in the order (x,y,x,y) orxin the first column andyin the second column.- 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><p>ThisIsANote</p></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>"},
...
]
}
}
]
}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.2930578 39.8782652 4512700
#> 2 4.2661000 39.8963000 5118854
#> 3 3.7987053 40.0003913 5247708
#> 4 4.0252447 40.0044936 5218602
#> 5 4.0017807 40.0062099 5218040
#> 6 4.2634732 39.9964049 3336380
#> 7 4.2065620 39.8720671 5118173
#> 8 4.1349792 39.8686417 5118172
#> 9 4.1845036 39.8750314 5118170
#> 10 4.2707197 39.8881776 5029532
#> url
#> 1 https://api.openstreetmap.org/api/0.6/notes/4512700.xml
#> 2 https://api.openstreetmap.org/api/0.6/notes/5118854.xml
#> 3 https://api.openstreetmap.org/api/0.6/notes/5247708.xml
#> 4 https://api.openstreetmap.org/api/0.6/notes/5218602.xml
#> 5 https://api.openstreetmap.org/api/0.6/notes/5218040.xml
#> 6 https://api.openstreetmap.org/api/0.6/notes/3336380.xml
#> 7 https://api.openstreetmap.org/api/0.6/notes/5118173.xml
#> 8 https://api.openstreetmap.org/api/0.6/notes/5118172.xml
#> 9 https://api.openstreetmap.org/api/0.6/notes/5118170.xml
#> 10 https://api.openstreetmap.org/api/0.6/notes/5029532.xml
#> comment_url
#> 1 <NA>
#> 2 <NA>
#> 3 https://api.openstreetmap.org/api/0.6/notes/5247708/comment.xml
#> 4 https://api.openstreetmap.org/api/0.6/notes/5218602/comment.xml
#> 5 https://api.openstreetmap.org/api/0.6/notes/5218040/comment.xml
#> 6 https://api.openstreetmap.org/api/0.6/notes/3336380/comment.xml
#> 7 https://api.openstreetmap.org/api/0.6/notes/5118173/comment.xml
#> 8 https://api.openstreetmap.org/api/0.6/notes/5118172/comment.xml
#> 9 https://api.openstreetmap.org/api/0.6/notes/5118170/comment.xml
#> 10 https://api.openstreetmap.org/api/0.6/notes/5029532/comment.xml
#> close_url
#> 1 <NA>
#> 2 <NA>
#> 3 https://api.openstreetmap.org/api/0.6/notes/5247708/close.xml
#> 4 https://api.openstreetmap.org/api/0.6/notes/5218602/close.xml
#> 5 https://api.openstreetmap.org/api/0.6/notes/5218040/close.xml
#> 6 https://api.openstreetmap.org/api/0.6/notes/3336380/close.xml
#> 7 https://api.openstreetmap.org/api/0.6/notes/5118173/close.xml
#> 8 https://api.openstreetmap.org/api/0.6/notes/5118172/close.xml
#> 9 https://api.openstreetmap.org/api/0.6/notes/5118170/close.xml
#> 10 https://api.openstreetmap.org/api/0.6/notes/5029532/close.xml
#> date_created status
#> 1 2024-11-09 08:41:50 closed
#> 2 2026-01-05 17:48:47 closed
#> 3 2026-04-12 20:06:29 open
#> 4 2026-03-24 21:36:32 open
#> 5 2026-03-24 13:21:47 open
#> 6 2022-08-29 07:38:46 open
#> 7 2026-01-05 08:33:02 open
#> 8 2026-01-05 08:32:39 open
#> 9 2026-01-05 08:32:09 open
#> 10 2025-10-30 09:33:03 open
#> comments
#> 1 2 comments from 2024-11-09 to 2026-04-16 by Hector Asencio, ...
#> 2 2 comments from 2026-01-05 to 2026-04-16 by NA, 5R-MFT
#> 3 1 comment from 2026-04-12 by sommallorqui
#> 4 1 comment from 2026-03-24 by anonymous user
#> 5 1 comment from 2026-03-24 by Pan Perníček
#> 6 2 comments from 2022-08-29 to 2026-03-23 by Pan Perníček, Jo...
#> 7 1 comment from 2026-01-05 by anonymous user
#> 8 1 comment from 2026-01-05 by anonymous user
#> 9 1 comment from 2026-01-05 by anonymous user
#> 10 1 comment from 2025-10-30 by TrixTrax