home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 514628738

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/2255#issuecomment-514628738 https://api.github.com/repos/pydata/xarray/issues/2255 514628738 MDEyOklzc3VlQ29tbWVudDUxNDYyODczOA== 8699967 2019-07-24T13:19:47Z 2019-07-24T13:55:35Z CONTRIBUTOR

How to create tiled TIFF files in the tests

One thing I would like to note is that the automatic chunking would be useful if the raster is tiled or not. I tested out a raster that was not tiled, but it still had chunks. This is due to the raster being written in stripes. So, I would recommend removing the restriction to only tiled rasters.

Also, to create a tiled raster: ```python import rasterio import numpy from affine import Affine

with rasterio.open( "tiled.tif", "w", driver="GTiff", count=2, width=1024, height=1024, crs="+init=epsg:4326", transform=Affine(0.0083333333, 0.0, -180.00416666665, 0.0, -0.0083333333, 75.00416666665), dtype=rasterio.float32, tiled=True, blockxsize=512, blockysize=512, ) as rds: rds.write((numpy.random.rand(2, 1024, 1024)*10).astype(numpy.float32)) ```

Looks like they have this option in the tests:

python open_kwargs=dict( tiled=True, blockxsize=512, blockysize=512 ) with create_tmp_geotiff(nx=1024, ny=1024, nz=2, open_kwargs=open_kwargs) as (tmp_file, expected): ....

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  336371511
Powered by Datasette · Queries took 0.637ms · About: xarray-datasette