
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
get-overpass
Advanced tools
Get OpenStreetMap objects via the Overpass API as GeoJSON
$ npm install -g get-overpass
$ get-overpass relation/3082668 > buenos-aires.geojson
$ get-overpass [-a/--api-endpoint url] [-m/--mapbox-ids] <OSM ID>
get-overpass
exports a single function which returns a promise.
function getOverpass(osmId, mapboxIds = false, apiEndpoint = "https://overpass-api.de/api/interpreter") => new Promise()
Example:
const getOverpass = require('get-overpass')
getOverpass('relation/3082668')
.then(data => console.log("Buenos Aires:", data)
.catch(error => console.log("DOH!", error.message)
There are two valid formats for OSM identifiers:
{OSM type}/{OSM ID of that type}
{OSM node ID} * 10
{OSM way ID} * 10 + 1
{OSM relation ID} * 10 + 4
Examples of valid and equivalent OSM IDs are (osmtogeojson format, mapbox format):
relation/3082668
, 30826684
way/213576258
, 2135762581
node/4497495008
, 44974950080
Only the primary OSM types relation
, way
, and node
are supported, other types (ie area
) are not supported.
-a
/--api-endpoint
/apiEndpoint
Use the given url as an Overpass API endpoint. If not set, the default public Overpass API instance https://overpass-api.de/api/interpreter
will be used. Note that general 'be friendly' data usage limits apply to the default endpoint.
-m
/--mapbox-ids
/mapboxIds
Format IDs in the output in Mapbox format. If not set, ID's will be in the default OSMtoGeoJSON format.
One way to do this is to use the 'query features' tool (the question mark on the right of the interface) at https://www.openstreetmap.org/.
Under the hood, this tool uses osmtogeojson to build geojson from result sets. There are some OSM structures, particularly some relations
, that it appears that osmtogeojson is unable to convert to geojson.
Maybe. OpenStreetMap data is licensed under the ODbL. Attribution is required, and derivative works must also be licensed under the ODbL.
Inspired by and makes heavy use of Per Liedman's query-overpass.
FAQs
Get OpenStreetMap objects via the Overpass API as GeoJSON
The npm package get-overpass receives a total of 1 weekly downloads. As such, get-overpass popularity was classified as not popular.
We found that get-overpass demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.