The concept of batched uploads is still very new and the approach is flimsy at best, though it works. It's important to know how to use batches otherwise you may end up duplicating buildings on Polygon City.
If you're adding a new batch of buildings: make sure the batchID
config string is empty and the importer will create a new batch on Polygon City.
If you're continuing an existing batch: make sure the batchID
config option is set to the ID string you received previously when uploading a new batch. This will ensure that only buildings not already added are uploaded. Be sure this is correct as otherwise the buildings will be added to Polygon City again but using a different batch ID - they will be duplicated.
- Export some CityGML models into OBJ using citygml-to-obj
- Open the directory for this repo and run
npm install
- Approach 1: Using the config.js file (recommended)
- Rename
config.sample.js
toconfig.js
and update the settings - Run the script using
node index.js --dir /path/to/obj/directory
- Rename
- Approach 2: Using the terminal
- Run
node index.js --dir /path/to/obj/directory
and follow the instructions
- Run
- Wait for it to finish - it can take a while
- Re-run with the previous batch ID should anything go wrong. It's worth doing this anyway as it serves as a check to ensure everything was added ok.
- Check the newly added buildings in Polygon City
- This only works with OBJ files created using citygml-to-obj due to the way origin data is stored
- Ensure that you define the projection in the config file or terminal setup as a proj4js definition string
- eg.
"+proj=longlat +datum=WGS84 +no_defs"
- You can find out the proj4js definition from epsg.io
- The
licenceType
config option currently only acceptsCC-BY
orCC0
as values