jpgis-convert
v1.0.4
Published
JPGIS GML to GeoJSON converter
Downloads
2
Maintainers
Readme
JPGIS GML converter
JPGIS GML to GeoJSON converter for building peripheral lines (=BldA) for node.
Installation
npm i jpgis-convert
Usage
Example
const convert = require('jpgis-convert');
convert(['input1.xml', 'input2.xml'], {
output: 'output.geojson'
});
convert(files [, options [, callback]])
- files -
Array
ofString
of BldA.xml file path - options:
output
-String
of an output file path. If you don't set it,convert()
outputs tostdout
.typeIds
-Object
of building type name to ID mapper. Default:
{ '普通建物': 0, '堅ろう建物': 1, '普通無壁舎': 2, '堅ろう無壁舎': 3 }
ignoreTypes
- Building type nameSet
to ignore.
- callback - The
Function
is 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.