Implementation of geojson2osm definition (#11037)

* Implementation of geojson2osm defintion
Many forks of this project, this definition uses the actively maintained project hosted on NPM.
https://www.npmjs.com/package/geojson2osm
Authors: @Ruby21 & @aaronlidman

* geojson2osm fixed comments
- renamed test > tests
- added space after project
@vvakame
This commit is contained in:
Denis
2016-09-07 21:16:08 +09:00
committed by Masahiro Wakame
parent 2a761971e7
commit 58c375c8bb
2 changed files with 62 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
/// <reference path="geojson2osm.d.ts" />
/// <reference path="../geojson/geojson.d.ts" />
import { geojson2osm } from 'geojson2osm'
const features: GeoJSON.FeatureCollection<any> = {
type: 'FeatureCollection',
features: [{
type: 'Feature',
properties: {
'building:colour': '#9F8169',
'building:levels': 21,
building: 'yes',
height: 57,
},
geometry: {
type: 'Polygon',
coordinates: [
[
[
-434.2249470949173,
-13.15996269397843,
],
[
-434.2249470949173,
-13.159751140560356,
],
[
-434.2242631316185,
-13.159751140560356,
],
[
-434.2242631316185,
-13.15996269397843,
],
[
-434.2249470949173,
-13.15996269397843,
],
],
],
},
},
],
}
geojson2osm(features)
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for geojson2osm 0.0.5
// Project: https://github.com/Rub21/geojson2osm
// Definitions by: Denis Carriere <https://github.com/DenisCarriere>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../geojson/geojson.d.ts" />
declare module 'geojson2osm' {
/**
* Converts GeoJSON features to OpenStreetMap XML.
* @param features Input features
* @returns OpenStreetMap XML
*/
export function geojson2osm(features: GeoJSON.Feature<any> | GeoJSON.FeatureCollection<any>): any
}