Skip to content

reparse overscaled tiles - #1005

Merged
ansis merged 1 commit into
masterfrom
reparse-overscaled
Feb 20, 2015
Merged

ansis merged 1 commit into
masterfrom
reparse-overscaled

Conversation

@ansis

@ansis ansis commented Feb 18, 2015

Copy link
Copy Markdown
Contributor

Fixes #1004

@jfirebaugh this was easier to handle by adding a couple special cases in Source and TileCoord than by loading multiple copies and clipping.

  • It uses the maxzoom to generate a cover, but creates tiles with the current zoom's z.
  • When generating the url, it uses maxzoom if z > maxzoom.
  • TileCoord's .parent() and .children() have a special case when z > maxzoom.

When the current zoom is past the vectortile source's maxzoom, load overscaled tiles and parse them specifically for the current integer zoom level. This is necessary to:

  • make layout property functions work
  • let us place labels only 1 zoom level deep (for performance)

Overscaled tile id's have the same x/y/w as their corresponding tiles from the source's maxzoom.

For example:

currentzoom: 18
maxzoom: 16

The overscaled tile { z: 18, x: 123, y: 456 }
loads the real tile { x: 16, x: 123, y: 456 }

@mourner

mourner commented Feb 18, 2015

Copy link
Copy Markdown
Member
  • fix GeoJSON disappearing after z15
  • fix tests

@mourner

mourner commented Feb 18, 2015

Copy link
Copy Markdown
Member

Also, considering underlying data is the same for overscaled tile and max zoom tile, could we change interpolation so that it doesn't jump when the overscaled tiles are loaded?

@ansis ansis closed this Feb 18, 2015
@ansis ansis reopened this Feb 18, 2015
@ansis

ansis commented Feb 18, 2015

Copy link
Copy Markdown
Contributor Author

fix GeoJSON disappearing after z15

Should we just remove maxzoom for geojson sources? or would it be better to also overscale geojson tiles?

Also, considering underlying data is the same for overscaled tile and max zoom tile, could we change interpolation so that it doesn't jump when the overscaled tiles are loaded?

Yes, we should look at this more carefully when all the other labeling stuff is done.

@mourner

mourner commented Feb 18, 2015

Copy link
Copy Markdown
Member

Should we just remove maxzoom for geojson sources? or would it be better to also overscale geojson tiles?

We could do either way. The advantage of overscaling vs generating new clipped tiles is potentially no jumpy tiles. cc @jfirebaugh

When the current zoom is past the vectortile source's maxzoom, load
overscaled tiles and parse them specifically for the current integer
zoom level. This is necessary to:
- make layout property functions work
- let us place labels only 1 zoom level deep (for performance)

Overscaled tile id's have the same x/y/w as their corresponding tiles
from the source's maxzoom. For example:

currentzoom: 18
maxzoom: 16

The overscaled tile { z: 18, x: 123, y: 456 }
loads the real tile { x: 16, x: 123, y: 456 }
@ansis
ansis force-pushed the reparse-overscaled branch from 47c1fcb to 55b4b39 Compare February 18, 2015 20:54
@ansis

ansis commented Feb 18, 2015

Copy link
Copy Markdown
Contributor Author

Both tests and rendering tests pass (with mapbox/mapbox-gl-test-suite#17).
Geojson is also fixed.

@jfirebaugh

Copy link
Copy Markdown
Contributor

👍

@ansis
ansis merged commit 55b4b39 into master Feb 20, 2015
@ansis
ansis deleted the reparse-overscaled branch February 20, 2015 21:52
@kkaefer

kkaefer commented Feb 20, 2015

Copy link
Copy Markdown
Member

Can we get this ported to native?

@ansis

ansis commented Feb 20, 2015

Copy link
Copy Markdown
Contributor Author

@kkaefer I'll start on it soon. issue so that I don't forget: mapbox/mapbox-gl-native#912

@kkaefer

kkaefer commented Feb 20, 2015

Copy link
Copy Markdown
Member

Also, is this covered by tests?

@ansis

ansis commented Feb 20, 2015

Copy link
Copy Markdown
Contributor Author

mapbox/mapbox-gl-test-suite@28b6a25 adds rendering tests. Is there anything that should be covered by regular tests?

@kkaefer

kkaefer commented Feb 21, 2015

Copy link
Copy Markdown
Member

Can we use a few sample tiles and compare the output of the clipped tile algorithm with the expected result?

@ansis

ansis commented Feb 21, 2015

Copy link
Copy Markdown
Contributor Author

@kkaefer we're not actually clipping the data. It draws an overscaled tile the same way it used to draw it. The only change is that instead of reusing the same tile object, it creates a new tile object. It creates a new tile object so that layout property functions work and so that labelling gets reprocessed for that zoom level.

ansis added a commit to mapbox/mapbox-gl-native that referenced this pull request Apr 9, 2015
This reparses tiles at zoom levels > the sources maxzoom so that
layout property functions are applied and label are replaced.

mapbox/mapbox-gl-js#1005
and
mapbox/mapbox-gl-js@794c1eb
ansis added a commit to mapbox/mapbox-gl-native that referenced this pull request Apr 9, 2015
This reparses tiles at zoom levels > the sources maxzoom so that
layout property functions are applied and label are replaced.

mapbox/mapbox-gl-js#1005
and
mapbox/mapbox-gl-js@794c1eb
ansis added a commit to mapbox/mapbox-gl-native that referenced this pull request May 28, 2015
so that layout property functions are applied correctly
and so that label placement is redone

js:
mapbox/mapbox-gl-js#1005
and
mapbox/mapbox-gl-js@440bc02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reload, scale, and clip tiles for z > source.maxZoom

4 participants