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

I want to set a color for my tif, but a blue area appears around it #15737

Open
heian911 opened this issue Apr 14, 2024 · 3 comments
Open

I want to set a color for my tif, but a blue area appears around it #15737

heian911 opened this issue Apr 14, 2024 · 3 comments
Labels

Comments

@heian911
Copy link

image
image

@heian911 heian911 added the bug label Apr 14, 2024
@mike-000
Copy link
Contributor

If nodata is autodetected there will be another band for alpha

color: [
  'case',
  ['==', ['band', 2], 0],
  [0, 0, 0, 0],
  [
    'interpolate',
    ['linear'],
    ['band', 1],

    ...

  ],
],

If your data is being reprojected and the reprojected tiles are not aligned with the source grid you may need to specify

nodata: NaN,

to force an alpha band to added. See also #15042 (comment) and #15048

@heian911
Copy link
Author

如果自动检测到无数据,则会有另一个 alpha 波段

color: [
  'case',
  ['==', ['band', 2], 0],
  [0, 0, 0, 0],
  [
    'interpolate',
    ['linear'],
    ['band', 1],

    ...

  ],
],

如果您的数据正在重新投影并且重新投影的图块未与源网格对齐,您可能需要指定

nodata: NaN,

强制添加 alpha 带。另请参见#15042(评论)#15048

Thanks. But I have a question, why the color is beyond the range of tif?

@mike-000
Copy link
Contributor

The reprojected tiles for EPSG:3857 use the default grid for EPSG:3857. If there is no alpha in the output the overflow area will appear as the color for value zero

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants