Skip to content

Restore buildings scale_rank and zoom 14 content #1732

@nvkelso

Description

@nvkelso

Originally posted by @nvkelso in #1686 (comment)

First: the change for #1686 looks visually great for Bubble Wrap and hugely reduces file size. Huzzah!

But there seem to be 2 issues that this followup issue should address:

  • scale_rank is always 1 now instead of range of 1 to 5. -- regression we should fix
  • zoom 14 missing some buildings -- not a ship block issue, but we'd likely fix it fixing the regression, and it's important for a style like Refill which we've compromised a bit.

To clarify, I think zoom 13 looks better in this new setup (dropping more buildings), but zoom 14 looks worse (drops slightly too many buildings).

Let's dig into this...

This change effectively almost always renders features with scale_rank of 1 for merged features (versus pre-merged features), when there used to be range of 0 to 5 – see all the dark green in the GIFs above.

# assign scale_rank - AFTER merging, as this changes the area and volume
fn: vectordatasource.transform.csv_match_properties

That's apparently why the "blue" buildings in the before at zoom 14 are missing from the after in, because merged buildings always have huge area:

SF: 14/37.7822/-122.4300

buildings_zoom_14

Which also makes this "always" true at zooms 13 and 14, because all features are always incorrectly scale_rank: 1:

           - { $zoom: 13, scale_rank: [1,2] }
           - { $zoom: 14, scale_rank: [1,2,3] }

Seems like merging needs to happen after drop_features_where?

  • fn: vectordatasource.transform.drop_features_where

And to keep the fewer buildings at zoom 13 we'd change this line to be > 1?

  where: scale_rank > 2

And the updated quantize needs to probably be done FIRST, but MERGING split off from that and done last?

  13: vectordatasource.transform.quantize_height_round_nearest_20_meters
   14: vectordatasource.transform.quantize_height_round_nearest_10_meters
   15: vectordatasource.transform.quantize_height_round_nearest_10_meters

I suspect the new height filter (below) makes it mostly look correct, except for zoom 14 and the excessive use of scale_rank: 1?

Like if the old scale_rank [1,2,3] logic (which includes height) for pre-merge building with a height >= 100 then it'll still appear in zoom 14, but in this new setup lower height but larger area/volume buildings are now excluded.

  - fn: vectordatasource.transform.numeric_min_filter
    params:
      source_layer: buildings
      mode: any
      filters:
        13: { area: 5000, height: 150, volume: 150000 }
        14: { area: 3000, height: 100, volume: 100000 }
        15: { area:  500, height: 100, volume: 100000 }

Merging gets unhappy when processing too many buildings so we do some partitioning there along the way now... but probably pre-partitioning by scale_rank again would accomplish some of those same goals?

(Look at the "blue" buildings...)

Los Angeles 14/34.0013/-118.4290:

buildings_zoom_14_los_angeles

Paris 14/48.8586/2.3264:

buildings_zoom_14_paris

Sao Paulo 14/-23.5427/-46.6418:

buildings_zoom_14_sao_paulo

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions