add log when filter is active on the config

This commit is contained in:
Tykayn 2025-02-24 14:53:42 +01:00 committed by tykayn
parent c7b4e82a7f
commit 22a8c09bfb
4 changed files with 20 additions and 1176849 deletions

View file

@ -10,7 +10,7 @@ import mappingConfigIRVEFromOsmose from './mappings/converters/configIRVE_osmose
import mappingConfigIRVE_simple from './mappings/converters/mappingConfigIRVE_simple' import mappingConfigIRVE_simple from './mappings/converters/mappingConfigIRVE_simple'
import mappingTest from './mappings/converters/configTest' import mappingTest from './mappings/converters/configTest'
import mapping_engine from './mappings/engine' import mapping_engine from './mappings/engine'
import MappingConfigType, {BoundingBoxCoordinatesType, FeatureCollection} from "./mappings/mapping-config.type"; import MappingConfigType, { BoundingBoxCoordinatesType, FeatureCollection } from "./mappings/mapping-config.type";
import utils from './mappings/utils' import utils from './mappings/utils'
import mappingRouenParkingVelos from "./mappings/converters/configRouen_OpenData_velo_parkings"; import mappingRouenParkingVelos from "./mappings/converters/configRouen_OpenData_velo_parkings";
import mappingFINESS from "./mappings/converters/configFINESS"; import mappingFINESS from "./mappings/converters/configFINESS";
@ -214,9 +214,11 @@ function convertDataFromSource(sourceFilePath: string, mapping: MappingConfigTyp
*/ */
if (mapping.filters) { if (mapping.filters) {
if (mapping.filters.exclude_point_if_tag_not_empty) { if (mapping.filters.exclude_point_if_tag_not_empty) {
console.log('------ filter: exclude_point_if_tag_not_empty', mapping.filters.exclude_point_if_tag_not_empty)
list_of_points = Mapping_engine.filterListOfPointsByExcludingIfKeyFilled(list_of_points, mapping.filters.exclude_point_if_tag_not_empty) list_of_points = Mapping_engine.filterListOfPointsByExcludingIfKeyFilled(list_of_points, mapping.filters.exclude_point_if_tag_not_empty)
} }
if (mapping.filters.filter_points_lesser_than_NkW) { if (mapping.filters.filter_points_lesser_than_NkW) {
console.log('------ filter: filter_points_lesser_than_NkW', mapping.filters.filter_points_lesser_than_NkW)
list_of_points = Mapping_engine.filterListOfPointsByExcludingIfMaxPowerIsLesserThan(mapping.filters.filter_points_lesser_than_NkW, list_of_points) list_of_points = Mapping_engine.filterListOfPointsByExcludingIfMaxPowerIsLesserThan(mapping.filters.filter_points_lesser_than_NkW, list_of_points)
} }
} }
@ -368,7 +370,8 @@ function convertDataFromSource(sourceFilePath: string, mapping: MappingConfigTyp
console.log('converted features:', converted_geo_json.features.length) console.log('converted features:', converted_geo_json.features.length)
console.log('différences nombre de features: ', data_transformed.features.length - converted_geo_json.features.length) console.log('différences nombre de features: ', data_transformed.features.length - converted_geo_json.features.length)
const percentChange = (data_transformed.features.length) / 100 * converted_geo_json.features.length; const percentChange = (converted_geo_json.features.length / data_transformed.features.length) * 100;
console.log('Changement de features', percentChange, '%') console.log('Changement de features', percentChange, '%')
if (percentChange > limitWarningPercentageChangeInPoints) { if (percentChange > limitWarningPercentageChangeInPoints) {
@ -470,6 +473,13 @@ function setMappingConfigFromName(engine_conf_choice: string) {
* Launch conversion of dataset * Launch conversion of dataset
*/ */
function init() { function init() {
console.log(`▗▖ ▗▖ ▗▄▖ ▗▖ ▗▄▖ ▗▖ ▗▄▖
`)
setMappingConfigFromName(engine_conf_choice) setMappingConfigFromName(engine_conf_choice)
} }

View file

@ -21,7 +21,7 @@ const MappingIRVE: MappingConfigType = {
filters: { filters: {
enable_coordinates_filter: false, enable_coordinates_filter: false,
enable_properties_filter: true, enable_properties_filter: true,
filter_points_lesser_than_NkW: 22 // ne pas sortir les points qui ont moins de ce nombre de puissance nominale filter_points_lesser_than_NkW: 50 // ne pas sortir les points qui ont moins de ce nombre de puissance nominale
// add only geojson points who are found having this regex in the zipcode properties // add only geojson points who are found having this regex in the zipcode properties
// properties: { // properties: {
// consolidated_code_postal: '^[76|27]' // consolidated_code_postal: '^[76|27]'
@ -76,11 +76,11 @@ const MappingIRVE: MappingConfigType = {
invert_boolean_value: true, invert_boolean_value: true,
}, },
paiement_acte: paiement_acte:
{ {
key_converted: 'authentication:none', key_converted: 'authentication:none',
convert_to_boolean_value: true, // convertit en yes ou no convert_to_boolean_value: true, // convertit en yes ou no
}, },
reservation: { reservation: {
convert_to_boolean_value: true, // convertit en yes ou no convert_to_boolean_value: true, // convertit en yes ou no
}, },
@ -158,9 +158,9 @@ const MappingIRVE: MappingConfigType = {
// ajout de trois tags si la valeur est yes // ajout de trois tags si la valeur est yes
"yes": { "yes": {
tags_to_add: [ tags_to_add: [
{bicycle: "yes"}, { bicycle: "yes" },
{scooter: "yes"}, { scooter: "yes" },
{motorcar: "no"}, { motorcar: "no" },
] ]
} }
} }

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff