Skip to content

aaronlidman/osm-and-geojson

gh-pages
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

OSM & GeoJSON

  • Converts OSM XML to GeoJSON
  • Also converts the inverse, GeoJSON to OSM XML
  • This is a fork of OSM2GEO by tecoholic with some improvements
    • vanilla JS, no dependencies
    • multipolygon support
    • browser or nodejs
  • warning: When converting GeoJSON to OSM XML only points, polygons, and multipolygons (standalone or in feature collections) are supported right now

Usage

  • for the browser
    • <script src='osm_geojson.js'></script>
  • for nodejs
    • npm install osm-and-geojson

API

  • ####osm_geojson.osm2geojson(osmXmlStringOrDOM)

    • Parse and convert a string of OSM XML to a GeoJSON object. Add an optional second argument of true, osm_geojson.osm2geojson(yourOsm, true) to include metadata about the item in the properties, namespaced osm_*.
  • ####osm_geojson.geojson2osm(GeoJSONObject)

    • Parse and convert a GeoJSON object into OSM XML.

OSM & GeoJSON was written in the Orange Public Library. Always upstairs, the window seats are awesome but really tough to get. More often than not I'd get stuck with one of the middle tables where foot traffic was a bit much and outlets are hard to come by.

About

Converts between OSM XML and GeoJSON

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •