scripts/mapping_geojson_to_osm_tags/mappings/mapping-config.type.ts

75 lines
1.6 KiB
TypeScript
Raw Normal View History

2023-08-05 10:07:57 +02: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>,
}
2023-08-05 15:11:22 +02:00
2023-08-02 16:59:24 +02:00
export interface BoundingBoxCoordinatesType{
xMin: number,
xMax: number,
yMin: number,
yMax: number,
}
export default interface MappingConfigType{
config_name: string,
config_author: string,
2023-08-05 16:06:44 +02:00
add_not_mapped_tags_too: boolean,
2023-08-02 16:59:24 +02:00
default_properties_of_point: object,
2023-08-05 22:09:01 +02:00
source: object,
filters: object,
2023-08-05 09:55:14 +02:00
tags: FeaturePropertyMappingConfigType
2023-08-05 15:11:22 +02:00
}
2023-08-05 15:16:52 +02:00
/**
* configuration concernant toutes les valeurs
*/
2023-08-05 15:11:22 +02:00
export interface FeaturePropertyMappingConfigType{
[key:string]: any,
2023-08-05 16:06:44 +02:00
convert_to_boolean_value?:boolean,
2023-08-05 15:11:22 +02:00
remove_original_key?:boolean,
conditionnal_values?:ConditionnalValuesType,
2023-08-05 15:16:52 +02:00
transform_function?:Function,
2023-08-05 15:11:22 +02:00
}
2023-08-05 15:16:52 +02:00
/**
* choix de conversion de la valeur originale selon des critères donnés
*/
2023-08-05 15:11:22 +02:00
export interface ConditionnalValuesConfigType{
key_converted?:string,
value_converted?:string,
truthy_value?:any,
2023-08-05 15:16:52 +02:00
falsy_value?:any, // si la valeur originale est falsy, la convertir en la valeur donnée ici
2023-08-05 15:11:22 +02:00
ignore_this_data?:boolean,
2023-08-05 15:16:52 +02:00
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>
}