All Projects → simonepri → osm-geojson

simonepri / osm-geojson

Licence: MIT license
🔰 Get GeoJSON of a OpenStreetMap's relation from the API.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to osm-geojson

osm-static-maps
Openstreetmap static maps is a nodejs lib, CLI and server open source inspired on google static map service
Stars: ✭ 130 (+209.52%)
Mutual labels:  geojson, maps, openstreetmap
Mapbox Gl Native Android
Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL
Stars: ✭ 135 (+221.43%)
Mutual labels:  geojson, maps, openstreetmap
Mapbox Gl Native
Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
Stars: ✭ 4,091 (+9640.48%)
Mutual labels:  geojson, maps, openstreetmap
planetiler
Flexible tool to build planet-scale vector tilesets from OpenStreetMap data fast
Stars: ✭ 823 (+1859.52%)
Mutual labels:  maps, openstreetmap
orange3-geo
🍊 🌍 Orange add-on for dealing with geography and geo-location
Stars: ✭ 22 (-47.62%)
Mutual labels:  maps, openstreetmap
geojson-editor
A modified version of Googles Simple GeoJSON Editor
Stars: ✭ 43 (+2.38%)
Mutual labels:  geojson, maps
osm-extracts
Each day, OSM Extracts by Interline mirrors the entire OpenStreetMap planet and creates city and region sized extracts
Stars: ✭ 34 (-19.05%)
Mutual labels:  maps, openstreetmap
openstreetmap-carto-vector-tiles
A general-purpose OpenStreetMap mapnik style, in CartoCSS, served with vector tiles
Stars: ✭ 46 (+9.52%)
Mutual labels:  maps, openstreetmap
geoJSON-Nepal
GeoJSON for Nepal. 🇳🇵
Stars: ✭ 49 (+16.67%)
Mutual labels:  geojson, maps
geofiddle
Geometric conversions between different formats and projections
Stars: ✭ 15 (-64.29%)
Mutual labels:  geojson, maps
GPXSee-maps
GPXSee maps
Stars: ✭ 27 (-35.71%)
Mutual labels:  maps, openstreetmap
trackanimation
Track Animation is a Python 2 and 3 library that provides an easy and user-adjustable way of creating visualizations from GPS data.
Stars: ✭ 74 (+76.19%)
Mutual labels:  maps, openstreetmap
echarty
Minimal R/Shiny Interface to ECharts.js
Stars: ✭ 49 (+16.67%)
Mutual labels:  geojson, maps
Mapstore2
Modern webmapping with OpenLayers, Leaflet and React
Stars: ✭ 251 (+497.62%)
Mutual labels:  geojson, maps
osmscout-sailfish
OSM Scout for Sailfish OS (offline maps and navigation)
Stars: ✭ 42 (+0%)
Mutual labels:  maps, openstreetmap
Mapboxstatic.swift
Static map snapshots with overlays in Swift or Objective-C on iOS, macOS, tvOS, and watchOS
Stars: ✭ 162 (+285.71%)
Mutual labels:  geojson, openstreetmap
Geojsonify
Easily add GeoJson layers to your Maps
Stars: ✭ 141 (+235.71%)
Mutual labels:  geojson, maps
vaguely-rude-places
The map of Vaguely Rude Place Names
Stars: ✭ 19 (-54.76%)
Mutual labels:  geojson, maps
Country Iso
🗺 Get the ISO 3166-1 alpha-3 country code from geographic coordinates.
Stars: ✭ 141 (+235.71%)
Mutual labels:  geojson, maps
openstreetmap-americana
A quintessentially American map style
Stars: ✭ 89 (+111.9%)
Mutual labels:  maps, openstreetmap

osm-geojson

Latest version on npm Downloads on npm Project license
Lint status Test macOS status Test Ubuntu status Test Windows status
Codecov Coverage report Known Vulnerabilities Dependency Status
XO Code Style used AVA Test Runner used Istanbul Test Coverage used NI Scaffolding System used NP Release System used

🔰 Get GeoJSON of a OpenStreetMap's relation from the API.
Coded with ❤️ by Simone Primarosa.

Install

$ npm install --save osm-geojson

Usage

const osmGeoJson = require('osm-geojson');

osmGeoJson.get('365331'); // Italy
// => { type: 'GeometryCollection', geometries: [ { type: 'MultiPolygon', coordinates: [Array] } ] }

osmGeoJson.getAll({'ITA': '365331', 'USA': '148838'}); // Italy
// => {
// 'ITA': { type: 'GeometryCollection', geometries: [ { type: 'MultiPolygon', coordinates: [Array] } ] },
// 'USA': { type: 'GeometryCollection', geometries: [ { type: 'MultiPolygon', coordinates: [Array] } ] }
// }

CLI

Install

To use the CLI just install the package globally.

$ npm install --g osm-geojson

Or run it with npx if you are not planning to use it more than once.

$ npx osm-geojson

Help

Usage
  $ osm-geojson <osmId>
  $ osm-geojson -l [<osmId>:<filename>]+
Options
  -l  --list [<osmId>:<filename>]+   To fetch a list of osmIds. Each relation
                                     will be saved in a file called
                                     filename.geojson
  -p --pretty                        To beautify the outputted JSON.
Examples
  $ osm-geojson 365331
  $ osm-geojson -p 365331
  $ osm-geojson -p 365331 > filename.geojson
  $ osm-geojson -l 365331:ita 148838:usa

API

get(osmid) ⇒ Promise.<object>

Returns the GeoJSON of a particular OSM relation id.

Returns: Promise.<object> - A promise that contains the GeoJSON of the given relation.

Param Type Description
osmid string Relation id from which extract the GeoJSON.

getAll(map) ⇒ Promise.<object>

Returns a map of GeoJSON of multiple OSM relation ids.

Returns: Promise.<object> - A promise that contains the map with the same keys of the map provided but with the GeoJSON of the given relation id as value.

Param Type Description
map object Map from a name to a relation id from which extract the GeoJSON.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the license file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].