A quickie script to read in a directory of dxf files, strip out most of the layers, and write to SVG and JSON formats.
Used as the first stage of My Mapping Project.
-
Copy all dxf files into
./dxf
. -
npm start
This will generate svg files for each layer in the svg/
directory, and convert each layer to JSON in the json/
directory.
The script in upload.js
can be used to push complete building objects into the mongo database.
- Clone and setup the main mapping app in a separate directory.
- Start the mapping application with
docker-compose up
- In this directory, run
npm run upload
This script uses the fs.Promises API, which requires node >= 10.0.0
.