Merge branch 'geocoderConfig' into 'main'
add geocoder configuration See merge request v3/service/configuration!37
This commit is contained in:
commit
b88ac36b30
20
.env.dist
20
.env.dist
|
@ -56,6 +56,26 @@ MAX_DETOUR_DURATION_RATIO=0.3
|
||||||
GEOROUTER_TYPE=graphhopper
|
GEOROUTER_TYPE=graphhopper
|
||||||
GEOROUTER_URL=http://localhost:8989
|
GEOROUTER_URL=http://localhost:8989
|
||||||
|
|
||||||
|
# GEOCODER
|
||||||
|
# default language
|
||||||
|
GEOCODER_LANG=fr
|
||||||
|
# minimal score to consider a result as valid
|
||||||
|
GEOCODEr_MIN_CONFIDENCE=0.5
|
||||||
|
# max number of results per provider (input results)
|
||||||
|
GEOCODER_MAX_RESULTS_PER_PROVIDER=5
|
||||||
|
# max number of results per address type (output results)
|
||||||
|
GEOCODER_MAX_RESULTS_PER_TYPE=5
|
||||||
|
# sanitize results ?
|
||||||
|
GEOCODER_SANITIZE=true
|
||||||
|
# consolidate results ?
|
||||||
|
GEOCODER_CONSOLIDATE=true
|
||||||
|
# max distance in km between 2 points to consider a duplicate
|
||||||
|
GEOCODER_PROXIMITY=5
|
||||||
|
# population vs distance prioritizer coef
|
||||||
|
# "boost" population weight for results with a short distance
|
||||||
|
# => multiply the population by COEF / distance (in km)
|
||||||
|
GEOCODDER_POPULATION_PRIORITIZER_COEF=100
|
||||||
|
|
||||||
# PAGINATION
|
# PAGINATION
|
||||||
# number of results per page
|
# number of results per page
|
||||||
PER_PAGE=10
|
PER_PAGE=10
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@mobicoop/configuration",
|
"name": "@mobicoop/configuration",
|
||||||
"version": "2.5.3",
|
"version": "2.6.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@mobicoop/configuration",
|
"name": "@mobicoop/configuration",
|
||||||
"version": "2.5.3",
|
"version": "2.6.0",
|
||||||
"license": "AGPL",
|
"license": "AGPL",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@grpc/grpc-js": "^1.9.9",
|
"@grpc/grpc-js": "^1.9.9",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@mobicoop/configuration",
|
"name": "@mobicoop/configuration",
|
||||||
"version": "2.5.3",
|
"version": "2.6.0",
|
||||||
"description": "Mobicoop V3 Configuration Service",
|
"description": "Mobicoop V3 Configuration Service",
|
||||||
"author": "sbriat",
|
"author": "sbriat",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|
|
@ -4,9 +4,49 @@ import { Config } from './config';
|
||||||
export interface GeographyConfig extends Config {
|
export interface GeographyConfig extends Config {
|
||||||
georouterType: string;
|
georouterType: string;
|
||||||
georouterUrl: string;
|
georouterUrl: string;
|
||||||
|
geocoderLang: string;
|
||||||
|
geocoderMinConfidence: number;
|
||||||
|
geocoderMaxResultsPerProvider: number;
|
||||||
|
geocoderMaxResultsPerType: number;
|
||||||
|
geocoderSanitize: boolean;
|
||||||
|
geocoderConsolidate: boolean;
|
||||||
|
geocoderProximity: number;
|
||||||
|
geocoderPopulationPrioritizerCoef: number;
|
||||||
|
geocoderProviders: string[];
|
||||||
|
geocoderProvidersFallback: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export default registerAs('geography', () => ({
|
export default registerAs('geography', () => ({
|
||||||
georouterType: process.env.GEOROUTER_TYPE ?? 'graphhopper',
|
georouterType: process.env.GEOROUTER_TYPE ?? 'graphhopper',
|
||||||
georouterUrl: process.env.GEOROUTER_URL ?? 'http://localhost:8989',
|
georouterUrl: process.env.GEOROUTER_URL ?? 'http://localhost:8989',
|
||||||
|
geocoderLang: process.env.GEOCODER_LANG ?? 'fr',
|
||||||
|
geocoderMinConfidence: process.env.GEOCODER_MIN_CONFIDENCE
|
||||||
|
? parseFloat(process.env.GEOCODER_MIN_CONFIDENCE)
|
||||||
|
: 0.5,
|
||||||
|
geocoderMaxResultsPerProvider: process.env.GEOCODER_MAX_RESULTS_PER_PROVIDER
|
||||||
|
? parseInt(process.env.GEOCODER_MAX_RESULTS_PER_PROVIDER)
|
||||||
|
: 5,
|
||||||
|
geocoderMaxResultsPerType: process.env.GEOCODER_MAX_RESULTS_PER_TYPE
|
||||||
|
? parseInt(process.env.GEOCODER_MAX_RESULTS_PER_TYPE)
|
||||||
|
: 5,
|
||||||
|
geocoderSanitize: process.env.GEOCODER_SANITIZE
|
||||||
|
? process.env.GEOCODER_SANITIZE === 'false'
|
||||||
|
? false
|
||||||
|
: true
|
||||||
|
: true,
|
||||||
|
geocoderConsolidate: process.env.GEOCODER_CONSOLIDATE
|
||||||
|
? process.env.GEOCODER_CONSOLIDATE === 'false'
|
||||||
|
? false
|
||||||
|
: true
|
||||||
|
: true,
|
||||||
|
geocoderProximity: process.env.GEOCODER_PROXIMITY
|
||||||
|
? parseInt(process.env.GEOCODER_PROXIMITY)
|
||||||
|
: 5,
|
||||||
|
geocoderPopulationPrioritizerCoef: process.env
|
||||||
|
.GEOCODER_POPULATION_PRIORITIZER_COEF
|
||||||
|
? parseInt(process.env.GEOCODER_POPULATION_PRIORITIZER_COEF)
|
||||||
|
: 100,
|
||||||
|
geocoderProviders:
|
||||||
|
process.env.GEOCODER_PROVIDERS ?? 'ADDOK,PELIAS_SEARCH,PELIAS_AUTOCOMPLETE',
|
||||||
|
geocoderProvidersFallback: process.env.GEOCODER_PROVIDERS_FALLBACK ?? 'GMAPS',
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Reference in New Issue