JPGIS GML to GeoJSON converter
npm install jpgis-convert
JPGIS GML to GeoJSON converter for building peripheral lines (=BldA) for node.
```
npm i jpgis-convert
``
const convert = require('jpgis-convert');
convert(['input1.xml', 'input2.xml'], {
output: 'output.geojson'
});
- files - `Array` of `String` of BldA.xml file path`
- options:
- output` - `String` of an output file path. If you don't set it, `convert()` outputs to `stdout`.`
- typeIds` - `Object` of building type name to ID mapper. Default:`
`
{
'普通建物': 0,
'堅ろう建物': 1,
'普通無壁舎': 2,
'堅ろう無壁舎': 3
}
`
- ignoreTypes` - Building type name `Set` to ignore.`
- callback - The Function` is called when `convert()` finished. It takes no arguments.
A full option example:
``
const convert = require('jpgis-convert');
convert(['input1.xml', 'input2.xml'], {
output: 'output.geojson',
typeIds: {
'普通建物': 0,
'堅ろう建物': 1
},
ignoreTypes: new Set(['普通無壁舎', '堅ろう無壁舎'])
}, () => console.log('finished'));
In May 2016, I found the tool FGDV of the government of Japan can't handle coordinates in `` tags in `` as individual ring. Coordinates in `` and ``` tags are merged to a ring. It converts JPGIS GML to broken shape files. PSEA had a same problem. I needed a tool to convert JPGIS GML to right GeoJSON for my project.