Hillshade borders in nodata transitions
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**: 0.47.0
### Question
I am trying to create a hillshade layer using my own RGB-tiles. Tiles provided to Mapbox are in png-format and are transparent where there is no height data. The hillshades work but I am getting a hillshade 'border' between where there is no data and where there is data. I suppose this is happening because Mapbox does not take the alpha-channel into consideration and sees the transparent pixels as the base value height. But there is no border between the transparent tile and the surrounding areas without any tiles. What is causing this border to render? Is there any way to get rid of it?
Mapbox source specification:
```json
"hillshadeSource": {
"type": "raster-dem",
"format": "pngraw",
"minzoom": 5,
"maxzoom": 8,
"scheme": "xyz",
"tileSize": 1024,
"tiles": ["http://localhost:3000/heightRGB/{z}/{x}/{y}.pngraw"]
}
```
Mapbox layer specification:
```json
{
"id": "hillshadeLayer",
"type": "hillshade",
"source": "hillshadeSource",
"minzoom": 5,
"paint": {
"hillshade-exaggeration": 1
}
}
```
One of the RGB-tiles:

Resulting output in Mapbox:

### Links to related documentation
https://www.mapbox.com/mapbox-gl-js/style-spec/#sources-raster-dem
https://www.mapbox.com/mapbox-gl-js/style-spec/#layers-hillshade
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
Start with the raster-dem source specification and hillshade layer specification linked in the issue, then compare the transparent nodata pixels with the rendered hillshade border. The issue names no source file or test; done would mean identifying the rendering cause and establishing a verified way to remove or avoid the border.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100