Compare commits

...

2 Commits

Author SHA1 Message Date
ad68cbdb9e up percent of change in points 2024-10-10 15:01:57 +02:00
cb87b60c48 up config healthcare 2024-10-10 14:22:33 +02:00
3 changed files with 358093 additions and 1010 deletions

View File

@ -15,6 +15,7 @@ import utils from './mappings/utils'
import mappingRouenParkingVelos from "./mappings/converters/configRouen_OpenData_velo_parkings";
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 minimist = require('minimist')
@ -171,13 +172,12 @@ function convertDataFromSource(sourceFilePath: string, mapping: MappingConfigTyp
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
* run filters before mapping OSM tags
* TODO: do it in the engine
*/
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)
@ -278,16 +278,18 @@ function convertDataFromSource(sourceFilePath: string, mapping: MappingConfigTyp
}
let fileNameToWrite = '_' + filteredName + output_supplement + '.geojson'
console.log('converted features:', converted_geo_json.features.length)
console.log('diff: ', data_transformed.features.length - converted_geo_json.features.length)
let percentChange = 100 - ((1 - (data_transformed.features.length / converted_geo_json.features.length)) * -1)
console.log('différences nombre de features: ', data_transformed.features.length - converted_geo_json.features.length)
const percentChange = (data_transformed.features.length - converted_geo_json.features.length) / converted_geo_json.features.length * 100;
console.log('Changement de features', percentChange, '%')
if (percentChange > 5) {
if (percentChange > limitWarningPercentageChangeInPoints) {
console.log(' /!\\ pas mal de points en moins, plus de ' + percentChange + '%')
}
debugLog('convert : write file ', fileNameToWrite)
// 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))
} else {

View File

@ -31,9 +31,13 @@ const mappingFINESS: MappingConfigType = {
},
nofinesset: 'ref:FR:FINESS:et',
nofinessej: 'ref:FR:FINESS:ej',
codemft: 'ref:FR:code_mft',
datemaj_structure: 'date:structure:update',
datemaj_geo: 'date:geolocalisation:update',
// categetab: 'ref:FR:categtab',
epci_code: 'ref:FR:code_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
// categtab: 'type:FR:FINESS',
dateouv: 'start_date',
@ -47,17 +51,83 @@ const mappingFINESS: MappingConfigType = {
convert_to_phone: true,
},
categetab: {
// remove_original_key: true,
key_converted: 'ref:FR:FINESS:category',
remove_original_key: true,
key_converted: 'type:FR:FINESS',
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": {
611: {
tags_to_add: {
"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.)": {
"412": {
412: {
tags_to_add: {
"amenity": "hospital",
"healthcare": "hospital"
@ -70,7 +140,7 @@ const mappingFINESS: MappingConfigType = {
}
},
// "Maison de santé (L.6223-3)": {
"603": {
603: {
tags_to_add: {
"healthcare": "centre"
}

File diff suppressed because it is too large Load Diff