mapping finess works

This commit is contained in:
Tykayn 2024-10-09 15:56:30 +02:00 committed by tykayn
parent e39a94ddc4
commit 1b8a0c590b
8 changed files with 472650 additions and 7 deletions

View File

@ -13,8 +13,9 @@ import mapping_engine from './mappings/engine'
import MappingConfigType, {BoundingBoxCoordinatesType, FeatureCollection} from "./mappings/mapping-config.type";
import utils from './mappings/utils'
import mappingRouenParkingVelos from "./mappings/converters/configRouen_OpenData_velo_parkings";
import mappingFINESS from "./mappings/converters/configFINESS";
const allowed_configs = ['mappingIssy2Roues', 'mappingConfigIRVE', 'mappingConfigIRVEFromOsmose', 'mappingConfigIRVE_simple', 'mappingTest', 'ConfigIRVE', 'mappingRouenParkingVelos'];
const allowed_configs = ['mappingIssy2Roues', 'mappingConfigIRVE', 'mappingConfigIRVEFromOsmose', 'mappingConfigIRVE_simple', 'mappingTest', 'ConfigIRVE', 'mappingRouenParkingVelos','mappingFINESS'];
const minimist = require('minimist')
@ -376,6 +377,9 @@ function setMappingConfigFromName(engine_conf_choice: string) {
} else if (engine_conf_choice == 'mappingRouenParkingVelos') {
Mapping_engine.setConfig(mappingRouenParkingVelos)
}
else if (engine_conf_choice == 'mappingFINESS') {
Mapping_engine.setConfig(mappingFINESS)
}
} else {
Mapping_engine.setConfig(mappingConfigIRVE)
}

View File

@ -28,8 +28,8 @@ Le détail complet des configurations de MappingConfigType est à voir dans la p
Choisir le jeu de données en changeant la configuration dans `convert_to_osm_tags.ts`.
Importer son Mapper dans `convert_to_osm_tags.ts` et le faire charger dans l'[Engine](engine.md) dans la partie qui réalise le chargement d'un Mapper.
Ajouter le nom du mapper dans le tableau `allowed_configs`, puis remplir une condition pour
Ajouter le nom du mapper dans le tableau `allowed_configs`, puis remplir une condition pour que l'Engine prenne le bon modèle de mapping.
# Debug
activer les logs.
activer les logs dans le fichier des `utils.ts`.

8
docs/finess_santé.md Normal file
View File

@ -0,0 +1,8 @@
# fichier FINESS
Le fichier répertoriant les établissements de santé, hôpitaux, maisons médicales, pharmacies, laboratoires d'analyse...
# conversion
Commande de conversion:
```bash
ts-node convert_to_osm_tags.ts --source=etalab_data/finess/finess_idf.json --output-file=finess_idf.json --engine-config=mappingFINESS
```

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,99 @@
{"type":"FeatureCollection"
,"features":[
{"type":"Feature"
,"geometry":
{"type":"Point"
,"coordinates":[2.411054732630236,48.762205707875424]},
"properties":
{
"nofinesset":"940008006",
"nofinessej":"940007990",
"rs":"PHARMACIE DU PORT",
"rslongue":"PHARMACIE DU PORT",
"complrs":null
,"compldistrib":null
numvoie":41
,"typvoie":"AV"
,"voie":"ANATOLE FRANCE"
,"compvoie":null
,"lieuditbp":null,
"commune":"022"
,"com_code":"94022"
,"dep_code":"94"
,"dep_name":"VAL DE MARNE"
,"ligneacheminement":"94600 CHOISY LE ROI"
,"telephone":"0148847477",
"telecopie":null
,"categetab":620
,"libcategetab":"Pharmacie d'Officine"
,"categagretab":"3201"
,"libcategagretab":"Commerce de Biens \u00e0 Usage M\u00e9dicaux"
,"siret":"33909485600020"
,"codeape":null
,"codemft":"01"
,"libmft":"Etablissement Tarif Libre",
"codesph":null
,"libsph":null
,"dateouv":"2021-07-12"
,"dateautor":"2011-02-25"
,"datemaj_structure":"2022-10-26"
,"numuai":null
,"coordxet":656709.0,
"coordyet":6851506.0
,"sourcecoordet":"2,ATLASANTE,100,IGN,BD_ADRESSE,V2.2,LAMBERT_93"
,"datemaj_geo":"2024-07-01"
,"com_name":"Choisy-le-Roi",
"reg_code":"11"
,"reg_name":"\u00cele-de-France"
,"epci_code":"200054781"
,"epci_name":"M\u00e9tropole du Grand Paris"
,"address":"41 AV ANATOLE FRANCE"}
}
,{"type":"Feature"
,"geometry":{"type":"Point"
,"coordinates":[2.5384355598256487,48.83001017590122]},
"properties":{"nofinesset":"940008998"
,"nofinessej":"940721400"
,"rs":"CMP INFANTO JUVENILE VILLIERS"
,"rslongue":"CMP INFANTO JUVENILE VILLIERS"
,"complrs":null
,"compldistrib":null
,"numvoie":10
,"typvoie":"RTE"
,"voie":"DE BRY"
,"compvoie":null
,"lieuditbp":null
,"commune":"079"
,"com_code":"94079"
,"dep_code":"94"
,"dep_name":"VAL DE MARNE"
,"ligneacheminement":"94350 VILLIERS SUR MARNE"
,"telephone":"0145937171"
,"telecopie":"0145762003"
,"categetab":156
,"libcategetab":"Centre M\u00e9dico-Psychologique (C.M.P.)"
,"categagretab":"1111"
,"libcategagretab":"Autres Etablissements de Lutte contre les Maladies Mentales"
,"siret":null
,"codeape":"8610Z"
,"codemft":"15"
,"libmft":"ARS priv\u00e9 hors PSPH sous dotation globale"
,"codesph":7
,"libsph":"Etab de sant\u00e9 priv\u00e9 non lucratif, non d\u00e9clar int\u00e9r\u00eat collect"
,"dateouv":"1973-04-01"
,"dateautor":"1973-04-01"
,"datemaj_structure":"2019-03-14"
,"numuai":null
,"coordxet":666116.2
,"coordyet":6858982.7
,"sourcecoordet":"1,ATLASANTE,100,IGN,BD_ADRESSE,V2.2,LAMBERT_93"
,"datemaj_geo":"2024-07-01"
,"com_name":"Villiers-sur-Marne"
,"reg_code":"11"
,"reg_name":"\u00cele-de-France"
,"epci_code":"200054781"
,"epci_name":"M\u00e9tropole du Grand Paris"
,"address":"10 RTE DE BRY"}},
]}

