Skip to contents

Returns notes that match the specified query. If no query is provided, the most recently updated notes are returned.

Usage

osm_search_notes(
  q,
  user,
  bbox,
  from,
  to,
  closed = 7,
  sort = c("updated_at", "created_at"),
  order = c("newest", "oldest"),
  limit = getOption("osmapir.api_capabilities")$api$notes["default_query_limit"],
  format = c("R", "sf", "xml", "rss", "json", "gpx")
)

Arguments

q

Text search query, matching either note text or comments.

user

Search for notes which the given user interacted with. The value can be the user id (numeric) or the display name (character).

bbox

Search area expressed as a string or a numeric vector of 4 coordinates of a valid bounding box (left,bottom,right,top) in decimal degrees. Area must be at most 25 square degrees (see osm_capabilities()$note_area and this line in settings for the current value).

from

Beginning date range for created_at or updated_at (specified by sort). Preferably in ISO 8601 date format.

to

End date range for created_at or updated_at (specified by sort). Preferably in ISO 8601 date format. Only works when from is supplied.

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. 7 is the default.

sort

Sort results by creation ("created_at") or update date ("updated_at", the default).

order

Sorting order. "oldest" is ascending order, "newest" is descending order (the default).

limit

Maximum number of results between 1 and 10000 (may change, see osm_capabilities()$api$notes for the current value). Default to 100.

format

Format of the the returned list of notes. 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. If format = "json", returns a list with the json structure. For format in "xml", "rss", and "gpx", a xml2::xml_document with the corresponding format.

Details

The notes will be ordered by the date of their last change, the most recent one will be first.

See also

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

Examples

notes <- osm_search_notes(
  q = "POI", bbox = "0.1594133,40.5229822,3.3222508,42.8615226",
  from = "2017-10-01", to = "2018-10-27T15:27A", limit = 10
)
notes
#>         lon        lat      id
#> 1 0.2185603 42.4563864 1526613
#> 2 1.5357660 42.5085979 1331680
#> 3 1.8082179 41.5404189 1198103
#>                                                       url
#> 1 https://api.openstreetmap.org/api/0.6/notes/1526613.xml
#> 2 https://api.openstreetmap.org/api/0.6/notes/1331680.xml
#> 3 https://api.openstreetmap.org/api/0.6/notes/1198103.xml
#>                                                       comment_url
#> 1 https://api.openstreetmap.org/api/0.6/notes/1526613/comment.xml
#> 2 https://api.openstreetmap.org/api/0.6/notes/1331680/comment.xml
#> 3 https://api.openstreetmap.org/api/0.6/notes/1198103/comment.xml
#>                                                       close_url
#> 1 https://api.openstreetmap.org/api/0.6/notes/1526613/close.xml
#> 2 https://api.openstreetmap.org/api/0.6/notes/1331680/close.xml
#> 3 https://api.openstreetmap.org/api/0.6/notes/1198103/close.xml
#>          date_created status                                           comments
#> 1 2018-09-14 13:09:30   open           1 comment from 2018-09-14 by jobfotosjob
#> 2 2018-03-18 17:33:45   open                1 comment from 2018-03-18 by Esdome
#> 3 2017-11-07 08:50:37   open 1 comment from 2017-11-07 by Albert Guell Viturtia

