mapshaper
mapshaper copied to clipboard
How can I use the Nodejs API input params?
Hi, I saw the wiki:
runCommands(commands[, input][, callback])
input An optional JS object containing contents of files referenced by -i command(s), indexed by file name. Input files are read from the filesystem if they are not present in the input argument.
But I didn't find a example for it.
Can I use a JS object as geojson format? What's the -i commands then?
Thank you for your excellent tools.
Sorry, I just saw your issue. There is an example of passing a data file as a JS string in the documentation for applyCommands(), here: https://github.com/mbloch/mapshaper/wiki/Using-mapshaper-programmatically#applycommands
You could use a GeoJSON object in the same way.
If you still want help with this, I'd be happy to give a more detailed explanation.