osm_search_notes {osmapiR}R Documentation

Search for notes

Description

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", "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), "xml", "rss", "json" or "gpx".

Details

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

Value

If format = "R", returns a data frame with one map note per row. 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.

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

my_notes <- osm_search_notes(
  user = "jmaspons", bbox = c(-0.1594133, 40.5229822, 3.322251, 42.861523),
  closed = -1, format = "json"
)
my_notes

[Package osmapiR version 0.1.0 Index]