my_notes <- osm_search_notes(
  user = "jmaspons", bbox = c(-0.1594133, 40.5229822, 3.322251, 42.861523),
  closed = -1, format = "json"
)
my_notes
#> $type
#> [1] "FeatureCollection"
#> 
#> $features
#> $features[[1]]
#> $features[[1]]$type
#> [1] "Feature"
#> 
#> $features[[1]]$geometry
#> $features[[1]]$geometry$type
#> [1] "Point"
#> 
#> $features[[1]]$geometry$coordinates
#> $features[[1]]$geometry$coordinates[[1]]
#> [1] 2.137777
#> 
#> $features[[1]]$geometry$coordinates[[2]]
#> [1] 41.68099
#> 
#> 
#> 
#> $features[[1]]$properties
#> $features[[1]]$properties$id
#> [1] 4392400
#> 
#> $features[[1]]$properties$url
#> [1] "https://api.openstreetmap.org/api/0.6/notes/4392400.json"
#> 
#> $features[[1]]$properties$comment_url
#> [1] "https://api.openstreetmap.org/api/0.6/notes/4392400/comment.json"
#> 
#> $features[[1]]$properties$close_url
#> [1] "https://api.openstreetmap.org/api/0.6/notes/4392400/close.json"
#> 
#> $features[[1]]$properties$date_created
#> [1] "2024-08-19 20:06:00 UTC"
#> 
#> $features[[1]]$properties$status
#> [1] "open"
#> 
#> $features[[1]]$properties$comments
#> $features[[1]]$properties$comments[[1]]
#> $features[[1]]$properties$comments[[1]]$date
#> [1] "2024-08-19 20:06:00 UTC"
#> 
#> $features[[1]]$properties$comments[[1]]$uid
#> [1] 11725140
#> 
#> $features[[1]]$properties$comments[[1]]$user
#> [1] "jmaspons"
#> 
#> $features[[1]]$properties$comments[[1]]$user_url
#> [1] "https://api.openstreetmap.org/user/jmaspons"
#> 
#> $features[[1]]$properties$comments[[1]]$action
#> [1] "opened"
#> 
#> $features[[1]]$properties$comments[[1]]$text
#> [1] "Pista per cotxes al Fonoll\n\nvia StreetComplete 58.2\n\nGPS Trace: https://www.openstreetmap.org/user/jmaspons/traces/11432387\n"
#> 
#> $features[[1]]$properties$comments[[1]]$html
#> [1] "<p>Pista per cotxes al Fonoll</p>\n\n<p>via StreetComplete 58.2</p>\n\n<p>GPS Trace: <a href=\"https://www.openstreetmap.org/user/jmaspons/traces/11432387\" rel=\"nofollow noopener noreferrer\">https://www.openstreetmap.org/user/jmaspons/traces/11432387</a>\n</p>"
#> 
#> 
#> 
#> 
#> 
#> $features[[2]]
#> $features[[2]]$type
#> [1] "Feature"
#> 
#> $features[[2]]$geometry
#> $features[[2]]$geometry$type
#> [1] "Point"
#> 
#> $features[[2]]$geometry$coordinates
#> $features[[2]]$geometry$coordinates[[1]]
#> [1] 1.887865
#> 
#> $features[[2]]$geometry$coordinates[[2]]
#> [1] 41.57131
#> 
#> 
#> 
#> $features[[2]]$properties
#> $features[[2]]$properties$id
#> [1] 2981309
#> 
#> $features[[2]]$properties$url
#> [1] "https://api.openstreetmap.org/api/0.6/notes/2981309.json"
#> 
#> $features[[2]]$properties$comment_url
#> [1] "https://api.openstreetmap.org/api/0.6/notes/2981309/comment.json"
#> 
#> $features[[2]]$properties$close_url
#> [1] "https://api.openstreetmap.org/api/0.6/notes/2981309/close.json"
#> 
#> $features[[2]]$properties$date_created
#> [1] "2021-12-23 22:15:24 UTC"
#> 
#> $features[[2]]$properties$status
#> [1] "open"
#> 
#> $features[[2]]$properties$comments
#> $features[[2]]$properties$comments[[1]]
#> $features[[2]]$properties$comments[[1]]$date
#> [1] "2021-12-23 22:15:24 UTC"
#> 
#> $features[[2]]$properties$comments[[1]]$uid
#> [1] 11725140
#> 
#> $features[[2]]$properties$comments[[1]]$user
#> [1] "jmaspons"
#> 
#> $features[[2]]$properties$comments[[1]]$user_url
#> [1] "https://api.openstreetmap.org/user/jmaspons"
#> 
#> $features[[2]]$properties$comments[[1]]$action
#> [1] "opened"
#> 
#> $features[[2]]$properties$comments[[1]]$text
#> [1] "wikidata o wikipedia erronis? segons l'article de la wikipedia, és a https://geohack.toolforge.org/geohack.php?pagename=Les_Agulles_del_Petint%C3%B3&language=ca&params=41.6_N_1.9_E_"
#> 
#> $features[[2]]$properties$comments[[1]]$html
#> [1] "<p>wikidata o wikipedia erronis? segons l'article de la wikipedia, és a <a href=\"https://geohack.toolforge.org/geohack.php?pagename=Les_Agulles_del_Petint%C3%B3&amp;language=ca&amp;params=41.6_N_1.9_E_\" rel=\"nofollow noopener noreferrer\">https://geohack.toolforge.org/geohack.php?pagename=Les_Agulles_del_Petint%C3%B3&amp;language=ca&amp;params=41.6_N_1.9_E_</a></p>"
#> 
#> 
#> 
#> 
#> 
#> $features[[3]]
#> $features[[3]]$type
#> [1] "Feature"
#> 
#> $features[[3]]$geometry
#> $features[[3]]$geometry$type
#> [1] "Point"
#> 
#> $features[[3]]$geometry$coordinates
#> $features[[3]]$geometry$coordinates[[1]]
#> [1] 2.230423
#> 
#> $features[[3]]$geometry$coordinates[[2]]
#> [1] 41.65313
#> 
#> 
#> 
#> $features[[3]]$properties
#> $features[[3]]$properties$id
#> [1] 2953547
#> 
#> $features[[3]]$properties$url
#> [1] "https://api.openstreetmap.org/api/0.6/notes/2953547.json"
#> 
#> $features[[3]]$properties$comment_url
#> [1] "https://api.openstreetmap.org/api/0.6/notes/2953547/comment.json"
#> 
#> $features[[3]]$properties$close_url
#> [1] "https://api.openstreetmap.org/api/0.6/notes/2953547/close.json"
#> 
#> $features[[3]]$properties$date_created
#> [1] "2021-11-29 12:28:13 UTC"
#> 
#> $features[[3]]$properties$status
#> [1] "open"
#> 
#> $features[[3]]$properties$comments
#> $features[[3]]$properties$comments[[1]]
#> $features[[3]]$properties$comments[[1]]$date
#> [1] "2021-11-29 12:28:13 UTC"
#> 
#> $features[[3]]$properties$comments[[1]]$action
#> [1] "opened"
#> 
#> $features[[3]]$properties$comments[[1]]$text
#> [1] "No es la Carretera de Bigues a Lliçà de Munt, el nom correcte és Carretera de Partes a Bigues"
#> 
#> $features[[3]]$properties$comments[[1]]$html
#> [1] "<p>No es la Carretera de Bigues a Lliçà de Munt, el nom correcte és Carretera de Partes a Bigues</p>"
#> 
#> 
#> $features[[3]]$properties$comments[[2]]
#> $features[[3]]$properties$comments[[2]]$date
#> [1] "2021-12-21 21:43:14 UTC"
#> 
#> $features[[3]]$properties$comments[[2]]$uid
#> [1] 11725140
#> 
#> $features[[3]]$properties$comments[[2]]$user
#> [1] "jmaspons"
#> 
#> $features[[3]]$properties$comments[[2]]$user_url
#> [1] "https://api.openstreetmap.org/user/jmaspons"
#> 
#> $features[[3]]$properties$comments[[2]]$action
#> [1] "commented"
#> 
#> $features[[3]]$properties$comments[[2]]$text
#> [1] "Tens alguna font? No hi ha cartells per comprovar-ho sobre el terreny"
#> 
#> $features[[3]]$properties$comments[[2]]$html
#> [1] "<p>Tens alguna font? No hi ha cartells per comprovar-ho sobre el terreny</p>"
#> 
#> 
#> 
#> 
#> 
#> $features[[4]]
#> $features[[4]]$type
#> [1] "Feature"
#> 
#> $features[[4]]$geometry
#> $features[[4]]$geometry$type
#> [1] "Point"
#> 
#> $features[[4]]$geometry$coordinates
#> $features[[4]]$geometry$coordinates[[1]]
#> [1] 1.484529
#> 
#> $features[[4]]$geometry$coordinates[[2]]
#> [1] 42.00661
#> 
#> 
#> 
#> $features[[4]]$properties
#> $features[[4]]$properties$id
#> [1] 2390030
#> 
#> $features[[4]]$properties$url
#> [1] "https://api.openstreetmap.org/api/0.6/notes/2390030.json"
#> 
#> $features[[4]]$properties$comment_url
#> [1] "https://api.openstreetmap.org/api/0.6/notes/2390030/comment.json"
#> 
#> $features[[4]]$properties$close_url
#> [1] "https://api.openstreetmap.org/api/0.6/notes/2390030/close.json"
#> 
#> $features[[4]]$properties$date_created
#> [1] "2020-10-18 09:16:08 UTC"
#> 
#> $features[[4]]$properties$status
#> [1] "open"
#> 
#> $features[[4]]$properties$comments
#> $features[[4]]$properties$comments[[1]]
#> $features[[4]]$properties$comments[[1]]$date
#> [1] "2020-10-18 09:16:08 UTC"
#> 
#> $features[[4]]$properties$comments[[1]]$uid
#> [1] 11725140
#> 
#> $features[[4]]$properties$comments[[1]]$user
#> [1] "jmaspons"
#> 
#> $features[[4]]$properties$comments[[1]]$user_url
#> [1] "https://api.openstreetmap.org/user/jmaspons"
#> 
#> $features[[4]]$properties$comments[[1]]$action
#> [1] "opened"
#> 
#> $features[[4]]$properties$comments[[1]]$text
#> [1] "Wikidata i name no quadren"
#> 
#> $features[[4]]$properties$comments[[1]]$html
#> [1] "<p>Wikidata i name no quadren</p>"
#> 
#> 
#> 
#> 
#> 
#> $features[[5]]
#> $features[[5]]$type
#> [1] "Feature"
#> 
#> $features[[5]]$geometry
#> $features[[5]]$geometry$type
#> [1] "Point"
#> 
#> $features[[5]]$geometry$coordinates
#> $features[[5]]$geometry$coordinates[[1]]
#> [1] 2.183082
#> 
#> $features[[5]]$geometry$coordinates[[2]]
#> [1] 41.65117
#> 
#> 
#> 
#> $features[[5]]$properties
#> $features[[5]]$properties$id
#> [1] 2339231
#> 
#> $features[[5]]$properties$url
#> [1] "https://api.openstreetmap.org/api/0.6/notes/2339231.json"
#> 
#> $features[[5]]$properties$comment_url
#> [1] "https://api.openstreetmap.org/api/0.6/notes/2339231/comment.json"
#> 
#> $features[[5]]$properties$close_url
#> [1] "https://api.openstreetmap.org/api/0.6/notes/2339231/close.json"
#> 
#> $features[[5]]$properties$date_created
#> [1] "2020-09-07 17:53:09 UTC"
#> 
#> $features[[5]]$properties$status
#> [1] "open"
#> 
#> $features[[5]]$properties$comments
#> $features[[5]]$properties$comments[[1]]
#> $features[[5]]$properties$comments[[1]]$date
#> [1] "2020-09-07 17:53:09 UTC"
#> 
#> $features[[5]]$properties$comments[[1]]$uid
#> [1] 11725140
#> 
#> $features[[5]]$properties$comments[[1]]$user
#> [1] "jmaspons"
#> 
#> $features[[5]]$properties$comments[[1]]$user_url
#> [1] "https://api.openstreetmap.org/user/jmaspons"
#> 
#> $features[[5]]$properties$comments[[1]]$action
#> [1] "opened"
#> 
#> $features[[5]]$properties$comments[[1]]$text
#> [1] "Aquí hi ha un torrent més que no pas zona agrícola. Segons ICC es diu torrent de ca la Rosa (http://www.icc.cat/vissir/index.html?9OxSpr7fI). Cal arreglar-ho"
#> 
#> $features[[5]]$properties$comments[[1]]$html
#> [1] "<p>Aquí hi ha un torrent més que no pas zona agrícola. Segons ICC es diu torrent de ca la Rosa (<a href=\"http://www.icc.cat/vissir/index.html?9OxSpr7fI\" rel=\"nofollow noopener noreferrer\">http://www.icc.cat/vissir/index.html?9OxSpr7fI</a>). Cal arreglar-ho</p>"
#> 
#> 
#> $features[[5]]$properties$comments[[2]]
#> $features[[5]]$properties$comments[[2]]$date
#> [1] "2020-09-21 07:31:25 UTC"
#> 
#> $features[[5]]$properties$comments[[2]]$uid
#> [1] 5126253
#> 
#> $features[[5]]$properties$comments[[2]]$user
#> [1] "jqngarcia"
#> 
#> $features[[5]]$properties$comments[[2]]$user_url
#> [1] "https://api.openstreetmap.org/user/jqngarcia"
#> 
#> $features[[5]]$properties$comments[[2]]$action
#> [1] "commented"
#> 
#> $features[[5]]$properties$comments[[2]]$text
#> [1] "Cambio a matorral, el tema de la Riera, no tinc clar com s'ha de fer si no porta aigua constant"
#> 
#> $features[[5]]$properties$comments[[2]]$html
#> [1] "<p>Cambio a matorral, el tema de la Riera, no tinc clar com s'ha de fer si no porta aigua constant</p>"
#> 
#> 
#> $features[[5]]$properties$comments[[3]]
#> $features[[5]]$properties$comments[[3]]$date
#> [1] "2020-09-25 09:51:56 UTC"
#> 
#> $features[[5]]$properties$comments[[3]]$uid
#> [1] 11725140
#> 
#> $features[[5]]$properties$comments[[3]]$user
#> [1] "jmaspons"
#> 
#> $features[[5]]$properties$comments[[3]]$user_url
#> [1] "https://api.openstreetmap.org/user/jmaspons"
#> 
#> $features[[5]]$properties$comments[[3]]$action
#> [1] "commented"
#> 
#> $features[[5]]$properties$comments[[3]]$text
#> [1] "El canvi a matollar millora el mapa. Pel torrent, posaria waterway=stream + intermitent=yes però amb les imatges és difícil traçar el recorregut. És millor posar-lo imprecís o no posar-lo? També hi ha un corriol. Miraré de pujar el track"
#> 
#> $features[[5]]$properties$comments[[3]]$html
#> [1] "<p>El canvi a matollar millora el mapa. Pel torrent, posaria waterway=stream + intermitent=yes però amb les imatges és difícil traçar el recorregut. És millor posar-lo imprecís o no posar-lo? També hi ha un corriol. Miraré de pujar el track</p>"
#> 
#> 
#> 
#> 
#> 
#>