Compare commits
No commits in common. "ad68cbdb9e6a802dcd2db1f6eb1a83fdcb694dec" and "c28741d751544afd422c57ec16d7b02de72dee9c" have entirely different histories.
ad68cbdb9e
...
c28741d751
@ -15,7 +15,6 @@ 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')
|
||||
@ -172,12 +171,13 @@ function convertDataFromSource(sourceFilePath: string, mapping: MappingConfigTyp
|
||||
list_of_points = list_of_points.splice(0, mapping.filters.offset)
|
||||
}
|
||||
|
||||
console.log('features count before:', list_of_points.length)
|
||||
console.log('list_of_points.length', 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,18 +278,16 @@ function convertDataFromSource(sourceFilePath: string, mapping: MappingConfigTyp
|
||||
}
|
||||
let fileNameToWrite = '_' + filteredName + output_supplement + '.geojson'
|
||||
console.log('converted features:', converted_geo_json.features.length)
|
||||
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('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('Changement de features', percentChange, '%')
|
||||
|
||||
if (percentChange > limitWarningPercentageChangeInPoints) {
|
||||
if (percentChange > 5) {
|
||||
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 {
|
||||
|
@ -31,13 +31,9 @@ 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',
|
||||
@ -51,83 +47,17 @@ const mappingFINESS: MappingConfigType = {
|
||||
convert_to_phone: true,
|
||||
},
|
||||
categetab: {
|
||||
remove_original_key: true,
|
||||
key_converted: 'type:FR:FINESS',
|
||||
// remove_original_key: true,
|
||||
key_converted: 'ref:FR:FINESS:category',
|
||||
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"
|
||||
@ -140,7 +70,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
Loading…
Reference in New Issue
Block a user