Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

License

NotificationsYou must be signed in to change notification settings

perliedman/query-overpass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Greenkeeper badge

query-overpassNPM versionBuild Status

Make queries toOpenStreetMap'soverpass API and output asGeoJSON.

cli

install:

$ 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 examplegeojsonio-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 http://my.overpass-provider.org/

The default is to usehttps://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-properties

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

usage

Installation is easy with npm:

$ npm install query-overpass

api

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 containingmessage andstatusCode if an error occured, orundefined ifno 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.
  • flatProperties which will default tofalse.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp