Comments (4)
Note that rasterio.open works perfectly with the same data.
from geoutils.
If Raster created with load_data=False
then this error is not raised. Problem is in load() method.
from geoutils.
Even more strangely:
In [26]: vrt_sw = gr.Raster('master_SW_1985_count.vrt')
ERROR 4: No such file or directory
---------------------------------------------------------------------------
CPLE_OpenFailedError Traceback (most recent call last)
rasterio/_io.pyx in rasterio._io.DatasetReaderBase._read()
rasterio/shim_rasterioex.pxi in rasterio._shim.io_multi_band()
rasterio/_err.pyx in rasterio._err.exc_wrap_int()
CPLE_OpenFailedError: No such file or directory
During handling of the above exception, another exception occurred:
RasterioIOError Traceback (most recent call last)
<ipython-input-26-88f7c053cdb3> in <module>()
----> 1 vrt_sw = gr.Raster('master_SW_1985_count.vrt')
/home/tedstona/scripts/GeoUtils/geoutils/georaster.py in __init__(self, filename, attrs, load_data, bands)
87
88 if load_data:
---> 89 self.load(bands)
90 self.isLoaded = True
91 self.matches_disk = True
/home/tedstona/scripts/GeoUtils/geoutils/georaster.py in load(self, bands)
267 """
268 if bands is None:
--> 269 self.data = self.ds.read()
270 else:
271 self.data = self.ds.read(bands)
rasterio/_io.pyx in rasterio._io.DatasetReaderBase.read()
rasterio/_io.pyx in rasterio._io.DatasetReaderBase._read()
RasterioIOError: Read or write failed. No such file or directory
But then, calling read() manually on the same Raster:
In [27]: vrt_sw.ds.read()
Out[27]:
array([[[-1., -1., -1., ..., -1., -1., -1.],
[-1., -1., -1., ..., -1., -1., -1.],
[-1., -1., -1., ..., -1., -1., -1.],
...,
[-1., -1., -1., ..., -1., -1., -1.],
[-1., -1., -1., ..., -1., -1., -1.],
[-1., -1., -1., ..., -1., -1., -1.]]], dtype=float32)
And vrt_sw.load() also then works:
In [29]: vrt_sw.data
Out[29]:
array([[[-1., -1., -1., ..., -1., -1., -1.],
[-1., -1., -1., ..., -1., -1., -1.],
[-1., -1., -1., ..., -1., -1., -1.],
...,
[-1., -1., -1., ..., -1., -1., -1.],
[-1., -1., -1., ..., -1., -1., -1.],
[-1., -1., -1., ..., -1., -1., -1.]]], dtype=float32)
from geoutils.
Error is also reproducible as follows:
from rasterio.io import MemoryFile
import pprint
with open('/scratch/merge_sw/master_SW_skel.vrt', 'rb') as f, MemoryFile(f) as memfile:
with memfile.open() as src:
pprint.pprint(src.profile)
src.read()
---------------------------------------------------------------------------
CPLE_OpenFailedError Traceback (most recent call last)
rasterio/_io.pyx in rasterio._io.DatasetReaderBase._read()
rasterio/shim_rasterioex.pxi in rasterio._shim.io_multi_band()
rasterio/_err.pyx in rasterio._err.exc_wrap_int()
CPLE_OpenFailedError: No such file or directory
During handling of the above exception, another exception occurred:
RasterioIOError Traceback (most recent call last)
<ipython-input-24-0a4694dcf8ca> in <module>
3 with memfile.open() as src:
4 pprint.pprint(src.profile)
----> 5 src.read()
rasterio/_io.pyx in rasterio._io.DatasetReaderBase.read()
rasterio/_io.pyx in rasterio._io.DatasetReaderBase._read()
RasterioIOError: Read or write failed. No such file or directory
from geoutils.
Related Issues (20)
- Add `footprint` as an attribute of both `Raster` and `Vector`
- Add `to_area_or_point()` method to clarify the weird transformation behaviour of `set_area_or_point`?
- Add option to add background basemap to plots HOT 1
- Add `set_crs` and `set_transform` to force re-set geospatial attributes? HOT 3
- Detail other implicit features of GeoUtils in documentation: minimal loss of information, ensuring projected CRS for distance-dependant operations
- Add `Vector.shift()` function mirroring `Raster.shift()`
- Add option to `Vector.crop()` for removing all features not contained (instead of intersecting)
- Make "New_ID" an argument in `Raster.polygonize`
- Rename `value_at_coords` and make expected input same as `interp_points` HOT 1
- `value_at_coords` returns nodata values instead of NaNs
- Force colorbar of `Vector.plot()` to fit the axis
- Add `Mask.buffer()` to apply dilation/erode in CRS units consistently (without also eroding raster edges)?
- Add `Raster.merge()` relying on `merge_rasters()`? HOT 3
- Raster clipping HOT 2
- Fix notebook downloading in documentation
- Padding of colorbar in `Vector.plot()` varies despite fixed `pad` in `cax.append_axes`
- Fix documentation example for `merge_rasters` to work with different CRS
- Reprojection of a multiband Raster on a single band Raster doesn't work HOT 1
- Export an elevation profile from a Raster along a Vector line. HOT 2
- Documentation API not always showing up properly HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geoutils.