@osm-editor-kit/osm-route-snapper 0.1.0-alpha.1 → 0.1.0-alpha.2
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 +1 -3
- package/dist/index.js +4 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -28,9 +28,7 @@ import {
|
|
|
28
28
|
|
|
29
29
|
```ts
|
|
30
30
|
const graphBytes = await buildRouteSnapperGraphBytes(parsedOsm)
|
|
31
|
-
const routingNetwork = graphBytes
|
|
32
|
-
? await routingNetworkGeoJsonFromBytes(graphBytes)
|
|
33
|
-
: null
|
|
31
|
+
const routingNetwork = graphBytes ? await routingNetworkGeoJsonFromBytes(graphBytes) : null
|
|
34
32
|
```
|
|
35
33
|
|
|
36
34
|
**React + TanStack Query** — `createRouteSnapperGraphApi` wires coverage growth to automatic full rebuilds (WASM has no incremental API):
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,8 @@ import initOsmToRouteSnapper, { convert } from '../vendor/osm-to-route-snapper/o
|
|
|
2
2
|
import { useQuery } from '@tanstack/react-query';
|
|
3
3
|
import initRouteSnapper, { JsRouteSnapper } from 'route-snapper';
|
|
4
4
|
|
|
5
|
+
// src/build-graph.ts
|
|
6
|
+
|
|
5
7
|
// src/parsed-osm-to-xml.ts
|
|
6
8
|
function escapeXml(value) {
|
|
7
9
|
return value.replaceAll("&", "&").replaceAll('"', """).replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">");
|
|
@@ -33,6 +35,8 @@ function parsedOsmToXml(data) {
|
|
|
33
35
|
const ways = Object.values(data.ways).map(renderWay).join("");
|
|
34
36
|
return `<?xml version="1.0" encoding="UTF-8"?><osm version="0.6" generator="osm-route-snapper">${nodes}${ways}</osm>`;
|
|
35
37
|
}
|
|
38
|
+
|
|
39
|
+
// src/build-graph.ts
|
|
36
40
|
var initPromise;
|
|
37
41
|
async function ensureOsmToRouteSnapperReady() {
|
|
38
42
|
if (!initPromise) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osm-editor-kit/osm-route-snapper",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
4
|
"description": "Build route-snapper graph bytes and routing-network GeoJSON from parsed OSM coverage (WASM).",
|
|
5
|
+
"homepage": "https://github.com/osmberlin/street-space-editor/tree/main/packages/osm-route-snapper",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"author": "Tobias Jordans",
|
|
7
8
|
"repository": {
|
|
@@ -9,13 +10,12 @@
|
|
|
9
10
|
"url": "git+https://github.com/osmberlin/street-space-editor.git",
|
|
10
11
|
"directory": "packages/osm-route-snapper"
|
|
11
12
|
},
|
|
12
|
-
"homepage": "https://github.com/osmberlin/street-space-editor/tree/main/packages/osm-route-snapper",
|
|
13
|
-
"type": "module",
|
|
14
|
-
"sideEffects": false,
|
|
15
13
|
"files": [
|
|
16
14
|
"dist",
|
|
17
15
|
"vendor"
|
|
18
16
|
],
|
|
17
|
+
"type": "module",
|
|
18
|
+
"sideEffects": false,
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"postpack": "bun ../../scripts/package-exports-restore.ts"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@osm-editor-kit/osm-data": "
|
|
40
|
+
"@osm-editor-kit/osm-data": "^0.1.0-alpha.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/geojson": "^7946.0.16",
|