Skip to content

Replace spatial rules by custom areas, include country borders in bundle and add Country EncodedValue - #2353

Merged
easbar merged 72 commits into
masterfrom
custom_areas_2
Jul 27, 2021
Merged

easbar merged 72 commits into
masterfrom
custom_areas_2

Conversation

@easbar

@easbar easbar commented Jun 29, 2021 •

Copy link
Copy Markdown
Member

Here I tried to demonstrate some of the ideas described in this comment: #2246 (comment)

I haven't really removed any code yet and rather added custom areas the way I think they should be handled. Especially this commit: d3b037b shows how we can use custom areas. I have added a country encoded value that only requires a few changes and can immediately be used with custom models / auto-complete in the custom model box and path details. To try this yourself just add

custom_areas_folder: core/files/spatialrules/

to config.yml and add new_country to graph.encoded_values.

Like I said, I would rather include countries.geojson in the main bundle, but this just demonstrates how we could use arbitrary geojson files. I also think we can use the current spatial rules the same way: We just add geojson to the custom_areas_folder and adjust the maxspeed parser or whatever parser we want to make area specific.

Update:

This PR replaces spatial rules with 'custom areas'. This means that we can read arbitrary geojson polygons during import which are then made available to the tag parsers and flag encoders. This allows setting location-dependent encoded values, for example we could draw a Polygon around Paris and do special handling of the max speed encoded value just for this area.

This PR also adds the countries.geojson file to the core bundle and uses above mechanism to provide the country for each edge. There is a new CountryParser which sets the country encoded value for every edge and the country is also passed to so called CountryRules. CountryRules provide an easy way to apply country-specific rules for e.g. RoadAccess or MaxSpeed.

@easbar

easbar commented Jun 29, 2021

Copy link
Copy Markdown
Member Author

Here: f5748e0 I added a proof of concept how we can transfer the current spatial rules to country rules. There could be one file per country and the rules could be used in the various tag parsers (like in the example OSMMaxSpeed, but of course also others. If someone wanted to do something similar for custom areas this could also be the way to go, up to the point that the equivalent to these CountryRules could be moved to some config files (depending on the specific use-case).

Comment on lines +50 to +51
// todo: SpatialRuleLookupJTS uses SpatialRuleContainer#covers, but why?
.anyMatch(point::within)).collect(Collectors.toList());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe @otbutz can comment on this as there is some optimization going on there. The documentation says:

This predicate is similar to within(org.locationtech.jts.geom.Geometry), but is more inclusive (i.e. returns true for more cases).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PreparedPolygon.intersects() should be preferred

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you expand on this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment above. PreparedPolygon should be used instead of a regular JTS Polygon here as it's optimized for PIP checks.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so I should just create a prepared polygon using the borders of each custom area? And what about this 'filled lines' code in SpatialRuleContainer? Is this another optimization?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PreparedPolygon is the fastest method for full point-in-polygon checks. These are still costly though and the "filled lines" logic helps to avoid them. We basically rasterize the polygon and mark those rectangles which are completely within the polygon so we can skip PIP checks for them.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I see.

