Scripts are built from TypeScript using npm run build
.
Scrip: buffer.js
Source: src/buffer.ts
The buffer.js
script will generate a buffer (specified in meters) around each feature in a specified GeoJSON file. The result will be generated in the same folder as the specified GeoJSON file.
node "buffers.js" -r 10 "path/to/myfile.geojson" "buffers.geojson"
OR
node "buffers.js" --radius=10 "path/to/myfile.geojson" "buffers.geojson"
Scrip: convert-tags.js
Source: src/convert-tags.ts
The convert-tags.js
script will convert source data field (from a specified GeoJSON file) to OpenStreetMap tag(s) based on a configuration file. The result will be generated in the same folder as the specified GeoJSON file.
node "convert-tags.js" -c "path/to/convert.json" "path/to/mysource.geojson" "tagged.geojson"
{
"MYSOURCEFIELD": {
"VALUE1": {
"OSMTAG1": "OSMTAG1_VALUE",
"OSMTAG2": "OSMTAG2_VALUE",
...
},
"VALUES2": {
...
},
...
},
...
}
You can use *
as value (see VALUE1
or VALUE2
in the example above) to specify all values.
See Brussels, Belgium configuration file or Flanders, Belgium configuration file for reference.
Scrip: difference.js
Source: src/difference.ts
Using TileReduce, the process does tile by tile:
- Normalize all roads and buffers in current tile
- Flatten all roads and buffers in current tile
- Merge all the OpenStreetMap (+ Map Roulette) with() in current tile
- Get all roads that are not entirely within the merged buffer in current tile
node "difference.js" --output-dir="path/to/directory" "path/to/mysource.mbtiles" "path/to/mybuffers.mbtiles"
Contains statistics about the difference process:
- Coordinates of the tile (
[x, y, zoom_level]
) - Number of roads in the tile
- Number of buffers in the tile
- Number of roads that are not entirely within the merged buffer in the tile
Contains all the roads that are not entirely within the buffers.