|
Re: Is it possible to create a rasterio object without exporting a file?
Thank you, Alan!
that example is very helpful. i'll dig into this a bit deeper. xarray seems like a powerful tool for raster processing.
i've wanted to plan with it a bit more regardless.
Leah
Thank you, Alan!
that example is very helpful. i'll dig into this a bit deeper. xarray seems like a powerful tool for raster processing.
i've wanted to plan with it a bit more regardless.
Leah
|
By
Leah Wasser
·
#199
·
|
|
Re: Is it possible to create a rasterio object without exporting a file?
Hi Leah,
If you would like to try the rioxarray as an xarray extension, it is now available on pypi.
An example of what you would like to do is
Hi Leah,
If you would like to try the rioxarray as an xarray extension, it is now available on pypi.
An example of what you would like to do is
|
By
Alan Snow
·
#198
·
|
|
tempfile.NamedTemporaryFile behaving as /vsimem and eating all the machine memory
While working on https://github.com/cogeotiff/rio-cogeo/pull/75 we noticed strange behaviors with `vsimem` driver (this could be a GDAL but TBH).
1. When using `tempfile.NamedTemporaryFile()`
While working on https://github.com/cogeotiff/rio-cogeo/pull/75 we noticed strange behaviors with `vsimem` driver (this could be a GDAL but TBH).
1. When using `tempfile.NamedTemporaryFile()`
|
By
vincent.sarago@...
·
#197
·
|
|
Re: Is it possible to create a rasterio object without exporting a file?
Hi Leah,
So, this project uses xarray which has many similar operations to numpy, but with slight differences.
In the case of the example, the `drop=True` is an option they provide that is described
Hi Leah,
So, this project uses xarray which has many similar operations to numpy, but with slight differences.
In the case of the example, the `drop=True` is an option they provide that is described
|
By
Alan Snow
·
#196
·
|
|
Re: Is it possible to create a rasterio object without exporting a file?
Hey Alan,
this is super helpful.
digging through your code. how does this line work:
cropped_ds = self._obj.where(clip_mask_xray, drop=True).astype(self._obj.dtype)
i'm familiar with numpy.where
Hey Alan,
this is super helpful.
digging through your code. how does this line work:
cropped_ds = self._obj.where(clip_mask_xray, drop=True).astype(self._obj.dtype)
i'm familiar with numpy.where
|
By
Leah Wasser
·
#195
·
|
|
Re: Is it possible to create a rasterio object without exporting a file?
Hi Leah,
Here is an example of what you want to do:
https://github.com/corteva/geocube/blob/582ea0c2f3f0ba91326de098b75412e5033bee21/geocube/xarray_extensions/rioxarray.py#L617
It uses xarray, but the
Hi Leah,
Here is an example of what you want to do:
https://github.com/corteva/geocube/blob/582ea0c2f3f0ba91326de098b75412e5033bee21/geocube/xarray_extensions/rioxarray.py#L617
It uses xarray, but the
|
By
Alan Snow
·
#194
·
|
|
Is it possible to create a rasterio object without exporting a file?
Hi All,
I am running into a consistent workflow issue. i'd like to crop a numpy array. I have metadata dict and a numpy array but then want to crop it. is there a way to crop a numpy array to a new
Hi All,
I am running into a consistent workflow issue. i'd like to crop a numpy array. I have metadata dict and a numpy array but then want to crop it. is there a way to crop a numpy array to a new
|
By
Leah Wasser
·
#193
·
|
|
Re: Is it possible to open a binary file with rasterio.open?
Hi,
If you pass a Python file object opened in "r" mode to rasterio.open, the contents will be read and stored in a MemoryFile. See
Hi,
If you pass a Python file object opened in "r" mode to rasterio.open, the contents will be read and stored in a MemoryFile. See
|
By
Sean Gillies
·
#192
·
|
|
Is it possible to open a binary file with rasterio.open?
Hi all,
I've been using rasterio for few days, and now experiencing a situation where I can't find any help.
I read in the doc that when using `rasterio.open(fp,...)` it is possible to pass a binary
Hi all,
I've been using rasterio for few days, and now experiencing a situation where I can't find any help.
I read in the doc that when using `rasterio.open(fp,...)` it is possible to pass a binary
|
By
htaidirt@...
·
#191
·
|
|
Re: Memory error in rio calc that equivalent gdal_calc.py performs quickly without issue
rio-calc does indeed read the entire file. The requirement to use it on files too large to fit in memory hasn't come up before. Modifying it to work on only one (or several, using a thread or process
rio-calc does indeed read the entire file. The requirement to use it on files too large to fit in memory hasn't come up before. Modifying it to work on only one (or several, using a thread or process
|
By
Sean Gillies
·
#190
·
|
|
Memory error in rio calc that equivalent gdal_calc.py performs quickly without issue
Today I tried to replace a `gdal_calc.py` command with the equivalent `rio calc`, because I wanted a UInt8 output, and `gdal_calc.py` restricts me to UInt16.
The GDAL command is relatively quick
Today I tried to replace a `gdal_calc.py` command with the equivalent `rio calc`, because I wanted a UInt8 output, and `gdal_calc.py` restricts me to UInt16.
The GDAL command is relatively quick
|
By
lawr@...
·
#189
·
|
|
Re: Rewriting uint16 headers with rasterio / applying rio color makes them unreadable by Preview, Photoshop
Got it, thanks!!
By
Edward Boyda
·
#188
·
|
|
Re: How to extract DATA_ENCODING creation option type from an input grib2 file for use in the output grib2 file
In case anyone ends up needing to do this, I ended up using eccodes and you can retrieve and set 'packingType' which is the same as DATA_ENCODING with codes_get and codes_set
Thanks,
-Shane
In case anyone ends up needing to do this, I ended up using eccodes and you can retrieve and set 'packingType' which is the same as DATA_ENCODING with codes_get and codes_set
Thanks,
-Shane
|
By
Shane Mill - NOAA Affiliate
·
#187
·
|
|
Re: Rewriting uint16 headers with rasterio / applying rio color makes them unreadable by Preview, Photoshop
For GeoTIFF (at least), the photometric creation option is different from the color interpretation that we can get/set using the GDAL API. The file's layout and compression strategy is influenced by
For GeoTIFF (at least), the photometric creation option is different from the color interpretation that we can get/set using the GDAL API. The file's layout and compression strategy is influenced by
|
By
Sean Gillies
·
#186
·
|
|
Re: Rewriting uint16 headers with rasterio / applying rio color makes them unreadable by Preview, Photoshop
Thanks, Sean, that works for rio color. I use the photometric creation option with gdal_translate but didn't connect the dots to rio color.
I can see why, given all the possible creation options,
Thanks, Sean, that works for rio color. I use the photometric creation option with gdal_translate but didn't connect the dots to rio color.
I can see why, given all the possible creation options,
|
By
Edward Boyda
·
#185
·
|
|
Re: How to extract DATA_ENCODING creation option type from an input grib2 file for use in the output grib2 file
Hey Sean,
Thanks for the response, I can definitely see why that would be problematic, especially for converting between formats. That makes perfect sense to me. It's unfortunate that it isn't
Hey Sean,
Thanks for the response, I can definitely see why that would be problematic, especially for converting between formats. That makes perfect sense to me. It's unfortunate that it isn't
|
By
Shane Mill - NOAA Affiliate
·
#184
·
|
|
Re: How to extract DATA_ENCODING creation option type from an input grib2 file for use in the output grib2 file
Hi Shane,
Before Rasterio 1.0, the project did record creation options in a custom tag (metadata) namespace. We discovered problems when converting from GeoTIFF to other formats: creation options are
Hi Shane,
Before Rasterio 1.0, the project did record creation options in a custom tag (metadata) namespace. We discovered problems when converting from GeoTIFF to other formats: creation options are
|
By
Sean Gillies
·
#183
·
|
|
How to extract DATA_ENCODING creation option type from an input grib2 file for use in the output grib2 file
Hey everyone,
I know that grib2 isn't commonly used by this community so I apologize that I keep bringing it up... You can probably tell that I am super fond of it! Anyways, all kidding aside, I am
Hey everyone,
I know that grib2 isn't commonly used by this community so I apologize that I keep bringing it up... You can probably tell that I am super fond of it! Anyways, all kidding aside, I am
|
By
Shane Mill - NOAA Affiliate
·
#182
·
|
|
Re: Rewriting uint16 headers with rasterio / applying rio color makes them unreadable by Preview, Photoshop
Hi Ed,
Can you try the following variation on your first command?
$ rio color -j 1 uint16_image.tif uint16_brightened.tif gamma RGB 1.5 --co photometric=RGB
Note the addition of "--co
Hi Ed,
Can you try the following variation on your first command?
$ rio color -j 1 uint16_image.tif uint16_brightened.tif gamma RGB 1.5 --co photometric=RGB
Note the addition of "--co
|
By
Sean Gillies
·
#181
·
|
|
Adding internal API reference links to the narrative docs
Hi all,
In the Rasterio quickstart guide I've added some links to API documentation. For example, see the "open()" link under the 2nd code block in
Hi all,
In the Rasterio quickstart guide I've added some links to API documentation. For example, see the "open()" link under the 2nd code block in
|
By
Sean Gillies
·
#180
·
|