mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 11:41:44 +00:00
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:
@@ -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)
|
||||
Vendored
+15
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user