add types
This commit is contained in:
parent
18696f6eec
commit
fbfe0356ee
@ -0,0 +1,34 @@
|
|||||||
|
import MappingConfigType from "../../mappings/mapping-config.type";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* configurations de mapping pour les cas de tests
|
||||||
|
*/
|
||||||
|
export const mappingRemoveAll: MappingConfigType = {
|
||||||
|
config_name: 'testing config',
|
||||||
|
config_author: 'tykayn <contact@cipherbliss.com>',
|
||||||
|
default_properties_of_point: {
|
||||||
|
'amenity': 'charging_station'
|
||||||
|
},
|
||||||
|
tags: {
|
||||||
|
nom_amenageur: {
|
||||||
|
key_converted: 'autre_nom_amenageur',
|
||||||
|
conditional_values: {
|
||||||
|
'Accessibilité inconnue': {
|
||||||
|
ignore_this_data: true, // ne pas ajouter de tag si la valeur est égale à Accessibilité inconnue.
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export const mappingIgnore: MappingConfigType = {
|
||||||
|
config_name: 'testing config',
|
||||||
|
config_author: 'tykayn <contact@cipherbliss.com>',
|
||||||
|
default_properties_of_point: {
|
||||||
|
'amenity': 'charging_station'
|
||||||
|
},
|
||||||
|
tags: {
|
||||||
|
nom_amenageur: {
|
||||||
|
ignore_this_data: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -4,18 +4,18 @@
|
|||||||
* https://wiki.openstreetmap.org/wiki/France/data.gouv.fr/Bornes_de_Recharge_pour_V%C3%A9hicules_%C3%89lectriques
|
* https://wiki.openstreetmap.org/wiki/France/data.gouv.fr/Bornes_de_Recharge_pour_V%C3%A9hicules_%C3%89lectriques
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default {
|
const mappingIRVE:any = {
|
||||||
|
|
||||||
// ******* nombres
|
// ******* nombres
|
||||||
nbre_pdc: 'capacity',
|
nbre_pdc: 'capacity',
|
||||||
// ******* textes
|
|
||||||
amenity: 'amenity', // conserver le tag de base
|
amenity: 'amenity', // conserver le tag de base
|
||||||
capacity: 'capacity', // conserver le tag de base
|
capacity: 'capacity', // conserver le tag de base
|
||||||
nom_amenageur: 'operator',
|
nom_amenageur: 'operator',
|
||||||
siren_amenageur: 'owner:ref:FR:SIREN',
|
siren_amenageur: 'owner:ref:FR:SIREN',
|
||||||
nom_operateur: 'operator',
|
nom_operateur: 'operator',
|
||||||
telephone_operateur: 'phone',
|
telephone_operateur: 'phone',
|
||||||
contact_operateur: 'email', // ici, on souhaite convertir la clé contact_operateur=bidule en email=bidule
|
// ici, on souhaite convertir la clé contact_operateur=bidule en email=bidule
|
||||||
|
contact_operateur: 'email',
|
||||||
|
|
||||||
id_station_itinerance: 'ref:EU:EVSE',
|
id_station_itinerance: 'ref:EU:EVSE',
|
||||||
id_station_local: 'ref',
|
id_station_local: 'ref',
|
||||||
@ -40,4 +40,6 @@ export default {
|
|||||||
// ******** champs plus complexes
|
// ******** champs plus complexes
|
||||||
horaires: 'opening_hours', // déjà au bon format
|
horaires: 'opening_hours', // déjà au bon format
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default mappingIRVE;
|
@ -1,3 +1,22 @@
|
|||||||
|
interface GeoJsonGeometry {
|
||||||
|
type:string,
|
||||||
|
coordinates:Array<number>,
|
||||||
|
}
|
||||||
|
|
||||||
|
interface GeoJsonProperties {
|
||||||
|
[key:string]: any,
|
||||||
|
}
|
||||||
|
|
||||||
|
interface GeoJsonFeature {
|
||||||
|
type:string,
|
||||||
|
geometry:GeoJsonGeometry,
|
||||||
|
properties:GeoJsonProperties,
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FeatureCollection{
|
||||||
|
type:string,
|
||||||
|
features:Array<GeoJsonFeature>,
|
||||||
|
}
|
||||||
export interface FeaturePropertyMappingConfigType{
|
export interface FeaturePropertyMappingConfigType{
|
||||||
[key:string]: any,
|
[key:string]: any,
|
||||||
key_converted?:string,
|
key_converted?:string,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import mapping_engine from '../mappings/engine'
|
import mapping_engine from '../mappings/engine.ts'
|
||||||
|
import { mappingRemoveAll } from '../data_other/testing/mappings_to_test'
|
||||||
|
|
||||||
describe('mapping properties with rich mapping engine', () => {
|
describe('mapping properties with rich mapping engine', () => {
|
||||||
|
|
||||||
@ -7,23 +8,7 @@ describe('mapping properties with rich mapping engine', () => {
|
|||||||
})
|
})
|
||||||
test('remove all properties when mapping says so', () => {
|
test('remove all properties when mapping says so', () => {
|
||||||
|
|
||||||
let mappingRemoveAll = {
|
|
||||||
config_name: 'testing config',
|
|
||||||
config_author: 'tykayn <contact@cipherbliss.com>',
|
|
||||||
default_properties_of_point: {
|
|
||||||
'amenity': 'charging_station'
|
|
||||||
},
|
|
||||||
tags: {
|
|
||||||
nom_amenageur: {
|
|
||||||
key_converted: 'wheelchair',
|
|
||||||
conditional_values: {
|
|
||||||
'Accessibilité inconnue': {
|
|
||||||
ignore_this_data: true, // ne pas ajouter de tag si la valeur est égale à Accessibilité inconnue.
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let Mapping_engine = new mapping_engine(mappingRemoveAll)
|
let Mapping_engine = new mapping_engine(mappingRemoveAll)
|
||||||
|
|
||||||
let mapped_point = {}
|
let mapped_point = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user