![]() Insp command opens the hood of any raster dataset so you can poke around Rasterio’s command line interface, named “rio”, is documented at cli.rst. ![]() open ( 'example-total.tif', 'w', ** profile ) as dst : dst. uint8, count = 1, compress = 'lzw' ) with rasterio. For # the new file's profile, we start with the meta attributes of # the source file, but then change the band count to 1, set the # dtype to uint8, and specify LZW compression. shape ) for band in r, g, b : total += band total /= 3 # Write the product as a raster band to a new 8-bit file. Adding other # arrays to it in-place converts those arrays "up" and # preserves the type of the total array. Expecting that the sum will # temporarily exceed the 8-bit integer range, initialize it as # a 64-bit float (the numpy default) array. open ( 'tests/data/' ) as src : r, g, b = src. import numpy as np import rasterio # Read raster bands directly to Numpy arrays. This new band is then written to a new single band TIFF. Three bandsĪre read from an image and averaged to produce something like a panchromaticīand. ![]() Here’s an example of some basic features that Rasterio provides.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |