add config ask angela

This commit is contained in:
Tykayn 2024-10-17 10:20:22 +02:00 committed by tykayn
parent e1688352d1
commit a41fd19c35
5 changed files with 7469 additions and 277 deletions

View File

@ -17,17 +17,18 @@ import mappingFINESS from "./mappings/converters/configFINESS";
import MappingArbresIssy from "./mappings/converters/configArbresIssy"; import MappingArbresIssy from "./mappings/converters/configArbresIssy";
import MappingArbres92 from "./mappings/converters/configArbresHautsDeSeine"; import MappingArbres92 from "./mappings/converters/configArbresHautsDeSeine";
import MappingMuseums from "./mappings/converters/configMuseums"; import MappingMuseums from "./mappings/converters/configMuseums";
import MappingRouenPAV from "./mappings/converters/configRouen_PAV";
import MappingAskAngela from "mappings/converters/configAskAngela";
const limitWarningPercentageChangeInPoints = 5; // show a warning when more than N percent of the number of points changed const limitWarningPercentageChangeInPoints = 5; // show a warning when more than N percent of the number of points changed
const allowed_configs = [ const allowed_configs = [
'mappingIssy2Roues', 'mappingConfigIRVE', 'mappingConfigIRVEFromOsmose', 'mappingIssy2Roues', 'mappingConfigIRVE', 'mappingConfigIRVEFromOsmose',
'mappingConfigIRVE_simple', 'mappingTest', 'ConfigIRVE', 'mappingConfigIRVE_simple', 'mappingTest', 'ConfigIRVE',
'mappingRouenParkingVelos', 'mappingFINESS', 'MappingArbresIssy', 'mappingRouenParkingVelos', 'mappingFINESS', 'MappingArbresIssy',
'MappingArbres92', 'MappingMuseums','MappingRouenPAV' 'MappingArbres92', 'MappingMuseums', 'MappingRouenPAV', 'MappingAskAngela'
]; ];
import minimist = require('minimist') import minimist = require('minimist');
import MappingRouenPAV from "./mappings/converters/configRouen_PAV";
const debugLog = utils.debugLog; const debugLog = utils.debugLog;
@ -44,8 +45,8 @@ let boundingBoxCoordinates: BoundingBoxCoordinatesType = {
yMin: 48.7, yMin: 48.7,
yMax: 48.4, yMax: 48.4,
} }
let default_engine_conf_choice: string = 'ConfigIRVE'; let default_engine_conf_choice: string = 'ConfigIRVE'
let engine_conf_choice: string = 'ConfigIRVE'; let engine_conf_choice: string = 'ConfigIRVE'
let filterCoordinates = true let filterCoordinates = true
filterCoordinates = false filterCoordinates = false
@ -395,8 +396,10 @@ function setMappingConfigFromName(engine_conf_choice: string) {
Mapping_engine.setConfig(MappingArbres92) Mapping_engine.setConfig(MappingArbres92)
} else if (engine_conf_choice == 'MappingMuseums') { } else if (engine_conf_choice == 'MappingMuseums') {
Mapping_engine.setConfig(MappingMuseums) Mapping_engine.setConfig(MappingMuseums)
}else if (engine_conf_choice == 'MappingRouenPAV') { } else if (engine_conf_choice == 'MappingRouenPAV') {
Mapping_engine.setConfig(MappingRouenPAV) Mapping_engine.setConfig(MappingRouenPAV)
} else if (engine_conf_choice == 'MappingAskAngela') {
Mapping_engine.setConfig(MappingAskAngela)
} }
} else { } else {
Mapping_engine.setConfig(mappingConfigIRVE) Mapping_engine.setConfig(mappingConfigIRVE)

13
docs/ask_angela.md Normal file
View File

@ -0,0 +1,13 @@
# Ask Angela, dispositif anti harcèlement
Les commerces et autres lieux adhérant au dispositif
# Conversion
## Conversion des données de Toulouse
```bash
ts-node convert_to_osm_tags.ts --source=etalab_data/ask_angela/toulouse_askangela.json --output-file=toulouse_askangela.json --engine-config=MappingAskAngela
```
## Conversion des données de Bordeaux
```bash
ts-node convert_to_osm_tags.ts --source=etalab_data/ask_angela/bordeaux_askangela.json --output-file=bordeaux_askangela.json --engine-config=MappingAskAngela
```

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,60 @@
/**
* commerces adhérant à Ask Angela
* https://wiki.openstreetmap.org/wiki/FR:Tag:harassment_prevention%3Dask_angela
*/
import MappingConfigType from "../mapping-config.type";
const MappingAskAngela: MappingConfigType = {
config_name: "mappingRouenParkingVelos",
config_author: "tykayn <contact@cipherbliss.com>",
default_properties_of_point: {
'harassment_prevention': 'ask_angela',
},
source: {
geojson_path: '',
url: ''
},
filters: {
// exclude_point_if_tag_not_empty: ['id_osm'], // on peut exclure des données converties celles qui sont déjà avec un identifiant openstreetmap afin de favoriser l'intégration san avoir à gérer les doublons
// offset: 50
},
add_not_mapped_tags_too: false,
boolean_keys: [],
tags_to_ignore_if_value_is: ['Non renseigne'],
tags: {
// ******* opendata de toulouse START **************
structure: {
remove_original_key: true,
conditional_values: {
"Hôtel": {
tags_to_add: {
'tourism': 'hotel'
}
},
"Restaurant": {
tags_to_add: {
'amenity': 'restaurant'
}
},
}
},
'id': 'ref:FR:Toulouse:ask_angela_id',
noms: 'name',
// ******* opendata de toulouse END **************
// ******* opendata de poitiers START **************
'_id': 'ref:FR:Poitiers:ask_angela_id',
// ******* opendata de poitiers END **************
// ******* opendata de bordeaux START **************
'gid': 'ref:FR:Bordeaux:ask_angela_id',
'libelle': 'name',
'url': 'contact:website',
'cdate': 'start_date:ask_angela',
'mdate': 'check_date:ask_angela',
// ******* opendata de bordeaux END **************
}
}
export default MappingAskAngela;