View File

@ -0,0 +1,75 @@
/**
* plan de conversion des clés du jeu de données vers les tags OSM
* détail dans le tableau
* https://wiki.openstreetmap.org/wiki/France/data.gouv.fr/Bornes_de_Recharge_pour_V%C3%A9hicules_%C3%89lectriques
*/
import MappingConfigType from "../mapping-config.type";
const mappingFINESS: MappingConfigType = {
config_name: "mappingFINESS",
config_author: "tykayn <contact@cipherbliss.com>",
default_properties_of_point: {},
source: {
geojson_path: "finess/finess_idf.json",
url: 'https://www.data.gouv.fr/fr/datasets/r/b9731c6f-c0d7-422e-9e1c-19edd51687ce'
},
filters: {
// exclude_point_if_tag_not_empty: ['id_osm'],
offset: 1
},
add_not_mapped_tags_too: false,
boolean_keys: [],
tags_to_ignore_if_value_is: [],
tags: {
// ******* nombres
// capacite: 'capacity',
// ******* textes
siret: 'ref:FR:SIRET',
rslongue: 'name',
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',
dateouv: 'start_date',
dateautor: 'authorisation_date',
telephone: {
key_converted: 'operator:phone',
convert_to_phone: true,
},
telecopie: {
key_converted: 'operator:fax',
convert_to_phone: true,
},
libcategagretab: {
remove_original_key: true,
conditional_value: {
"Laboratoires de Biologie M\u00e9dicale": {
tags_to_add: {
"healthcare": "laboratory"
}
},
"Centre Hospitalier (C.H.)": {
tags_to_add: {
"amenity": "hospital"
}
},
"Pharmacie d'Officine": {
tags_to_add: {
"amenity": "pharmacy"
}
},
"Maison de sant\u00e9 (L.6223-3)": {
tags_to_add: {
"amenity": "health_house"
}
},
}
},
}
}
export default mappingFINESS;

View File

@ -212,7 +212,7 @@ export default class {
// debugLog('convertProperty: mappingKeys', mappingKeys)
let remove_original_key = false;
if (this.mapping_config.tags_to_ignore_if_value_is.indexOf(originalValue) !== -1) {
if (this.mapping_config.tags_to_ignore_if_value_is?.indexOf(originalValue) !== -1) {
debugLog('(x) => ignore', originalValue, ' in ', pointKeyName)
remove_original_key = true;
}

View File

@ -0,0 +1,26 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
2.411054732630236,
48.762205707875424
]
},
"properties": {
"ref:FR:FINESS_et": "940008006",
"ref:FR:FINESS_ej": "940007990",
"name": "PHARMACIE DU PORT",
"ref:FR:categtab": 620,
"ref:FR:SIRET": "33909485600020",
"start_date": "2021-07-12",
"authorisation_date": "2011-02-25",
"ref:FR:code_EPCI": "200054781",
"ref:FR:EPCI": "Métropole du Grand Paris"
}
}
]
}