mirror of
https://forge.chapril.org/tykayn/wololo
synced 2025-10-04 17:04:53 +02:00
réinit
This commit is contained in:
commit
996524bc6d
107 changed files with 1295536 additions and 0 deletions
106
mappings/mapping-config.type.ts
Normal file
106
mappings/mapping-config.type.ts
Normal file
|
@ -0,0 +1,106 @@
|
|||
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
|
||||
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
|
||||
}
|
||||
|
||||
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,
|
||||
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,
|
||||
conditional_values?: ConditionnalValuesConfigType,
|
||||
transform_function?: Function,
|
||||
|
||||
[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>
|
||||
}
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue