I'm trying to convert all geojson files from a folder into topojson files in another folder.
- I want the same number of files, same file names.
- I want to keep the data properties (polygon styles, names, ids, etc)
The command I'm running for one file is working fine :
topojson -o topojson/filename.json geojson/filename.json -p
But to target all files I tried many things like this :
topojson -o topojson/*.json geojson/*.json -p
...but I keep getting this kind of error :
$ topojson -o /topojson/*.json geojson/*.json -p
bounds: 2.2547809 48.8183713 2.412474 48.8994609 (spherical)
pre-quantization: 0.0175m (1.58e-7°) 0.00902m (8.11e-8°)
topology: 111711 arcs, 357075 points
post-quantization: 1.75m (0.0000158°) 0.902m (0.00000811°)
prune: retained 111711 / 111711 arcs (100%)
fs.js:549
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open 'C:\projectname\topojson\*.json'
at Error (native)
at Object.fs.openSync (fs.js:549:18)
at Object.fs.writeFileSync (fs.js:1161:15)
at Object.module.exports [as writeFileSync] (C:\Users\my_username\AppData\Roaming\npm\node_modules\topojson\node_modules\rw\lib\rw\write-file-sync.js:14:8)
at output (C:\Users\my_username\AppData\Roaming\npm\node_modules\topojson\bin\topojson:313:6)
at notify (C:\Users\my_username\AppData\Roaming\npm\node_modules\topojson\node_modules\queue-async\queue.js:47:18)
at Object.q.await (C:\Users\my_username\AppData\Roaming\npm\node_modules\topojson\node_modules\queue-async\queue.js:62:25)
at Object. (C:\Users\my_username\AppData\Roaming\npm\node_modules\topojson\bin\topojson:201:3)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
It's working when you combine all geojson files into one topojson file but I can't find how to write as many files as found in source folder.
Thanks for your help !