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

Avoid creating tiles with one row each #14260

Merged
merged 2 commits into from Nov 5, 2022
Merged

Conversation

tschaub
Copy link
Member

@tschaub tschaub commented Nov 5, 2022

When the GeoTIFF source is used with imagery that doesn't have tiled layout, we end up creating one tile (and one HTTP request) per strip. In cases where there is only one row per strip, this is a lot of extra overhead. This change makes it so we try to fetch larger blocks of data, organizing things internally as 256x256 tiles if the image has does not have a tiled layout.

I've included an additional commit in this branch that ensures that the GeoTIFF source getView method resolves to a view with at least three zoom levels. When using GeoTIFFs that only have a single overview or have no overviews, the map is jumpy and frustrating to interact with. This is mostly due to the constraint added due to the extent in the resolved view. I think it would be a breaking change to remove the extent from the resolved view, so in this branch I'm only ensuring that there are at least three zoom levels to make things less frustrating.

@github-actions
Copy link

github-actions bot commented Nov 5, 2022

📦 Preview the website for this branch here: https://deploy-preview-14260--ol-site.netlify.app/.

@@ -108,6 +108,8 @@ function readRGB(preference, image) {
const STATISTICS_MAXIMUM = 'STATISTICS_MAXIMUM';
const STATISTICS_MINIMUM = 'STATISTICS_MINIMUM';

const defaultTileSize = 256;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 256 an arbitrary value, or did you choose this purposely over e.g. 512?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need to see how this works out in practice. If we make it too large, and the image is very wide, it could take a long time to load and parse - since the range requests will be for batches of rows that span the whole image width.

Copy link
Member

@ahocevar ahocevar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, I just dropped a question regarding default tile size.

@tschaub tschaub merged commit 86429f8 into openlayers:main Nov 5, 2022
@tschaub tschaub deleted the avoid-rows branch November 5, 2022 20:10
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.

None yet

2 participants