2025-01-15 22:20:14 +01:00
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 BoundingBoxCoordinatesType {
xMin : number ,
xMax : number ,
yMin : number ,
yMax : number ,
}
/ * *
* configuration to choose what point to exclude or include from geographic or properties hints
* /
export interface filteringConfig {
enable_coordinates_filter? : boolean ;
enable_properties_filter? : boolean ;
properties? : object ;
bounding_box? : object ;
offset? : number ;
filter_points_lesser_than_NkW? : number ; // filtrer les points qui ont moins de N kW dans la clé de puissance max
2025-03-13 11:51:47 +01:00
filter_points_older_than_year? : number ; // filtrer les points ayant une date avant une certaine année
filter_points_by_year_property? : string ; // choix de colonne à examiner pour filter_points_older_than_year
2025-01-15 22:20:14 +01:00
exclude_point_if_tag_not_empty? : Array < string > ;
exclude_point_if_tag_truthy? : Array < string > ;
exclude_point_if_tag_falsy? : Array < string > ;
}
interface sourceConfig {
geojson_path : string ; // the relative path to the geojson source file to analyse, from the root of this repository
url : string ; // URL from where the geojson comes online, on a data platform. This URL should be fetchable to get the most recent data of the concerned dataset to convert.
overpass_query? : string ; // query to get objects from OSM
2025-04-28 22:58:01 +02:00
documentation_url? : string ; // documentation on open data website about this dataset
2025-01-15 22:20:14 +01:00
}
export default interface MappingConfigType {
config_name : string , // descriptive name
config_author : string , // name and email for example
osmose? : boolean , // is the data from Osmose export
boolean_keys? : Array < string > , // what keys should be converted to boolean values
tags_to_ignore_if_value_is? : Array < string > , // list of strings for which we ignore the tags if they equal any of these
add_not_mapped_tags_too : boolean , // by default, we do not add tags from properties that we do not specify, set this to true to change it
default_properties_of_point? : object , // tag to add to every converted point by default
source : sourceConfig ,
filters? : filteringConfig ,
2025-04-17 17:57:29 +02:00
allow_unspecified_conditional_values? : boolean , // by default, we do not add tags from properties that we do not specify in conditional_values, set this to true to change it
2025-01-15 22:20:14 +01:00
tags : FeaturePropertyMappingConfigType
}
/ * *
* configuration concernant toutes les valeurs
* /
export interface FeaturePropertyMappingConfigType {
convert_to_boolean_value? : boolean ,
invert_boolean_value? : boolean ,
remove_original_key? : boolean ,
convert_to_phone? : boolean ,
convert_to_name? : boolean ,
ignore_if_falsy? : boolean ,
ignore_if_truthy? : boolean ,
remove_stars? : boolean ,
2025-04-10 12:53:03 +02:00
truncate_enums_to_limit? : number ,
2025-01-15 22:20:14 +01:00
conditional_values? : ConditionnalValuesConfigType ,
transform_function? : Function ,
2025-04-17 17:57:29 +02:00
keep_only_max_in_enum? : boolean ,
2025-05-13 23:59:21 +02:00
keep_only_truthy_yes_or_no_without_enum? : boolean ,
2025-01-15 22:20:14 +01:00
[ key : string ] : any ,
}
/ * *
* choix de conversion de la valeur originale selon des critères donnés
* /
export interface ConditionnalValuesConfigType {
key_converted? : string ,
value_converted? : string ,
truthy_value? : any ,
falsy_value? : any , // si la valeur originale est falsy, la convertir en la valeur donnée ici
ignore_this_data? : boolean ,
tags_to_add? : TagsToAddConfig ,
transform_function? : Function ,
}
export interface ConditionnalValuesType {
[ key : string ] : ConditionnalValuesConfigType ,
}
interface OneOSMTag {
[ key : string ] : string ,
}
export interface TagsToAddConfig {
tags_to_add : Array < OneOSMTag >
}