mapping-geojson-osm/mappings/mapping-config.type.ts

76 lines
1.6 KiB
TypeScript

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,
}
export default interface MappingConfigType{
config_name: string,
config_author: string,
osmose?: boolean,
add_not_mapped_tags_too: boolean,
default_properties_of_point: object,
source: object,
filters: object,
tags: FeaturePropertyMappingConfigType
}
/**
* configuration concernant toutes les valeurs
*/
export interface FeaturePropertyMappingConfigType{
[key:string]: any,
convert_to_boolean_value?:boolean,
remove_original_key?:boolean,
conditionnal_values?:ConditionnalValuesType,
transform_function?:Function,
}
/**
* 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>
}