Create mbtiles of vector tiles from GeoJSON tiles online, using mokuroku.csv.gz
This is a preliminary experiment.
$ git clone [email protected]:hfu/refuel.git
$ cd refuel
$ npm install
$ npm run refuel
$ tile-join -o experimental.mbtiles *.mbtiles
You need to have tippecanoe installed to run tile-join.
package.json and batch.js explains the detail of the processing. In the case of large scale tileset, you may need to run the commands one by one.
index.js is the script to download GeoJSON vector tiles, convert them to vector tiles, and the store the vector tile to a line of headless serialtiles.
The basic usage is:
$ node index.js fgd
# this will download experimental_fgd tiles and convert them.
This will have a long-lasting connection to mokuroku.csv.gz. Therefore, in the case of large tileset, you may want to download mokuroku.csv.gz beforehand to avoid timeout to the connection to mokuroku.csv.gz.
If you have fgd.mokuroku which is a copy of https://maps.gsi.go.jp/xyz/experimental_fgd/mokuroku.csv.gz, index.js can take the mokuroku as a second parameter. So, you can do as:
$ node index.js fgd fgd.mokuroku
hst2mbtiles.js is a script to create mbtiles from hst file. This is a product of a separate project called hst2mbtiles.
index.js and hst2mbtiles can be piped, or the stored and the redirected.
- binarian is the basic code to convert a GeoJSON tile to vector tile.
- stratify-spec is the specification to write a configuration for assigning a vector tile layer to a GeoJSON feature. This is necessary and data-dependent configuration when converting GeoJSON to vector tile.
- mokuroku-stream is the basic code to get tile numbers from a mokuroku.csv.gz.
- hst2mbtiles is a tool to convert headless serialtiles to mbtiles.
- kirigami is a tool to cut mokuroku into modules.