openlayers / openlayers/openlayers

sourcesFromTileGrid should translate from view to source projection

Open
#16,985 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
JavaScript
Stars
12.6k
Forks
3.2k
Avg merge
2d 17h
Merged PRs (30d)
21

Description

Following the example at https://openlayers.org/en/latest/examples/cog-pyramid.html I have a tile grid in EPSG:4269 that I would like to display in EPSG:3857 but the function returned by sourcesFromTileGrid() is passed an extent and resolution in the view projection EPSG:3857 and does not do any translation to EPSG:4269 before building the list of sources to return. At zoom 0 the function returns the coarsest tiles, which are displayed correctly, but zoomed in the function returns an empty list.

The TileGrid should have a projection associated with it, or sourcesFromTileGrid() should assume that the projection of the TileGrid matches that of the sources returned by the source factory function. The function returned by sourcesFromTileGrid() should somehow determine the view projection and do something reasonable to select sources from the grid. Because a single GeoTIFF source reads projected internal tiles correctly I assume that similar logic is already implemented there.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating sourcesFromTileGrid and reviewing the cog-pyramid example, then trace how its extent and resolution are passed to the source factory. Compare this with the projection handling used by GeoTIFF sources. Done means zoomed-in EPSG:3857 views select the appropriate EPSG:4269 sources instead of returning an empty list.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.