Make queries to OpenStreetMap's overpass API and output as GeoJSON.
install:
$ npm install -g query-overpassuse (Bash):
$ echo 'node(57.7,11.9,57.8,12.0)[amenity=bar];out;' | query-overpassuse (Windows cmd):
$ echo node(57.7,11.9,57.8,12.0)[amenity=bar];out; | query-overpassOptionally, a file containing the query can be passed as the first argument:
$ query-overpass query.qlGoes 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 | geojsonioYou can also provide the URL where the Overpass API is located:
$ query-overpass --overpass-url http://my.overpass-provider.org/The default is to use https://overpass-api.de/api/interpreter.
You can also flatten each GeoJSON feature, making it more easily processable by other software and tools
$ query-overpass --flat-propertiesThe default behaviour, without adding --flat-properties is to use false to be consistent with previous version.
Installation is easy with npm:
$ npm install query-overpassquery-overpass exports a single function:
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'https://overpass-api.de/api/interpreter'unless specified.flatPropertieswhich will default tofalse.