This commit is contained in:
parent
3a51582123
commit
48be6a7923
|
@ -22,23 +22,27 @@ function convertChargemapFile(sourceFilePath: string) {
|
||||||
|
|
||||||
let new_point: any = {...base_point}
|
let new_point: any = {...base_point}
|
||||||
|
|
||||||
if (item.type === 'point') {
|
if (item.type == 'point') {
|
||||||
|
|
||||||
new_point.geometry.coordinates = [
|
new_point.geometry.coordinates = [
|
||||||
item.properties?.lat,
|
item.properties?.lat,
|
||||||
item.properties?.lng,
|
item.properties?.lng,
|
||||||
]
|
]
|
||||||
|
|
||||||
} else if (item.type === 'pool' && item.pool) {
|
} else if (item.type == 'pool' ) {
|
||||||
new_point.geometry.coordinates = [
|
new_point.geometry.coordinates = [
|
||||||
item.pool.gps_coordinates.lon,
|
item.pool.gps_coordinates.lon,
|
||||||
item.pool.gps_coordinates.lat,
|
item.pool.gps_coordinates.lat,
|
||||||
]
|
]
|
||||||
|
console.log('new_point.geometry.coordinates', new_point.geometry.coordinates)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
base_dataset.features.push(new_point)
|
base_dataset.features.push(new_point)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
console.log('base_dataset.features.length', base_dataset.features.length)
|
||||||
if(base_dataset){
|
if(base_dataset){
|
||||||
|
|
||||||
writeFile('hurepoix_geojson.json', JSON.stringify(base_dataset, null, 2))
|
writeFile('hurepoix_geojson.json', JSON.stringify(base_dataset, null, 2))
|
||||||
|
|
|
@ -1,4 +1 @@
|
||||||
<osm version="0.6" generator="geojsontoosm">
|
<osm version="0.6" generator="geojsontoosm"><node id="-1" lat="48.6579437" lon="2.2700457999999997"><tag k="amenity" v="charging_station"/></node></osm>
|
||||||
<node id="-1" lat="48.6579437" lon="2.2700457999999997">
|
|
||||||
<tag k="amenity" v="charging_station"/>
|
|
||||||
</node></osm>
|
|
Loading…
Reference in New Issue