This idea comes from @ImreSamu and @stirringhalo, see https://github.com/openmaptiles/openmaptiles/pull/214
instead of _gen1 ; _gen2 ; _gen3 , maybe we can use _zresXX in the table name.
There's some overlap with the same genXX used for multiple zooms, so we would have to make the decision whether:
- To include the detail at the highest level that the generalized table will be used at
- To include the medium detail that the generalized table will be used at
- Strictly have one generalized table per zoom. Would lead to more disk use, but cleaner ETLs.
I'm leaning towards 2 for the immediate future, perhaps 3 on the next major refactoring.
My suggestion is to use table postfix _z#. The number # should be equal to numbers ZRes(#) and tolerance: Z## used in mapping.yaml. Such table can be used for one zoom level, but also for more zoom levels - I see no problem in this. It is more straightforward then to think about medium detail the table will be used for. And you do not need to rename the table when you decide to use it for different range of zoom levels.
Example: Let's have two generalize tables _z9 and _z12. You can use any of following options:
| Zoom level | Option 1 | Option 2 | Option 3 |
| --- | --- | --- | --- |
| z9 | _z9 | _z9 | _z9 |
| z10 | _z9 | _z9 | _z12 |
| z11 | _z9 | _z12 | _z12 |
| z12 | _z12 | _z12 | _z12 |
| z13 | _z12 | _z12 | _z12 |
| z14+ | source | source | source |
I'm all for this, after the layers stabilize a bit after all the changes coming!
The z convention is much better :+1:
https://gist.github.com/lukasmartinelli/19132751535fae4f8175dfa45bb1459c
This table shows at which point you can simplify so you don't see a pixel difference (based on https://github.com/CartoDB/CartoDB-basemaps/blob/3670f12efa0f0cc695842bdb67b14d74c4e6f8d7/data/core_functions.sql#L8).
@lukasmartinelli Yep, we now use the postgis-vt-util formula for getting simplification thresholds https://github.com/openmaptiles/openmaptiles-tools/blob/master/openmaptiles/imposm.py#L10
I would like to bring the idea back to life. Instead of table_name_gen1, table_name_gen2..., we would have table_name_gen_z0, table_name_gen_z1, ...table_name_gen_z12, table_name_gen_z13... That would make reading the schema much easier.
It also means that we should have one generalized table per one zoom and we should use matching ZRES value used for simplification (both imposm and import-sql).
sounds good to me
Most helpful comment
I would like to bring the idea back to life. Instead of
table_name_gen1,table_name_gen2..., we would havetable_name_gen_z0,table_name_gen_z1, ...table_name_gen_z12,table_name_gen_z13... That would make reading the schema much easier.It also means that we should have one generalized table per one zoom and we should use matching
ZRESvalue used for simplification (both imposm and import-sql).