You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Per Liedman 2f87fcf95c
19 hours ago
test Fix test for node 12 on travis 3 years ago
.gitignore Initial import 9 years ago
.travis.yml Test on Node 12, drop Node 6 4 years ago add title and extension to license file 7 years ago Update 19 hours ago
cli.js Fix return outside function 6 years ago
index.js fix: moves to new supported version of xmldom 8 months ago
package-lock.json fix: moves to new supported version of xmldom 8 months ago
package.json fix: moves to new supported version of xmldom 8 months ago

Greenkeeper badge

query-overpass NPM version Build Status

Make queries to OpenStreetMap's overpass API and output as GeoJSON.



$ npm install -g query-overpass

use (Bash):

$ echo 'node(57.7,11.9,57.8,12.0)[amenity=bar];out;' | query-overpass

use (Windows cmd):

$ echo node(57.7,11.9,57.8,12.0)[amenity=bar];out; | query-overpass

Optionally, a file containing the query can be passed as the first argument:

$ query-overpass query.ql

Goes well together with other command line tools, like for example geojsonio-cli:

$ npm install -g geojsonio-cli
$ echo 'node(57.7,11.9,57.8,12.0)[amenity=bar];out;' | query-overpass | geojsonio

You can also provide the URL where the Overpass API is located:

$ query-overpass --overpass-url

The default is to use

You can also flatten each GeoJSON feature, making it more easily processable by other software and tools

$ query-overpass --flat-properties

The default behaviour, without adding --flat-properties is to use false to be consistent with previous version.


Installation is easy with npm:

$ npm install query-overpass


query-overpass exports a single function:

query_overpass(query, callback, options)

Performs the provided query and calls the callback when done. The callback is of the form

callback(error, data)

Where error is an object containing message and statusCode if an error occured, or undefined if no error occured. data will be the query response as an GeoJSON object.

The options supported at the moment are

  • overpassUrl, which will default to '' unless specified.
  • flatProperties which will default to false.