Skip to content
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 buildings scale_rank and zoom 14 content #1732

Closed
nvkelso opened this issue Dec 14, 2018 · 3 comments
Closed

Restore buildings scale_rank and zoom 14 content #1732

nvkelso opened this issue Dec 14, 2018 · 3 comments
Assignees
Milestone

Comments

@nvkelso
Copy link
Member

nvkelso commented Dec 14, 2018

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

@zerebubuth
Copy link
Member

I've split the quantize off from the merging, and the scale_rank seems to be assigned as you describe.

Did we also want to change the cut-off for inclusion into the tile? It seems to me that dropping all the scale_rank > 3 at zoom 14 leaves us with no visual texture at all in cities.

For example, this view is flipping back and forth between dropping scale_rank > 3 on and off:

buildings_scale_rank

The light green buildings in the suburbs are scale_rank: 5 (rather than 1 as before) and the mid-blue ones are scale_rank: 4.

@nvkelso
Copy link
Member Author

nvkelso commented Dec 17, 2018

Yeah, let's try keeping the mid-blue ones of scale_rank: 4 at zoom 14, please.

(We don't want the bright green ones as those are the ones bloating the tiles at zoom 14, though).

@nvkelso
Copy link
Member Author

nvkelso commented Dec 26, 2018

This is working now, thanks!

@nvkelso nvkelso closed this as completed Dec 26, 2018
@ghost ghost removed the in review label Dec 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants