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

Water layer are too big at zoom 8 (zoom 7 at 512 tile size) #1477

Closed
4 tasks done
nvkelso opened this issue Feb 13, 2018 · 10 comments
Closed
4 tasks done

Water layer are too big at zoom 8 (zoom 7 at 512 tile size) #1477

nvkelso opened this issue Feb 13, 2018 · 10 comments
Assignees
Milestone

Comments

@nvkelso
Copy link
Member

nvkelso commented Feb 13, 2018

tl;dr

===

We did change the NE to OSM switchover in #1359.

So it's expected the feature count be different...

image 3

pasted image at 2018_02_13 12_25 pm 1

But it seems there are to many features / they have too many names, and their geometries aren't simplified.

At zoom 7 at 512 px tile size in Nextzen build (showing no geom simplification):

image 2

Compared to Mapzen build using Natural Earth source (using default NE shapes that are already generalized):

pasted image at 2018_02_13 12_25 pm

At zoom 8 at 512 px tile size in Nextzen (with generalization):

image 1

Compared with zoom 7 at 512 px tile size in Nextzen (no generalization):

image

/cc @bcamper

@nvkelso
Copy link
Member Author

nvkelso commented Feb 13, 2018

And in boundary calculation would explain the missing water lines:

@bcamper
Copy link
Collaborator

bcamper commented Feb 13, 2018 via email

@nvkelso
Copy link
Member Author

nvkelso commented Feb 13, 2018

Looking at number of water layer features, I think it's because the min_zoom is 2 decimal precision (eg: 8.12 instead of 8 or 8.1) which prevents feature merging.

Comparing the following two tiles:

The number of named water features is essentially the same at 68 or 69, and the remaining delta is 79 with the 2dd min_zoom in nextzen and only 7 count in the mapzen version with the int min_zoom.

But the feature count difference doesn't seem to affect total file size in GeoJSON format as both zoom 8 JSON files are 2.9 mb (compared to the huge file size difference at zoom 7).

Perhaps we should clip the min_zoom precision to 1dd (eg 8.1) for all layers except POIs (keeping them at 2dd)?

But this doesn't explain why there are more roads layer features in Nextzen as the min_zoom there is almost always an int (for other YAML related reasons).

Showing Nextzen tile having multiple unnamed features:

screen shot 2018-02-13 at 13 12 13

While Mapzen they were all dissolved to single features per kind and zoom (which was always 9, an error that was fixed).

screen shot 2018-02-13 at 13 22 13

@nvkelso
Copy link
Member Author

nvkelso commented Feb 13, 2018

