Compare commits
2 Commits
c28741d751
...
ad68cbdb9e
Author | SHA1 | Date | |
---|---|---|---|
ad68cbdb9e | |||
cb87b60c48 |
@ -15,6 +15,7 @@ import utils from './mappings/utils'
|
|||||||
import mappingRouenParkingVelos from "./mappings/converters/configRouen_OpenData_velo_parkings";
|
import mappingRouenParkingVelos from "./mappings/converters/configRouen_OpenData_velo_parkings";
|
||||||
import mappingFINESS from "./mappings/converters/configFINESS";
|
import mappingFINESS from "./mappings/converters/configFINESS";
|
||||||
|
|
||||||
|
const limitWarningPercentageChangeInPoints = 5; // show a warning when more than N percent of the number of points changed
|
||||||
const allowed_configs = ['mappingIssy2Roues', 'mappingConfigIRVE', 'mappingConfigIRVEFromOsmose', 'mappingConfigIRVE_simple', 'mappingTest', 'ConfigIRVE', 'mappingRouenParkingVelos','mappingFINESS'];
|
const allowed_configs = ['mappingIssy2Roues', 'mappingConfigIRVE', 'mappingConfigIRVEFromOsmose', 'mappingConfigIRVE_simple', 'mappingTest', 'ConfigIRVE', 'mappingRouenParkingVelos','mappingFINESS'];
|
||||||
|
|
||||||
const minimist = require('minimist')
|
const minimist = require('minimist')
|
||||||
@ -171,13 +172,12 @@ function convertDataFromSource(sourceFilePath: string, mapping: MappingConfigTyp
|
|||||||
list_of_points = list_of_points.splice(0, mapping.filters.offset)
|
list_of_points = list_of_points.splice(0, mapping.filters.offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('list_of_points.length', list_of_points.length)
|
console.log('features count before:', list_of_points.length)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* filtering
|
* filtering
|
||||||
* run filters before mapping OSM tags
|
* run filters before mapping OSM tags
|
||||||
* TODO: do it in the engine
|
|
||||||
*/
|
*/
|
||||||
if (mapping.filters && mapping.filters.exclude_point_if_tag_not_empty) {
|
if (mapping.filters && mapping.filters.exclude_point_if_tag_not_empty) {
|
||||||
list_of_points = Mapping_engine.filterListOfPointsByExcludingIfKeyFilled(list_of_points, mapping.filters.exclude_point_if_tag_not_empty)
|
list_of_points = Mapping_engine.filterListOfPointsByExcludingIfKeyFilled(list_of_points, mapping.filters.exclude_point_if_tag_not_empty)
|
||||||
@ -278,16 +278,18 @@ function convertDataFromSource(sourceFilePath: string, mapping: MappingConfigTyp
|
|||||||
}
|
}
|
||||||
let fileNameToWrite = '_' + filteredName + output_supplement + '.geojson'
|
let fileNameToWrite = '_' + filteredName + output_supplement + '.geojson'
|
||||||
console.log('converted features:', converted_geo_json.features.length)
|
console.log('converted features:', converted_geo_json.features.length)
|
||||||
console.log('diff: ', data_transformed.features.length - converted_geo_json.features.length)
|
console.log('différences nombre de features: ', data_transformed.features.length - converted_geo_json.features.length)
|
||||||
let percentChange = 100 - ((1 - (data_transformed.features.length / converted_geo_json.features.length)) * -1)
|
|
||||||
|
const percentChange = (data_transformed.features.length - converted_geo_json.features.length) / converted_geo_json.features.length * 100;
|
||||||
console.log('Changement de features', percentChange, '%')
|
console.log('Changement de features', percentChange, '%')
|
||||||
if (percentChange > 5) {
|
|
||||||
|
if (percentChange > limitWarningPercentageChangeInPoints) {
|
||||||
console.log(' /!\\ pas mal de points en moins, plus de ' + percentChange + '%')
|
console.log(' /!\\ pas mal de points en moins, plus de ' + percentChange + '%')
|
||||||
}
|
}
|
||||||
debugLog('convert : write file ', fileNameToWrite)
|
debugLog('convert : write file ', fileNameToWrite)
|
||||||
|
|
||||||
// console.log('mapping_engine.stats', Mapping_engine.stats)
|
// console.log('mapping_engine.stats', Mapping_engine.stats)
|
||||||
console.log('mapping config name', Mapping_engine.getConfig().config_name)
|
console.log('mapping config name:', Mapping_engine.getConfig().config_name)
|
||||||
writeFile(fileNameToWrite, JSON.stringify(converted_geo_json, null, 2))
|
writeFile(fileNameToWrite, JSON.stringify(converted_geo_json, null, 2))
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -31,9 +31,13 @@ const mappingFINESS: MappingConfigType = {
|
|||||||
},
|
},
|
||||||
nofinesset: 'ref:FR:FINESS:et',
|
nofinesset: 'ref:FR:FINESS:et',
|
||||||
nofinessej: 'ref:FR:FINESS:ej',
|
nofinessej: 'ref:FR:FINESS:ej',
|
||||||
|
codemft: 'ref:FR:code_mft',
|
||||||
|
datemaj_structure: 'date:structure:update',
|
||||||
|
datemaj_geo: 'date:geolocalisation:update',
|
||||||
// categetab: 'ref:FR:categtab',
|
// categetab: 'ref:FR:categtab',
|
||||||
epci_code: 'ref:FR:code_EPCI',
|
epci_code: 'ref:FR:code_EPCI',
|
||||||
epci_name: 'ref:FR:EPCI',
|
epci_name: 'ref:FR:EPCI',
|
||||||
|
categagretab: 'ref:FR:FINESS:category_agreg',
|
||||||
codeape: 'ref:FR:NAF', // https://wiki.openstreetmap.org/wiki/FR:Key:ref:FR:NAF
|
codeape: 'ref:FR:NAF', // https://wiki.openstreetmap.org/wiki/FR:Key:ref:FR:NAF
|
||||||
// categtab: 'type:FR:FINESS',
|
// categtab: 'type:FR:FINESS',
|
||||||
dateouv: 'start_date',
|
dateouv: 'start_date',
|
||||||
@ -47,17 +51,83 @@ const mappingFINESS: MappingConfigType = {
|
|||||||
convert_to_phone: true,
|
convert_to_phone: true,
|
||||||
},
|
},
|
||||||
categetab: {
|
categetab: {
|
||||||
// remove_original_key: true,
|
remove_original_key: true,
|
||||||
key_converted: 'ref:FR:FINESS:category',
|
key_converted: 'type:FR:FINESS',
|
||||||
conditional_values: {
|
conditional_values: {
|
||||||
|
// doc https://wiki.openstreetmap.org/wiki/FR:Key:type:FR:FINESS
|
||||||
|
// Centre Hospitalier Régional
|
||||||
|
101: {
|
||||||
|
tags_to_add: {
|
||||||
|
"amenity": "hospital",
|
||||||
|
"emergency": "yes",
|
||||||
|
"healthcare:speciality": "psychiatry",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Centre Hospitalier ex Hôpital local
|
||||||
|
106: {
|
||||||
|
tags_to_add: {
|
||||||
|
"amenity": "hospital",
|
||||||
|
"emergency": "yes",
|
||||||
|
"healthcare:speciality": "psychiatry",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Soins de Suite et Réadaptation
|
||||||
|
109: {
|
||||||
|
tags_to_add: {
|
||||||
|
"amenity": "hospital",
|
||||||
|
"healthcare:speciality": "psychiatry",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Hôpital des armées
|
||||||
|
114: {
|
||||||
|
tags_to_add: {
|
||||||
|
"amenity": "hospital",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//Établissement de Soins Obstétriques Chirurgico-Gynécologiques
|
||||||
|
122: {
|
||||||
|
tags_to_add: {
|
||||||
|
"amenity": "hospital",
|
||||||
|
"healthcare:speciality": "obstetrics"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Centre de Santé
|
||||||
|
124: {
|
||||||
|
tags_to_add: {
|
||||||
|
"healthcare": "center",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// Centre de Santé Dentaire
|
||||||
|
125: {
|
||||||
|
tags_to_add: {
|
||||||
|
"amenity": "dentist",
|
||||||
|
"healthcare": "dentist",
|
||||||
|
"healthcare:speciality": "dentist",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Centre Médico-Psychologique (C.M.P.)
|
||||||
|
156: {
|
||||||
|
tags_to_add: {
|
||||||
|
"healthcare": "centre",
|
||||||
|
"healthcare:speciality": "psychiatry"
|
||||||
|
}
|
||||||
|
},
|
||||||
// "Laboratoires de Biologie Médicale": {
|
// "Laboratoires de Biologie Médicale": {
|
||||||
611: {
|
611: {
|
||||||
tags_to_add: {
|
tags_to_add: {
|
||||||
"healthcare": "laboratory"
|
"healthcare": "laboratory"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// Centre d'Accueil Th\u00e9rapeutique \u00e0 temps partiel (C.A.T.T.P.)
|
||||||
|
425: {
|
||||||
|
tags_to_add: {
|
||||||
|
"healthcare": "centre",
|
||||||
|
"healthcare:speciality": "psychiatry"
|
||||||
|
}
|
||||||
|
},
|
||||||
// "Centre Hospitalier (C.H.)": {
|
// "Centre Hospitalier (C.H.)": {
|
||||||
"412": {
|
412: {
|
||||||
tags_to_add: {
|
tags_to_add: {
|
||||||
"amenity": "hospital",
|
"amenity": "hospital",
|
||||||
"healthcare": "hospital"
|
"healthcare": "hospital"
|
||||||
@ -70,7 +140,7 @@ const mappingFINESS: MappingConfigType = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// "Maison de santé (L.6223-3)": {
|
// "Maison de santé (L.6223-3)": {
|
||||||
"603": {
|
603: {
|
||||||
tags_to_add: {
|
tags_to_add: {
|
||||||
"healthcare": "centre"
|
"healthcare": "centre"
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user