New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUGFIX: Fix name-based way fragmentation in transportation_name #1295
BUGFIX: Fix name-based way fragmentation in transportation_name #1295
Conversation
Results evaluating commit e53122d (merged with base 0cff344 as 2a7201a). See run details. PostgreSQL DB size in MB: 2850 ⇒ 2852 (0.1% change)
expand for details...
|
Co-authored-by: Tomas Pohanka <TomPohys@gmail.com>
Thank you for this PR. It looks awesome. Just a little comment for clarification if |
Correct name:xx vs name_xx Co-authored-by: Tomas Pohanka <TomPohys@gmail.com>
The unit test CI is actually failing here. There is something wrong with the unit test execution that is causing the failure to not bubble up into CI. |
All issues are resolved! The new test cases added in this PR also detected an issue with sac_scale not getting updates in the transportation table sequence; this was corrected in e53122d. Ready for review. |
Awesome! Thank you very much! |
I discovered this bug while investigating issues with the updates process related to #1190 #1292, and #814.
The
transportation_name
layer produces slightly differenttags
hstore values in theosm_transportation_name_linestring
table during the initial import versus when running an update. As currently written, the import code produces null-value keys in thetags
column, while the update code suppresses them. This PR removes that difference and makes the import code use same method that is currently used in the update code.With a test case I've written, the import code produces a tags hstore that looks like this:
"name"=>"OpenMapTiles Secondary 2", "name:de"=>NULL, "name:en"=>NULL, "name_int"=>"OpenMapTiles Secondary 2", "name:latin"=>"OpenMapTiles Secondary 2"
...while the update code produces a tags hstore that looks like this:
"name"=>"OpenMapTiles Secondary 2", "name_int"=>"OpenMapTiles Secondary 2", "name:latin"=>"OpenMapTiles Secondary 2"
Note the missing NULL values.
This bug causes a small amount of space wastage after an update is run, because the update matching code detects the
tags
value as different, resulting in a duplicate copy of the tags value if that row is updated. This causes duplicate objects and breaks GROUP BY clauses that expect to group same-tagged features together. I've tested this by inspection of a generated mbtiles, database spot checks, and the unit test code included in this PR.This PR incorporates the changes in #1294, which were necessary for testing this PR.