for (CustomArea customArea : customAreas) {
Object countryCode = customArea.getProperties().get("ISO3166-1:alpha3");
if (countryCode != null) {
NewCountry country = NewCountry.valueOf(countryCode.toString());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't Enum.valueOf() yield an IllegalArgumentException if it can't find the value?

Suggested change
NewCountry country = NewCountry.valueOf(countryCode.toString());
NewCountry country = NewCountry.find(countryCode.toString());

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it does. For country this should be ok, because I will move the countries.geojson into the source bundle and the NewCountry enum should then always be in sync with the country codes used in this file. But otherwise I agree it would be more useful to return null or something like a 'missing' value in case some value is missing (like road_class=my_404_class).


private final String name;

NewCountry(String name) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also include the two letter country code?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far I used ISO3166-1:alpha3 as country code, but no idea honestly. What are the pros and cons of the different codes? If there is some use-case for it we can of course also include other fields.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends on the data. Our geojson uses alpha3 and some tags in OSM like e.g maxspeed=RU:urban reference the alpha2 code. I doesn't really hurt to have both representations.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I see. So should we use alpha3 for the enum constants and add alpha2 as additional field, just like name? Or maybe alpha3 as enum constant, but also as additional field?

Btw the countries properties currently contain all these fields:

  "id": -2186665,
  "admin_level": "2",
  "name": "Tonga",
  "local_name": "Tonga",
  "name_en": "Tonga",
  "flag": "http://upload.wikimedia.org/wikipedia/commons/9/9a/Flag_of_Tonga.svg",
  "name:af": "Tonga",
  "name:am": "ቶንጋ",
  "name:an": "Tonga",
  "name:ar": "تونجا",
  "name:az": "Tonqa",
  "name:ba": "Тонга",
  "name:be": "Тонга",
  "name:bg": "Тонга",
  "name:bn": "টোঙ্গা",
  "name:bo": "ཊོང་ག",
  "name:br": "Tonga",
  "name:bs": "Tonga",
  "name:ca": "Tonga",
  "name:ce": "Тонга",
  "name:cs": "Tonga",
  "name:cu": "Тонга",
  "name:cy": "Tonga",
  "name:da": "Tonga",
  "name:de": "Tonga",
  "name:dv": "ޓޮންގާ",
  "name:el": "Τόνγκα",
  "name:en": "Tonga",
  "name:eo": "Tongo",
  "name:es": "Tonga",
  "name:et": "Tonga",
  "name:eu": "Tonga",
  "name:fa": "تونگا",
  "name:fi": "Tonga",
  "name:fo": "Tonga",
  "name:fr": "Tonga",
  "name:fy": "Tonga",
  "name:ga": "Tonga",
  "name:gd": "Tonga",
  "name:gl": "Tonga",
  "name:gv": "Yn Tongey",
  "name:he": "טונגה",
  "name:hi": "टोंगा",
  "name:hr": "Tonga",
  "name:ht": "Tonga",
  "name:hu": "Tonga",
  "name:hy": "Տոնգա",
  "name:ia": "Tonga",
  "name:id": "Tonga",
  "name:io": "Tonga",
  "name:is": "Tonga",
  "name:it": "Tonga",
  "name:ja": "トンガ",
  "name:jv": "Tonga",
  "name:ka": "ტონგა",
  "name:kk": "Тонга",
  "name:kn": "ಟೋಂಗಾ",
  "name:ko": "통가",
  "name:ku": "Tonga",
  "name:kw": "Tonga",
  "name:la": "Tonga",
  "name:lb": "Tonga",
  "name:li": "Tonga",
  "name:lt": "Tonga",
  "name:lv": "Tonga",
  "name:mk": "Тонга",
  "name:ml": "ടോങ്ക",
  "name:mn": "Тонга",
  "name:mr": "टोंगा",
  "name:ms": "Tonga",
  "name:mt": "Tonga",
  "name:my": "တုံဂါနိုင်ငံ",
  "name:nl": "Tonga",
  "name:nn": "Tonga",
  "name:no": "Tonga",
  "name:nv": "Tʼónga",
  "name:oc": "Tònga",
  "name:or": "ଟୋଙ୍ଗା",
  "name:os": "Тонгæ",
  "name:pa": "ਟੋਂਗਾ",
  "name:pl": "Tonga",
  "name:pt": "Tonga",
  "name:qu": "Tunqa",
  "name:rm": "Tonga",
  "name:ro": "Tonga",
  "name:ru": "Тонга",
  "name:rw": "Tonga",
  "name:sa": "टोंगा",
  "name:se": "Tonga",
  "name:sh": "Tonga",
  "name:sk": "Tonga",
  "name:sl": "Tonga",
  "name:sm": "Toga",
  "name:sq": "Tonga",
  "name:sr": "Тонга",
  "name:su": "Tonga",
  "name:sv": "Tonga",
  "name:sw": "Tonga",
  "name:ta": "தொங்கா",
  "name:tg": "Тонга",
  "name:th": "ประเทศตองกา",
  "name:tl": "Tonga",
  "name:to": "Tonga",
  "name:tr": "Tonga",
  "name:ts": "Tonga",
  "name:tw": "Tonga",
  "name:ty": "To’a",
  "name:ug": "Ton’ga",
  "name:uk": "Тонга",
  "name:ur": "ٹونگا",
  "name:uz": "Tonga",
  "name:vi": "Tonga",
  "name:vo": "Tonguäns",
  "name:wo": "Tonga",
  "name:yo": "Tóngà",
  "name:zh": "東加",
  "boundary": "administrative",
  "maritime": "yes",
  "name:ace": "Tonga",
  "name:als": "Tonga",
  "name:arz": "تونجا",
  "name:ast": "Tonga",
  "name:bcl": "Tonga",
  "name:bjn": "Tonga",
  "name:bpy": "টঙ্গা",
  "name:bxr": "Тонга",
  "name:ceb": "Tonga",
  "name:chy": "Tonga",
  "name:ckb": "تۆنگا",
  "name:crh": "Tonga",
  "name:diq": "Tonga",
  "name:ext": "Tonga",
  "name:frp": "Tonga",
  "name:hak": "Tûng-kâ",
  "name:hif": "Tonga",
  "name:ilo": "Tonga",
  "name:lij": "Tonga",
  "name:lmo": "Tonga",
  "name:mrj": "Тонга",
  "name:nah": "Tonga",
  "name:nan": "Tonga",
  "name:nds": "Tonga",
  "name:pam": "Tonga",
  "name:pih": "Tonga",
  "name:pms": "Tònga",
  "name:pnb": "ٹونگا",
  "name:sah": "Тонга",
  "name:scn": "Tonga",
  "name:sco": "Tonga",
  "name:smn": "Tonga",
  "name:sms": "Tonga",
  "name:szl": "Tůnga",
  "name:tpi": "Tonga",
  "name:tzl": "Tonga",
  "name:war": "Tonga",
  "name:xal": "Тонһлмудин Нутг",
  "name:yue": "湯加",
  "timezone": "Pacific/Tongatapu",
  "way_area": "3.34815",
  "wikidata": "Q678",
  "ISO3166-1": "TO",
  "wikipedia": "en:Tonga",
  "name:simple": "Tonga",
  "driving_side": "left",
  "name:bat-smg": "Tuonga",
  "name:fiu-vro": "Tonga",
  "name:be-tarask": "Тонга",
  "is_in:continent": "Oceania",
  "ISO3166-1:alpha2": "TO",
  "ISO3166-1:alpha3": "TON",
  "official_name:cs": "Království Tonga",
  "official_name:de": "Königreich Tonga",
  "official_name:en": "Kingdom of Tonga",
  "official_name:es": "Reino de Tonga",
  "official_name:ru": "Королевство Тонга",
  "ISO3166-1:numeric": "776"
}

Since we want to move this into the bundle we should probably get rid of what we do not use (just in case this actually reduces the filesize).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nv-i18n handles this in a similar way: https://github.com/TakahikoKawasaki/nv-i18n/blob/master/src/main/java/com/neovisionaries/i18n/CountryCode.java

One code representation as the name of the constant and the other one as a regular value.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's in core/files/spatialrules currently.

Ah, ok. Thanks. Strange, always thought we have it in the bundle already.

So should we use alpha3 for the enum constants and add alpha2 as additional field, just like name?

This sounds good to me 👍

driving_side

This is indeed interesting but not sure if we should attach it to the enum or if it belongs to the country rule.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timezones are a completely different caliber:

Timezone map

For example:

  • USA: 6 timezones
  • Russia: 11(!) timezones

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, sure. Russia actually does not even have a timezone field (probably for this reason).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep alpha2, alpha3 name:en, ISO3166-1:numeric, flag and wikidata in countries.geojson and remove everything else? The last three wouldn't be used by default but I thought they might be useful to somebody?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this

RoadClass roadClass = RoadClass.find(way.getTag("highway", ""));
CountryRule countryRule = way.getTag("country_rule", null);
if (countryRule != null)
maxSpeed = countryRule.getMaxSpeed(roadClass, TransportationMode.CAR, maxSpeed);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As noted in #2246 (comment) we should probably pass this down to the value extractor.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, see discussion in #2246.

gf = new GeometryFactory();
index = new STRtree();
for (CustomArea customArea : customAreas) {
for (Polygon border : customArea.getBorders()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use PreparedPolygon which is a lot faster for point-in-polygon checks

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this and you are right it is much faster. I did a test with 100k random queries in Europe against an area index that uses the countries file and this took around 18s, but only like 0.2s when using prepared geometry 👍
However, the filled lines optimization does not seem to make the queries faster and sometimes it is even slower. Therefore I would rather not include this, or is this especially useful for some corner cases (maybe smaller areas?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My test code is here if you want to try yourself: 436821e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, the filled lines optimization does not seem to make the queries faster and sometimes it is even slower. Therefore I would rather not include this, or is this especially useful for some corner cases (maybe smaller areas?)

Interesting. If it's not really faster, i'd agree that we should remove it.

@easbar easbar Jul 13, 2021 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my tests it did not seem to be significant, maybe like 10%, but not sure to be honest. I'll remove it for now. The custom area index should not be slow, but I'm also not sure if it has to be as fast as possible, because it will only be used during import where other things might be the bottleneck anyway.

Comment on lines +50 to +51
// todo: SpatialRuleLookupJTS uses SpatialRuleContainer#covers, but why?
.anyMatch(point::within)).collect(Collectors.toList());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PreparedPolygon.intersects() should be preferred

@easbar

easbar commented Jul 12, 2021

Copy link
Copy Markdown
Member Author

@otbutz Thanks for your review, I'll take a closer look at your suggestions. But from what I understand you like/agree with the general idea?

@otbutz

otbutz commented Jul 12, 2021

Copy link
Copy Markdown
Contributor

Absolutely 😉

@otbutz

otbutz commented Jul 26, 2021

Copy link
Copy Markdown
Contributor

@otbutz do you have some kind of datasets with lots of custom areas? I wonder if performance becomes more critical when there are lots of areas.

The STRtree is usually doing a good job keeping the number of PIP checks low. I'd expected performance only to degrade if a lot of overlapping areas are involved and/or if the polygons have a high resolution.

Btw there actually is a major performance problem: CH preparation becomes around x3 slower when country rules are enabled. I think this is related to the handling of track ways that use RoadAccess.Destination in GermanyCountryRule. But this problem already exists in master and is beyond the scope of the present PR.

We need to take a closer look on our rules and their impact on routing in general. See #2266

One of the problems is that we would need to differentiate between optimistic(upper bound) and pessimistic(lower bound) fallback values. IMHO this is in the same vein as distinguishing the TransportationMode. We need to find a balance between too much detail and oversimplification.

Talking about simplfication: did you remove the other properties from the countries.geojson?

Could you take a look on memory/storage consumption? I fear that the large enum comes with a price tag.

@easbar

easbar commented Jul 26, 2021

Copy link
Copy Markdown
Member Author

We need to take a closer look on our rules and their impact on routing in general.

Yes, sure, and hopefully this PR will be the foundation for this. I disabled the country rules by default in this PR and we can improve the rules, fix CH preparation performance and enable the rules by default afterwards.

Talking about simplfication: did you remove the other properties from the countries.geojson?

Yes, see here: #2353 (comment)

Could you take a look on memory/storage consumption? I fear that the large enum comes with a price tag.

In which context? Do you mean the Country EV? The Country enum has 218 entries, so it should take one byte per edge (8bits, 2^8=256). For a global import with currently around 250mio edges this would mean 250MB of additional memory is required for the Country EV. That should not be a problem and the Country EV can also be disabled.

@otbutz

otbutz commented Jul 26, 2021

Copy link
Copy Markdown
Contributor

250MB sounds very reasonable

@boldtrn

boldtrn commented Jul 26, 2021

Copy link
Copy Markdown
Member

Btw there actually is a major performance problem: CH preparation becomes around x3 slower when country rules are enabled. I think this is related to the handling of track ways that use RoadAccess.Destination in GermanyCountryRule. But this problem already exists in master and is beyond the scope of the present PR.

Have you tested why this happens?

I haven't had a chance to look at the code changes yet (sorry :( - summer is always pretty busy).

My understanding from reading your proposal a few weeks ago:

  • For every way we check once which rules apply and we store this in an encoded value
  • Everytime we use the country rule afterwards, we only need to read the EV, so there should be no major impact on CH preparation

Is the current approach different from this?

@easbar

easbar commented Jul 26, 2021

Copy link
Copy Markdown
Member Author

Have you tested why this happens?

Yes, it is because witness path searches that include destination edges take very long because of the large weight of these edges. GermanyCountryRule sets access=destination for all tracks, which are very many edges.

My understanding from reading your proposal a few weeks ago:
For every way we check once which rules apply and we store this in an encoded value

Yes, for every way we find the matching country rule (and all other custom areas) and this information is forwarded to all tag parsers. Currently only the max speed and road access parsers (and CountryParser, see below) make use of this information, so it affects the values of the max speed and road access encoded values. This happens only for the countries for which there are country rules, of course. These are still only Germany and Austria. There is also a new CountryParser which simply stores the country for every edge (Country EncodedValue).

Everytime we use the country rule afterwards, we only need to read the EV, so there should be no major impact on CH preparation. Is the current approach different from this?

After the import (when the encoded values are set) the country rules are never applied again. Like I said, CH preparation is still affected, because of the increased weights of the access=destination edges. For Germany I measured a x3 slow down for both node- and edge-based preparation. I am working on a fix for this.

@easbar

easbar commented Jul 27, 2021

Copy link
Copy Markdown
Member Author

Is everybody happy? I will merge this then.

@otbutz

otbutz commented Jul 27, 2021

Copy link
Copy Markdown
Contributor

Just one last thought: do we want a default country rule? I'd really like to get rid of hardcoded fallback values in FlagEncoders in the long run:

// autobahn
defaultSpeedMap.put("motorway", 100);
defaultSpeedMap.put("motorway_link", 70);
defaultSpeedMap.put("motorroad", 90);
// bundesstraße
defaultSpeedMap.put("trunk", 70);
defaultSpeedMap.put("trunk_link", 65);
// linking bigger town
defaultSpeedMap.put("primary", 65);
defaultSpeedMap.put("primary_link", 60);
// linking towns + villages
defaultSpeedMap.put("secondary", 60);
defaultSpeedMap.put("secondary_link", 50);
// streets without middle line separation
defaultSpeedMap.put("tertiary", 50);
defaultSpeedMap.put("tertiary_link", 40);
defaultSpeedMap.put("unclassified", 30);
defaultSpeedMap.put("residential", 30);
// spielstraße
defaultSpeedMap.put("living_street", 5);
defaultSpeedMap.put("service", 20);
// unknown road
defaultSpeedMap.put("road", 20);
// forestry stuff
defaultSpeedMap.put("track", 15);
trackTypeSpeedMap.put("grade1", 20); // paved
trackTypeSpeedMap.put("grade2", 15); // now unpaved - gravel mixed with ...
trackTypeSpeedMap.put("grade3", 10); // ... hard and soft materials
trackTypeSpeedMap.put(null, defaultSpeedMap.get("track"));
// limit speed on bad surfaces to 30 km/h
badSurfaceSpeed = 30;
maxPossibleSpeed = 140;

I'd avoid any logic for now and just go for a NOOP implementation first. The reason why i bring this up now is that this would allow us to remove a bit of null handling. We would always have a CountryRule which should be applied.

@easbar

easbar commented Jul 27, 2021 •

Copy link
Copy Markdown
Member Author

I'd really like to get rid of hardcoded fallback values in FlagEncoders in the long run:

Yes, the thing we need to do here is that instead of setting average speed and access in FlagEncoders there really should be tag parsers that create these speed and access encoded values. But this is a very different issue and removing FlagEncoders this way has been on the list for years now. And once we have this in place we can of course use country rules for average_speed and access, too.

The reason why i bring this up now is that this would allow us to remove a bit of null handling. We would always have a CountryRule which should be applied.

I really don't mind the null handling here. For some countries there is no rule, and the most direct way to state this in code is that the rule is null (=missing) in this case. For country rule it could kind of work, because so far all CountryRule methods have a clear way of 'doing nothing'. But generally I prefer null for these things. For example I would totally remove ElevationProvider.NOOP, because getEle has no clear way of 'doing nothing', it has to provide a value. So it provides Double.NaN and one has to handle Double.NaN, i.e. nothing is improved by having this NOOP provider. For the same reason I did not add something like a CountryRuleFactory.EMPTY.

@easbar

easbar commented Jul 27, 2021 •

Copy link
Copy Markdown
Member Author

And once we have this in place we can of course use country rules for average_speed and access, too.

Btw in principle with the current code we can already make use of the country information in FlagEncoder#handleWayTags to set country-specific values for speed&access.

@otbutz

otbutz commented Jul 27, 2021

Copy link
Copy Markdown
Contributor

LGTM then :)

@easbar

easbar commented Jul 27, 2021

Copy link
Copy Markdown
Member Author

LGTM then :)

Cool, and thanks a lot for your initial work on this and all your help with this PR.

@boldtrn

boldtrn commented Jul 27, 2021

Copy link
Copy Markdown
Member

Yes, it is because witness path searches that include destination edges take very long because of the large weight of these edges. GermanyCountryRule sets access=destination for all tracks, which are very many edges.

Ah thanks yes that makes sense. I thought there would be direct slow down because of too many lookups.

@easbar
easbar merged commit 20bd788 into master Jul 27, 2021
@easbar
easbar deleted the custom_areas_2 branch July 27, 2021 14:58
@easbar easbar mentioned this pull request Sep 4, 2021
@otbutz

otbutz commented Sep 29, 2021

Copy link
Copy Markdown
Contributor

@easbar any updates on the CH slowdown? Could we enable countryrules by default now?

@easbar

easbar commented Sep 30, 2021

Copy link
Copy Markdown
Member Author

No, but I hopefully will fix this soon and I would rather wait for this before we enable country rules by default. And maybe when we enable it it would be nice to have a few more (maybe using the approach we discussed in #2392 ?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants