All Projects → derhuerst → query-overpass

derhuerst / query-overpass

Licence: ISC License
Query the OpenStreetMap Overpass API.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to query-overpass

bexhill-osm
A local mapping project using data from OpenStreetMap. Includes overlays, walking directions and historical information.
Stars: ✭ 16 (-5.88%)
Mutual labels:  openstreetmap, osm, overpass
Osmunda
An offline geocode library for android, powered by SQLite, using osm data. 离线地理编码Android库,基于SQLite,使用开放街道地图数据。
Stars: ✭ 37 (+117.65%)
Mutual labels:  openstreetmap, osm
gosmparse
Processing OpenStreetMap PBF files at speed with Go
Stars: ✭ 55 (+223.53%)
Mutual labels:  openstreetmap, osm
AndroidOfflineMapLibrary
Offline OpenStreet Map Library (No Internet Required) You dont have to even one-time connect!
Stars: ✭ 16 (-5.88%)
Mutual labels:  openstreetmap, osm
a11yjson
A11yJSON: A standard to describe the accessibility of the physical world.
Stars: ✭ 58 (+241.18%)
Mutual labels:  openstreetmap, osm
osmcz
JS mapová appka pro openstreetmap.cz (osmcz-app)
Stars: ✭ 35 (+105.88%)
Mutual labels:  openstreetmap, osm
Delphi OSMMap
Visual control for Delphi and Lazarus to display OSM map
Stars: ✭ 27 (+58.82%)
Mutual labels:  openstreetmap, osm
maproulette2
MapRoulette back-end / API
Stars: ✭ 46 (+170.59%)
Mutual labels:  openstreetmap, osm
mapcontrib
Thematic OpenStreetMap contribution
Stars: ✭ 63 (+270.59%)
Mutual labels:  openstreetmap, osm
oshdb
OpenStreetMap History Data Analysis Framework
Stars: ✭ 82 (+382.35%)
Mutual labels:  openstreetmap, osm
osm-data-classification
Migrated to: https://gitlab.com/Oslandia/osm-data-classification
Stars: ✭ 23 (+35.29%)
Mutual labels:  openstreetmap, osm
literan-moscow
No description or website provided.
Stars: ✭ 18 (+5.88%)
Mutual labels:  openstreetmap, osm
LightOSM.jl
A Julia package for downloading and analysing geospatial data from OpenStreetMap APIs.
Stars: ✭ 32 (+88.24%)
Mutual labels:  openstreetmap, overpass
openfairdb
Open Fair DB is the CreativCommons Backend of Kartevonmorgen.org
Stars: ✭ 53 (+211.76%)
Mutual labels:  openstreetmap, osm
osm4scala
Scala and Spark library focused on reading OpenStreetMap Pbf files.
Stars: ✭ 62 (+264.71%)
Mutual labels:  openstreetmap, osm
gazetteer
OSM ElasticSearch geocoder and addresses exporter
Stars: ✭ 93 (+447.06%)
Mutual labels:  openstreetmap, osm
osmcha
Python package to detect suspicious OSM changesets
Stars: ✭ 33 (+94.12%)
Mutual labels:  openstreetmap, osm
AndroidApp
CityZen Android App, OpenStreetMap base-map
Stars: ✭ 70 (+311.76%)
Mutual labels:  openstreetmap, osm
openstreetmap-americana
A quintessentially American map style
Stars: ✭ 89 (+423.53%)
Mutual labels:  openstreetmap, osm
NotesReview
📝 Interface for searching and resolving OpenStreetMap notes
Stars: ✭ 34 (+100%)
Mutual labels:  openstreetmap, osm

query-overpass

Query the OpenStreetMap Overpass API. Yet another implementation, because it

  • is isomorphic (works in the browser)
  • is lightweight (doesn't contain any sophisticated parser)
  • uses p-retry to resend requests

Other alternatives for you to evaluate:

npm version ISC-licensed support me via GitHub Sponsors chat with me on Twitter

Installing

npm install @derhuerst/query-overpass

Usage

Pass in a string of Overpass QL. Returns a Promise that will resolve with an array of elements.

const queryOverpass = require('@derhuerst/query-overpass')

queryOverpass(`
	[out:json][timeout:25];
	node(3378340880);
	out body;
`)
.then(console.log)
.catch(console.error)
[ {
	type: 'node',
	id: 3378340880,
	lat: 52.5145076,
	lon: 13.35011,
	tags: {
		artist: 'Friedrich Drake',
		artwork_type: 'statue',
		colour: 'gold',
		height: '66.9',
		image: 'https://upload.wikimedia.org/wikipedia/commons/2/2a/Victoria_Goldelse_Siegessaeule_Berlin.jpg',
		min_height: '58.6',
		name: 'Viktoria',
		'name:de': 'Siegessäule',
		'name:ru': 'Колонна победы',
		'name:zh': '勝利女神柱',
		reg_name: 'Goldelse',
		tourism: 'artwork',
		wheelchair: 'no'
	}
} ]

Note: The Overpass API does not support extended Overpass Turbo queries, as they are an Overpass Turbo-specific feature.

To use make requests from a web site, enable CORS using the fetchMode option:

queryOverpass(query, {fetchMode: 'cors'})

To use @derhuerst/query-overpass with a custom Overpass API endpoint, use the endpoint option:

queryOverpass(query, {endpoint: 'https://overpass.example.org'})

Related

  • osm-build-query – Build a query for the OSM Overpass API that retrieves all elements within the bounding feature.
  • osm-flatten-relation – Resolve an OpenStreetMap relation recursively.

Contributing

If you have a question or have difficulties using query-overpass, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].