{"id":13555418,"url":"https://github.com/perliedman/query-overpass","last_synced_at":"2025-04-05T17:08:24.348Z","repository":{"id":47129700,"uuid":"22246920","full_name":"perliedman/query-overpass","owner":"perliedman","description":"Make queries to OpenStreetMap's overpass API and output as GeoJSON","archived":false,"fork":false,"pushed_at":"2023-03-28T09:28:59.000Z","size":152,"stargazers_count":153,"open_issues_count":6,"forks_count":34,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-04-14T09:40:40.189Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/perliedman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-07-25T06:09:34.000Z","updated_at":"2024-03-25T17:21:53.000Z","dependencies_parsed_at":"2023-01-23T17:45:07.470Z","dependency_job_id":"317fe878-6d79-42d8-9bc7-07bd4618de0a","html_url":"https://github.com/perliedman/query-overpass","commit_stats":{"total_commits":73,"total_committers":15,"mean_commits":4.866666666666666,"dds":0.6575342465753424,"last_synced_commit":"2f87fcf95c2dc98f28fad4e39dd45de4934f4a1b"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perliedman%2Fquery-overpass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perliedman%2Fquery-overpass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perliedman%2Fquery-overpass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perliedman%2Fquery-overpass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perliedman","download_url":"https://codeload.github.com/perliedman/query-overpass/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369952,"owners_count":20927928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T12:03:12.059Z","updated_at":"2025-04-05T17:08:24.298Z","avatar_url":"https://github.com/perliedman.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","others"],"sub_categories":[],"readme":"[![Greenkeeper badge](https://badges.greenkeeper.io/perliedman/query-overpass.svg)](https://greenkeeper.io/)\n\n# query-overpass [![NPM version](https://badge.fury.io/js/query-overpass.svg)](http://badge.fury.io/js/query-overpass) [![Build Status](https://travis-ci.org/perliedman/query-overpass.svg?branch=master)](https://travis-ci.org/perliedman/query-overpass)\n\nMake queries to [OpenStreetMap](http://www.openstreetmap.org/)'s [overpass API](http://wiki.openstreetmap.org/wiki/Overpass_API) and output as [GeoJSON](http://geojson.org/).\n\n## cli\n\ninstall:\n\n```bash\n$ npm install -g query-overpass\n```\n\nuse (Bash):\n\n```bash\n$ echo 'node(57.7,11.9,57.8,12.0)[amenity=bar];out;' | query-overpass\n```\n\nuse (Windows cmd):\n```bat\n$ echo node(57.7,11.9,57.8,12.0)[amenity=bar];out; | query-overpass\n```\n\nOptionally, a file containing the query can be passed as the first argument:\n\n```bash\n$ query-overpass query.ql\n```\n\nGoes well together with other command line tools, like for example [geojsonio-cli](https://github.com/mapbox/geojsonio-cli):\n\n```bash\n$ npm install -g geojsonio-cli\n$ echo 'node(57.7,11.9,57.8,12.0)[amenity=bar];out;' | query-overpass | geojsonio\n```\n\nYou can also provide the URL where the Overpass API is located:\n\n```bash\n$ query-overpass --overpass-url http://my.overpass-provider.org/\n```\n\nThe default is to use `https://overpass-api.de/api/interpreter`.\n\nYou can also flatten each GeoJSON feature, making it more easily processable by other software and tools\n\n```bash\n$ query-overpass --flat-properties\n```\n\nThe default behaviour, without adding `--flat-properties` is to use `false` to be consistent with previous version.\n\n## usage\n\nInstallation is easy with npm:\n\n```bash\n$ npm install query-overpass\n```\n\n## api\n\nquery-overpass exports a single function:\n\n### query_overpass(query, callback, options)\n\nPerforms the provided query and calls the callback when done. The callback is of the form\n\n```javascript\ncallback(error, data)\n```\n\nWhere error is an object containing `message` and `statusCode` if an error occured, or `undefined` if\nno error occured. `data` will be the query response as an GeoJSON object.\n\nThe options supported at the moment are\n\n* `overpassUrl`, which will default to `'https://overpass-api.de/api/interpreter'` unless specified.\n* `flatProperties` which will default to `false`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperliedman%2Fquery-overpass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperliedman%2Fquery-overpass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperliedman%2Fquery-overpass/lists"}