mapbox / mapbox/mapbox-gl-js

Hillshade borders in nodata transitions

Open
#7,283 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle:
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:
![68](https://user-images.githubusercontent.com/42138011/45535188-eb793c00-b7fd-11e8-9e25-c4d7384f5771.png)

Resulting output in Mapbox:
screenshot

### 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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.