This commit is contained in:
Tykayn 2023-08-05 22:57:22 +02:00 committed by tykayn
parent 3a51582123
commit 48be6a7923
2 changed files with 7 additions and 6 deletions

View File

@ -22,23 +22,27 @@ function convertChargemapFile(sourceFilePath: string) {
let new_point: any = {...base_point}
if (item.type === 'point') {
if (item.type == 'point') {
new_point.geometry.coordinates = [
item.properties?.lat,
item.properties?.lng,
]
} else if (item.type === 'pool' && item.pool) {
} else if (item.type == 'pool' ) {
new_point.geometry.coordinates = [
item.pool.gps_coordinates.lon,
item.pool.gps_coordinates.lat,
]
console.log('new_point.geometry.coordinates', new_point.geometry.coordinates)
}
base_dataset.features.push(new_point)
})
console.log('base_dataset.features.length', base_dataset.features.length)
if(base_dataset){
writeFile('hurepoix_geojson.json', JSON.stringify(base_dataset, null, 2))

View File

@ -1,4 +1 @@
<osm version="0.6" generator="geojsontoosm">
<node id="-1" lat="48.6579437" lon="2.2700457999999997">
<tag k="amenity" v="charging_station"/>
</node></osm>
<osm version="0.6" generator="geojsontoosm"><node id="-1" lat="48.6579437" lon="2.2700457999999997"><tag k="amenity" v="charging_station"/></node></osm>