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><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.2857120 39.8814763 4512697
#> 3 4.2933386 39.8814216 4512685
#> 4 4.2948122 39.8798973 4512671
#> 5 3.8305510 39.9882510 4489318
#> 6 3.8294090 39.9885240 4489259
#> 7 3.8276790 39.9878030 4489257
#> 8 4.0003768 40.0380776 4469180
#> 9 4.1442168 39.8644604 4414498
#> 10 3.8398672 40.0018138 4406584
#> url
#> 1 https://api.openstreetmap.org/api/0.6/notes/4512700.xml
#> 2 https://api.openstreetmap.org/api/0.6/notes/4512697.xml
#> 3 https://api.openstreetmap.org/api/0.6/notes/4512685.xml
#> 4 https://api.openstreetmap.org/api/0.6/notes/4512671.xml
#> 5 https://api.openstreetmap.org/api/0.6/notes/4489318.xml
#> 6 https://api.openstreetmap.org/api/0.6/notes/4489259.xml
#> 7 https://api.openstreetmap.org/api/0.6/notes/4489257.xml
#> 8 https://api.openstreetmap.org/api/0.6/notes/4469180.xml
#> 9 https://api.openstreetmap.org/api/0.6/notes/4414498.xml
#> 10 https://api.openstreetmap.org/api/0.6/notes/4406584.xml
#> comment_url
#> 1 https://api.openstreetmap.org/api/0.6/notes/4512700/comment.xml
#> 2 https://api.openstreetmap.org/api/0.6/notes/4512697/comment.xml
#> 3 https://api.openstreetmap.org/api/0.6/notes/4512685/comment.xml
#> 4 https://api.openstreetmap.org/api/0.6/notes/4512671/comment.xml
#> 5 https://api.openstreetmap.org/api/0.6/notes/4489318/comment.xml
#> 6 https://api.openstreetmap.org/api/0.6/notes/4489259/comment.xml
#> 7 https://api.openstreetmap.org/api/0.6/notes/4489257/comment.xml
#> 8 https://api.openstreetmap.org/api/0.6/notes/4469180/comment.xml
#> 9 https://api.openstreetmap.org/api/0.6/notes/4414498/comment.xml
#> 10 https://api.openstreetmap.org/api/0.6/notes/4406584/comment.xml
#> close_url
#> 1 https://api.openstreetmap.org/api/0.6/notes/4512700/close.xml
#> 2 https://api.openstreetmap.org/api/0.6/notes/4512697/close.xml
#> 3 https://api.openstreetmap.org/api/0.6/notes/4512685/close.xml
#> 4 https://api.openstreetmap.org/api/0.6/notes/4512671/close.xml
#> 5 https://api.openstreetmap.org/api/0.6/notes/4489318/close.xml
#> 6 https://api.openstreetmap.org/api/0.6/notes/4489259/close.xml
#> 7 https://api.openstreetmap.org/api/0.6/notes/4489257/close.xml
#> 8 https://api.openstreetmap.org/api/0.6/notes/4469180/close.xml
#> 9 https://api.openstreetmap.org/api/0.6/notes/4414498/close.xml
#> 10 https://api.openstreetmap.org/api/0.6/notes/4406584/close.xml
#> date_created status comments
#> 1 2024-11-09 08:41:50 open 1 comment from 2024-11-09 by Hector Asencio
#> 2 2024-11-09 08:37:26 open 1 comment from 2024-11-09 by Hector Asencio
#> 3 2024-11-09 08:33:28 open 1 comment from 2024-11-09 by Hector Asencio
#> 4 2024-11-09 08:31:05 open 1 comment from 2024-11-09 by Hector Asencio
#> 5 2024-10-22 08:20:30 open 1 comment from 2024-10-22 by Mammi71
#> 6 2024-10-22 07:02:51 open 1 comment from 2024-10-22 by Mammi71
#> 7 2024-10-22 07:00:24 open 1 comment from 2024-10-22 by Mammi71
#> 8 2024-10-07 20:02:17 open 1 comment from 2024-10-07 by TrixTrax
#> 9 2024-09-01 17:49:11 open 1 comment from 2024-09-01 by Larry52
#> 10 2024-08-28 08:00:54 open 1 comment from 2024-08-28 by xuv