1.0.4 • Published 6 years ago
jpgis-convert v1.0.4
JPGIS GML converter

JPGIS GML to GeoJSON converter for building peripheral lines (=BldA) for node.
Installation
npm i jpgis-convertUsage
Example
const convert = require('jpgis-convert');
convert(['input1.xml', 'input2.xml'], {
output: 'output.geojson'
});convert(files [, options , callback])
- files -
ArrayofStringof BldA.xml file path - options:
-
output-Stringof an output file path. If you don't set it,convert()outputs tostdout. -typeIds-Objectof building type name to ID mapper. Default:``` { '普通建物': 0, '堅ろう建物': 1, '普通無壁舎': 2, '堅ろう無壁舎': 3 } ``` - ```ignoreTypes``` - Building type name ```Set``` to ignore. - callback - The
Functionis called whenconvert()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'));Background and purpose
In May 2016, I found the tool FGDV of the government of Japan can't handle coordinates in <gml:interior> tags in <BldA> as individual ring. Coordinates in <gml:interior> and <gml:exterior> 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.