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

generate_tiles(image_format='.png') saves as TIFF with .png extension #74

Open
freezurbern opened this issue Aug 21, 2024 · 0 comments
Open

Comments

@freezurbern
Copy link

Hello,
I tried to generate tiles from a .tiff orthophoto into .png tiles but found the RasterIO metadata is not updated to use the png format.
Reproduce:

INPUT_PATH = "orthophoto.tiff"
OUTPUT_DIR = "raw-tiles"
gt = geotile.GeoTile(INPUT_PATH)
gt.generate_tiles(
    output_folder=OUTPUT_DIR, prefix="tile_",
    save_tiles=True, save_transform=True,
    image_format=".png", dtype="uint8",
)

Examine the output image to find the file type:

> file ./raw-tiles/tile_459.png
raw-tiles/tile_459.png: TIFF image data, ...

I believe the generate_tiles() image_format parameter should be used to set meta['driver'] before saving the tiles.

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

No branches or pull requests

1 participant