mimirsbrunn icon indicating copy to clipboard operation
mimirsbrunn copied to clipboard

Admin weight computation

Open pbougue opened this issue 6 years ago • 1 comments

This issue is opened to note idea (no need is tracked so far).

Currently

The administrative_region weight is based on the population retrieved in cosmogony (initially from OSM). It is then normalized using the max to have a weight between 0 and 1: w = pop / max(pop)

Downsides

I see 2 downsides to that (small ones for now):

  • This imply importing all admins at the same time, to insure consistency
  • This can be a bit of a perf issue as we have to compute the max, then compute all the weights

Ideas

Here are some ideas to change that if needs be:

  1. Fix the max once and for all (like 50 millions for cities). So we keep the same formula and over that value the weight is just 1
  2. Use a logarithm

This choice may also be mixed with using other information (number of addresses?)

pbougue avatar Jun 21 '18 12:06 pbougue

I think the admin could indeed be improved even if it's enough for the moment.

I feel we'll need at one point to change the whole weight mechanism to better order the results.

For the record addok use a formula based on the type of admin (capital, prefecture, ...) and the log of the population for the french admin weight.

antoine-de avatar Jul 02 '18 14:07 antoine-de