Raster layer paint raster resampling set to nearest does not work as expected
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
**mapbox-gl-js version**:
v3.4.0
**browser**:
Chrome 125
### Steps to Trigger Behavior
1. Upload a raster file ([file used in example can be found here](https://inzenl.com/raster.tiff))
2. Add the raster source with this file to mapbox
3. Add the raster layer *with "paint"."raster-resampling" set to "nearest"*
4. Zoom in
### Link to Demonstration
https://jsbin.com/bekoxekoqi/edit?html,js,output
### Expected Behavior
Mapbox should display something like this (taken from QGIS)

### Actual Behavior
It still seems to do *some* type of linear scaling

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior using the linked JSBin, the raster.tiff example, and mapbox-gl-js v3.4.0 in Chrome 125, then inspect the raster layer handling for the raster-resampling paint setting. Done means a raster layer configured with "nearest" displays nearest-neighbor sampling when zoomed in, rather than the observed linear scaling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- computer-graphics, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100