-
Notifications
You must be signed in to change notification settings - Fork 120
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
Restore building scale rank #1739
Restore building scale rank #1739
Conversation
…min zoom to scale rank to avoid divergent properties in merge.
GIF looks great! Do we have any idea on file size impact for a few tiles? |
Yup, I'm running the analysis now. Will post as soon as it's done. |
Looks somewhat as expected: We're including more features at zoom 14, so the buildings layer size has gone up. The slight increase at zoom 15 is because we're not able to merge quite as much as we were able to before (because everything effectively had San Francisco Downtown
San Francisco Suburbs (Sunset)
Santa Monica
|
# fit min zoom onto the scale rank, as we'll be using the scale rank rather | ||
# than the min zoom to calculate whether a building should make it into a | ||
# tile. having them split separately means we can't merge them together. | ||
- fn: vectordatasource.transform.clamp_min_zoom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens in zoom 16? If we clamp feature inclusion at zooms 13, 14, 15 based on scale_rank, but don't clamp at max zoom 16, it seems like zoom 16 would include new features that could have a min_zoom < 16 but weren't shown at the earlier zooms?
Should we go farther and make scale_rank
and min_zoom
consistent (and then mark scale_rank
for retirement in v2)?
From the map examples, including the clamping:
scale_rank | min_zoom | color in map |
---|---|---|
1 | 13 | dark green |
2 | 13.5 | ¿missing? |
3 | 14 | dark blue |
4 | 14.5 | light blue |
5 | 15 | light green |
In the existing building.yaml file:
- &z13_area_volume
all:
any:
way_area: { min: 5000 }
volume: { min: 150000 }
not: { "tags->location": "underground" }
- &z14_area_volume
any:
way_area: { min: 3000 }
volume: { min: 100000 }
- &z15_area_volume
way_area: { min: 20 }
- &z16_area_volume
way_area: { min: 10 }
In Bubble Wrap:
problematic at zoom 15
filter:
# show footprints for buildings at least one zoom level before they will be extruded
- { $zoom: 13, scale_rank: [1,2] }
- { $zoom: 14, scale_rank: [1,2,3] }
- { $zoom: 15, height: { min: 100 } }
- { $zoom: 15, area: { min: 500 } }
- { $zoom: 15, volume: { min: 100000 } }
- { $zoom: 16, area: { min: 100 } }
- { $zoom: 16, volume: { min: 50000 } }
- { $zoom: { min: 17 }, area: true }
In Refill (map):
problematic at zoom 15
footprints:
filter:
any:
- { $zoom: [13], scale_rank: [1,2] }
- { $zoom: [14], scale_rank: [1,2,3] }
- { $zoom: [15], height: { min: 100 } }
- { $zoom: [15], area: { min: 500 } }
- { $zoom: [15], volume: { min: 100000 } }
- { $zoom: [16], area: { min: 100 } }
- { $zoom: [16], volume: { min: 50000 } }
- { $zoom: { min: 17 }, area: true }
Then the existing scale_rank.csv is:
area::int,height::float,volume::int,landuse_kind,scale_rank
>=100000,*,*,*,1
*,>=250,*,*,1
*,*,>=300000,*,1
>=20000,*,*,*,2
>=5000,*,*,+,2
*,>=150,*,*,2
*,*,>=150000,*,2
>=5000,*,*,*,3
>=3000,*,*,+,3
*,>=100,*,*,3
*,*,>=100000,*,3
>=1000,*,*,*,4
>=500,*,*,+,4
*,*,>=50000,*,4
+,*,*,*,5
Should the building.yaml file change like (I'm fussy on the landuse_kind and 14.5 logic)?
- &z13_area_volume
all:
any:
way_area: { min: 100000 } # was 5000, larger value from scale_rank CSV
height: { min: 250 } # newly added from scale_rank CSV
volume: { min: 300000 } # was 150000, larger value from scale_rank CSV
not: { "tags->location": "underground" }
- &z14_area_volume
any:
way_area: { min: 3000 } # no change, same as scale_rank CSV (prefer landuse area)
height: { min: 100 } # newly added from scale_rank CSV
volume: { min: 100000 } # no change, same as scale_rank CSV
not: { "tags->location": "underground" } # NEW
# needs corresponding YAML change later on for 14.5 min_zoom assignment
- &z14d5_area_volume
any:
way_area: { min: 500 } # NEW, same as scale_rank CSV (prefer landuse area)
height: { min: 100 } # NEW, same as scale_rank CSV (from z14_area_volume)
volume: { min: 50000 } # NEW, same as scale_rank CSV
not: { "tags->location": "underground" } # NEW
- &z15_area_volume
any:
way_area: { min: 200 } # was 20, larger value between scale_rank CSV (100) and map style (500)
height: { min: 15 } # NEW, middle ground to remove < 3 story buildings; map style 100
volume: { min: 10000 } # NEW, smaller compromise between area * height, map style (100000)
- &z16_area_volume
way_area: { min: 10 } # no change, same as scale_rank CSV, because of backyard sheds
# Implied that features with way_area smaller than 10 are `min_zoom: 17` later in YAML
Then this clamp section wouldn't be needed at all? We leave the scale_rank CSV alone, but only modify the min_zoom calcs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens in zoom 16?
Ah, well spotted, thanks! Yes, we should make that consistent. I've made the change in 449a1d7.
Should we go farther and make
scale_rank
andmin_zoom
consistent (and then markscale_rank
for retirement in v2)? ... Then this clamp section wouldn't be needed at all? We leave thescale_rank
CSV alone, but only modify themin_zoom
calcs?
Unfortunately, the scale_rank
calculation makes use of the landuse_kind
, which is assigned by a post-processor and not known when we assign min_zoom
in the database. I'm all for simplifying, but we'll end up with a process that looks a lot like the current one (i.e: assign the minimum min_zoom
for the feature, then assign scale_rank
, then use scale_rank
to clamp min_zoom
- basically dropping half a zoom based on landuse_kind
).
One question is how the min_zoom
logic works in the client. If we assign a min_zoom
of 14.5, will that be visible in the zoom 14 tile? Or would it require work-arounds in the style file (filter: function() { return $zoom > feature.min_zoom - 0.5; }
) to make sure that we're not including a bunch of data in the tile that'll never be shown?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We talked about this IRL...
Now that the clamp is always applied I think we're aways consistent, thanks!
Please add tests to ensure min_zoom: 16
and min_zoom: 17
buildings (tiny ones!) still get their min_zoom preserved, then I think we're good for merging.
I filed #1745 to address removing scale_rank
entirely (just in favor of min_zoom
) for eventual v2 milestone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the 2 more small (literally small area!) tests and then we're ready for merging :)
… make sure it's not decreasing min_zoom for small buildings.
Thanks! Small area tests added in ca66504. |
Made
scale_rank
on buildings meaningful again - based on the properties before merging rather than after.Connects to #1732.