update conditional config convert to name
This commit is contained in:
parent
1b8a0c590b
commit
e414600d45
@ -25,14 +25,17 @@ const mappingFINESS: MappingConfigType = {
|
||||
// capacite: 'capacity',
|
||||
// ******* textes
|
||||
siret: 'ref:FR:SIRET',
|
||||
rslongue: 'name',
|
||||
nofinesset: 'ref:FR:FINESS_et',
|
||||
nofinessej: 'ref:FR:FINESS_ej',
|
||||
categetab: 'ref:FR:categtab',
|
||||
rslongue: {
|
||||
key_converted: 'name',
|
||||
convert_to_name: true,
|
||||
},
|
||||
nofinesset: 'ref:FR:FINESS:et',
|
||||
nofinessej: 'ref:FR:FINESS:ej',
|
||||
// categetab: 'ref:FR:categtab',
|
||||
epci_code: 'ref:FR:code_EPCI',
|
||||
epci_name: 'ref:FR:EPCI',
|
||||
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',
|
||||
dateautor: 'authorisation_date',
|
||||
telephone: {
|
||||
@ -43,27 +46,33 @@ const mappingFINESS: MappingConfigType = {
|
||||
key_converted: 'operator:fax',
|
||||
convert_to_phone: true,
|
||||
},
|
||||
libcategagretab: {
|
||||
remove_original_key: true,
|
||||
conditional_value: {
|
||||
"Laboratoires de Biologie M\u00e9dicale": {
|
||||
categetab: {
|
||||
// remove_original_key: true,
|
||||
key_converted: 'ref:FR:FINESS:category',
|
||||
conditional_values: {
|
||||
// "Laboratoires de Biologie Médicale": {
|
||||
611: {
|
||||
tags_to_add: {
|
||||
"healthcare": "laboratory"
|
||||
}
|
||||
},
|
||||
"Centre Hospitalier (C.H.)": {
|
||||
// "Centre Hospitalier (C.H.)": {
|
||||
"412": {
|
||||
tags_to_add: {
|
||||
"amenity": "hospital"
|
||||
"amenity": "hospital",
|
||||
"healthcare": "hospital"
|
||||
}
|
||||
},
|
||||
"Pharmacie d'Officine": {
|
||||
// "Pharmacie d'Officine": {
|
||||
620: {
|
||||
tags_to_add: {
|
||||
"amenity": "pharmacy"
|
||||
"healthcare": "pharmacy"
|
||||
}
|
||||
},
|
||||
"Maison de sant\u00e9 (L.6223-3)": {
|
||||
// "Maison de santé (L.6223-3)": {
|
||||
"603": {
|
||||
tags_to_add: {
|
||||
"amenity": "health_house"
|
||||
"healthcare": "centre"
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@ -437,6 +437,9 @@ export default class {
|
||||
}
|
||||
|
||||
}
|
||||
if (configObject.convert_to_name) {
|
||||
convertedValue = Formatters.convertToName(originalValue)
|
||||
}
|
||||
if (configObject.remove_original_key) {
|
||||
remove_original_key = true
|
||||
}
|
||||
|
@ -69,4 +69,11 @@ export default class Formatters {
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
static convertToName(originalValue: string) {
|
||||
|
||||
let tab = originalValue.toLowerCase().split('')
|
||||
tab[0] = originalValue[0].toUpperCase()
|
||||
return tab.join('');
|
||||
}
|
||||
}
|
||||
|
@ -65,8 +65,13 @@ export interface FeaturePropertyMappingConfigType {
|
||||
[key: string]: any,
|
||||
|
||||
convert_to_boolean_value?: boolean,
|
||||
invert_boolean_value?: boolean,
|
||||
remove_original_key?: boolean,
|
||||
conditionnal_values?: ConditionnalValuesType,
|
||||
convert_to_phone?: boolean,
|
||||
convert_to_name?: boolean,
|
||||
ignore_if_falsy?: boolean,
|
||||
ignore_if_truthy?: boolean,
|
||||
conditional_values?: ConditionnalValuesType,
|
||||
transform_function?: Function,
|
||||
}
|
||||
|
||||
|
@ -11,10 +11,10 @@
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"ref:FR:FINESS_et": "940008006",
|
||||
"ref:FR:FINESS_ej": "940007990",
|
||||
"ref:FR:FINESS:et": "940008006",
|
||||
"ref:FR:FINESS:ej": "940007990",
|
||||
"name": "PHARMACIE DU PORT",
|
||||
"ref:FR:categtab": 620,
|
||||
"ref:FR:FINESS:category": "620",
|
||||
"ref:FR:SIRET": "33909485600020",
|
||||
"start_date": "2021-07-12",
|
||||
"authorisation_date": "2011-02-25",
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user