POI tools/API

From OpenStreetMap Wiki
Jump to: navigation, search
Available languages — POI tools/API
· Afrikaans · Alemannisch · aragonés · asturianu · azərbaycanca · Bahasa Indonesia · Bahasa Melayu · Bân-lâm-gú · Basa Jawa · Baso Minangkabau · bosanski · brezhoneg · català · čeština · dansk · Deutsch · eesti · English · español · Esperanto · estremeñu · euskara · français · Frysk · Gaeilge · Gàidhlig · galego · Hausa · hrvatski · Igbo · interlingua · Interlingue · isiXhosa · isiZulu · íslenska · italiano · Kiswahili · Kreyòl ayisyen · kréyòl gwadloupéyen · Kurdî · latviešu · Lëtzebuergesch · lietuvių · magyar · Malagasy · Malti · Nederlands · Nedersaksies · norsk bokmål · norsk nynorsk · occitan · Oromoo · oʻzbekcha/ўзбекча · Plattdüütsch · polski · português · português do Brasil · română · shqip · slovenčina · slovenščina · Soomaaliga · suomi · svenska · Tiếng Việt · Türkçe · Vahcuengh · vèneto · Wolof · Yorùbá · Zazaki · српски / srpski · беларуская · български · қазақша · македонски · монгол · русский · тоҷикӣ · українська · Ελληνικά · Հայերեն · ქართული · नेपाली · मराठी · हिन्दी · অসমীয়া · বাংলা · ਪੰਜਾਬੀ · ગુજરાતી · ଓଡ଼ିଆ · தமிழ் · తెలుగు · ಕನ್ನಡ · മലയാളം · සිංහල · ไทย · မြန်မာဘာသာ · ລາວ · ភាសាខ្មែរ · ⵜⴰⵎⴰⵣⵉⵖⵜ · አማርኛ · 한국어 · 日本語 · 中文(简体)‎ · 吴语 · 粵語 · 中文(繁體)‎ · ייִדיש · עברית · اردو · العربية · پښتو · سنڌي · فارسی · ދިވެހިބަސް

DBSlayer might cover any case already, but some developers need a simple API without knowing about SQL or the database schema.

Feature collection

Spatial queries

The spatial condition will be a parameter in the API.

  • anywhere: not supported by this API. You could use a bbox from -180 to 180, -90 to 90, but results will be LIMITed
  • bounding box: bbox parameter, in SQL: (long BETWEEN) AND (lat BETWEEN), good for sideways cracking
  • polygon: way parameter, first select bbox, then filter polygon intersection. Possible for closed ways (area) containing POIs.
  • multipolygon: relation parameter, see polygon. Possible for relations with type=multipolygon containing POIs.
  • geometry: user defined geometry as WKT (well-known text) or WKB (well-known binary)

Tag queries

  • by key: key/$key/{nodes,ways,relations,all}/{ids,full}.json
  • by value: value/$value/{nodes,ways,relations,all}/{ids,full}.json
  • by key and value: tag/$key/$value/{nodes,ways,relations,all}/{ids,full}.json
  • combinations of the above: (how should the URL look like?)

Additional parameters

  • buffer: buffer size in degrees (WGS84)
    example for a radius search: geometry=POINT($x $y)&buffer=0.0001

Response

ids: Return all objects and their geometry (one of {point, linestring, polygon, multipolygon}, centroid and point_on_surface for polygons, point on line for linestrings) found in the given geometry. Their id will be {node,way,relation}/$osm_id full: like ids, but include tags

Examples

  • Find all restaurants in a given bounding box: /tag/amenity/restaurant/all/ids.json?bbox=
  • Find only nodes with wikipedia tag: /key/wikipedia/nodes/full.json?relation=


Single objects

/{node,way,relation}/$osm_id returns geometry /{node,way,relation}/$osm_id/full returns geometry and tags

Formats

  • json