For roads layer... it looks like the road features between new/old have the same geometry simplification, but I do see that feature count delta. Some of the delta is due to less feature merging (~120 more features with IDs that aren't merged)... but that doesn't account for the other 300 which don't have an ID implying they have been merged but to more total features than before.

Looking just at file size of the roads layer as GeoJSON, the Nextzen tile is 1.5 mb versus 1.3 mb Mapzen so it does add up.

Further research is needed.

@zerebubuth
Copy link
Member

Looking just at file size of the roads layer as GeoJSON, the Nextzen tile is 1.5 mb versus 1.3 mb Mapzen so it does add up.

The issue seems to be that when we added the surface (#1197) and access (#1328) tags to the roads, we forgot to drop them at low zooms like we do for other tags.

For the tile 512/all/7/37/48, I see the following feature counts for different values of surface:

surface Count
no value 2650
asphalt 445
concrete 68
paved 62
concrete_plates 8
gravel 7
metal 3
unpaved 2
compacted 2
wood 1
cobblestone 1

And the same for the access values:

access Count
no value 3203
yes 33
permissive 1
designated 4
no 4
hov 2
private 2

Dropping the surface and access properties would take the number of unique sets of properties down from 3,249 to 2,819 - which is much closer to the 2,826 in the Mapzen tiles.

@nvkelso nvkelso added this to the v1.6.0 milestone Sep 25, 2018
@nvkelso nvkelso changed the title Water, land, roads tile layers are too big at zoom 8 (zoom 7 at 512 tile size) Water layer are too big at zoom 8 (zoom 7 at 512 tile size) Nov 5, 2018
@nvkelso
Copy link
Member Author

nvkelso commented Nov 28, 2018

For dropping water names, here's what Walkabout style does (after a year of tweaking so I think it's fine to just copy server side):

https://github.com/tangrams/walkabout-style/blob/gh-pages/walkabout-style.yaml#L1258-L1279

        water-area-labels:
            visible: global.text_visible_water_labels
            filter:
                all:
                    - name: true
                    - $geometry: point
                    - not: { kind: [riverbank, dock, playa] }
                    - area: true
                any:
                    # show labels for smaller landuse areas at higher zooms
                    - { $zoom: { min: 5 },  area: { min: 10000000000 } }
                    - { $zoom: { min: 6 },  area: { min: 5000000000 } }
                    - { $zoom: { min: 7 },  area: { min: 400000000 } }
                    - { $zoom: { min: 8 },  area: { min: 200000000 } }
                    - { $zoom: { min: 9 },  area: { min: 100000000 } }
                    - { $zoom: { min: 10 }, area: { min: 10000000 } }
                    - { $zoom: { min: 11 }, area: { min: 4000000 } }
                    - { $zoom: { min: 12 }, area: { min: 750000 } }
                    - { $zoom: { min: 13 }, area: { min: 100000 } }
                    - { $zoom: { min: 14 }, area: { min: 50000 } }
                    - { $zoom: { min: 15 }, area: { min: 10000 } }
                    - { $zoom: { min: 16 } }

This is after the areas are already throttled generally in https://github.com/tangrams/walkabout-style/blob/gh-pages/walkabout-style.yaml#L1068-L1089:

        lakes:
            filter:
                all:
                    - kind: [ocean, lake, water, riverbank, reservoir, swimming_pool]
                # WARNING: any area filters here must match the area filters in the water_boundaries-not-ocean layer
                any:
                    # limit show smaller landuse areas to higher zooms
                    - { $zoom: { min: 0 },  area: { min: 40000000000 } }
                    - { $zoom: { min: 2 },  area: { min: 20000000000 } }
                    # some weird natural earth scale set transition
                    - { $zoom: { min: 3 },  area: { min: 80000000000 } }
                    - { $zoom: { min: 4 },  area: { min: 5000000000 } }
                    - { $zoom: { min: 5 },  area: { min: 700000000 } }
                    - { $zoom: { min: 6 },  area: { min: 500000000 } }
                    - { $zoom: { min: 7 },  area: { min: 160000000 } }
                    - { $zoom: { min: 8 },  area: { min: 20000000 } }
                    - { $zoom: { min: 9 },  area: { min: 5000000 } }
                    - { $zoom: { min: 10 }, area: { min: 1000000 } }
                    - { $zoom: { min: 11 }, area: { min: 200000 } }
                    - { $zoom: { min: 12 }, area: { min: 50000 } }
                    - { $zoom: { min: 13 }, area: { min: 20000 } }
                    - { $zoom: { min: 14 } }

Probably the order of operations is important to drop the features BEFORE generating the water boundary lines.

@nvkelso
Copy link
Member Author

nvkelso commented Nov 28, 2018

The above could probably be simplified to "pixel" areas. Tangram JS now has that facility but we never migrated the code... and vector-datasource has a generic pixel area... the above numbers are just for water features.

@nvkelso
Copy link
Member Author

nvkelso commented Dec 13, 2018

For the areas:

New:

image

Old:

image

For the labels:

New:
image

Old:
image

For @iandees:

New:

image

Old:

image

@nvkelso nvkelso closed this as completed Dec 13, 2018
@ghost ghost removed the send to staging label Dec 13, 2018
@iandees
Copy link
Member

iandees commented Dec 13, 2018

untitled

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

4 participants