osm2geojson-lite 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -14
- package/package.json +6 -7
- package/osm2geojson-lite +0 -8
- /package/{ts/release → dist/node}/index.d.ts +0 -0
- /package/{ts/release → dist/node}/index.js +0 -0
- /package/{ts/release → dist/node}/osmobjs.d.ts +0 -0
- /package/{ts/release → dist/node}/osmobjs.js +0 -0
- /package/{ts/release → dist/node}/polytags.json +0 -0
- /package/{ts/release → dist/node}/utils.d.ts +0 -0
- /package/{ts/release → dist/node}/utils.js +0 -0
- /package/{ts/release → dist/node}/xmlparser.d.ts +0 -0
- /package/{ts/release → dist/node}/xmlparser.js +0 -0
- /package/dist/{osm2geojson-lite.js → web/osm2geojson-lite.js} +0 -0
package/README.md
CHANGED
|
@@ -7,6 +7,12 @@ History
|
|
|
7
7
|
-----
|
|
8
8
|
An internal function inside [query-geo-boundary](https://www.npmjs.com/package/query-geo-boundary) → stripped out to handle OSM XML only [xml2geojson-lite](https://www.npmjs.com/package/xml2geojson-lite) → this library that supports both OSM XML and OSM/Overpass JSON
|
|
9
9
|
|
|
10
|
+
Changelog:
|
|
11
|
+
-----
|
|
12
|
+
* Late 2018: this repository was created and the initial version was pushed to github - almost around specific usages for myself.
|
|
13
|
+
* 2019-2025: quite a few contributors had fixed quite a few bugs and also contributed some good ideas - thanks for their efforts!
|
|
14
|
+
* 2025-03-03: fixed a few bugs around non-*Polygon features processing and convert it to a pure TypeScript project (codes published to [NPM](https://npmjs.org/) have become TSC compiled from now on).
|
|
15
|
+
|
|
10
16
|
Usage
|
|
11
17
|
-----
|
|
12
18
|
|
|
@@ -55,26 +61,25 @@ Performance
|
|
|
55
61
|
$ cd bench
|
|
56
62
|
$ node o2gl-bench.js
|
|
57
63
|
$ node otg-bench.js
|
|
58
|
-
|
|
64
|
+
```
|
|
59
65
|
1. XML
|
|
60
|
-
|
|
61
|
-
|
|
|
62
|
-
|
|
63
|
-
|
|
|
64
|
-
|
|
66
|
+
|
|
67
|
+
| zhucheng | hebei | tokyodo | usa |
|
|
68
|
+
|-----------|----------|---------|------|
|
|
69
|
+
| >2.5x | >4.0x | >3.0x | >3.0x|
|
|
70
|
+
|
|
65
71
|
2. Overpass JSON
|
|
66
|
-
|
|
67
|
-
|
|
|
68
|
-
|
|
69
|
-
|
|
|
70
|
-
|
|
71
|
-
```
|
|
72
|
+
|
|
73
|
+
| zhucheng | hebei | tokyodo | usa |
|
|
74
|
+
|-----------|----------|---------|------|
|
|
75
|
+
| >2.5x | >11.0x | >7.0x | >5.0x|
|
|
76
|
+
|
|
72
77
|
|
|
73
78
|
Correctness
|
|
74
79
|
---
|
|
75
80
|
You can copy the converted results to [geojsonlint](http://geojsonlint.com) for the correctness validation. Up until now, `osm2geojson-lite` behaves pretty well with all the samples (also quite representative) in the `data` subfolers under `test` and `bench` directories, which also outperforms `osmtogeojson`.
|
|
76
81
|
|
|
77
|
-
The client side example shipped along with this package, `index.html` will automatically call `geojsonlint` validation service directly after each conversion, you can wait for a while to see the validation result after click the conversion button.
|
|
82
|
+
The client side example shipped along with this package, `test/index.html` ~~will automatically call `geojsonlint` validation service directly after each conversion, you can wait for a while to see the validation result after click the conversion button.~~ - because the CORS limitation, the direct post to geojsonlint was blocked, so I added a "copy to clipboard" button for you to ease the validation.
|
|
78
83
|
|
|
79
84
|
Node.JS version
|
|
80
85
|
---
|
|
@@ -86,4 +91,10 @@ Dependencies
|
|
|
86
91
|
|
|
87
92
|
License
|
|
88
93
|
---
|
|
89
|
-
|
|
94
|
+
Copyleft
|
|
95
|
+
|
|
96
|
+
Collaborators
|
|
97
|
+
---
|
|
98
|
+
* tibetty
|
|
99
|
+
* HarelM
|
|
100
|
+
|
package/package.json
CHANGED
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"multipolygon"
|
|
46
46
|
],
|
|
47
47
|
"license": "ISC",
|
|
48
|
-
"main": "
|
|
49
|
-
"types": "
|
|
48
|
+
"main": "dist/node/index.js",
|
|
49
|
+
"types": "dist/node/index.d.ts",
|
|
50
50
|
"name": "osm2geojson-lite",
|
|
51
51
|
"repository": {
|
|
52
52
|
"type": "git",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"optionalDependencies": {
|
|
60
60
|
"@types/geojson": "^7946.0.16"
|
|
61
61
|
},
|
|
62
|
-
"version": "1.0.
|
|
62
|
+
"version": "1.0.3",
|
|
63
63
|
"directories": {
|
|
64
64
|
"lib": "lib",
|
|
65
65
|
"test": "test"
|
|
@@ -69,9 +69,8 @@
|
|
|
69
69
|
"uglify-js": "^3.19.3"
|
|
70
70
|
},
|
|
71
71
|
"files": [
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"dist/osm2geojson-lite.js"
|
|
72
|
+
"dist/**/*.js",
|
|
73
|
+
"dist/**/*.ts",
|
|
74
|
+
"dist/**/*.json"
|
|
76
75
|
]
|
|
77
76
|
}
|
package/osm2geojson-lite
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const osm2geojson = require('./lib/index.js');
|
|
4
|
-
const fs = require('fs');
|
|
5
|
-
|
|
6
|
-
const data = fs.readFileSync("/dev/stdin", "utf-8");
|
|
7
|
-
const geojson = osm2geojson(data, {completeFeature: true, renderTagged: true});
|
|
8
|
-
console.log(JSON.stringify(geojson));
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|