Re: GDAL doesn't include file gcs.csv anymore
Sean Gillies
Hi, On Mon, Sep 7, 2020 at 8:18 AM <pierrick.rambaud49@...> wrote:
How did you install rasterio? If you got it with `pip install rasterio` you will have installed a wheel file that includes GDAL 2.4.4 and data files and which will be incompatible with the GDAL 3.0.4 installed on your system. If that is the case, you should unset GDAL_DATA. Rasterio in the wheel will detect its own data files and does not need GDAL_DATA to be set. Sean Gillies
|
|
Re: Status of GDAL 3.1 Support?
Sean Gillies
Hi Daryl, On Mon, Sep 7, 2020 at 6:01 AM Herzmann, Daryl E [AGRON] <akrherz@...> wrote: Howdy, We're testing rasterio's trunk against GDAL 3.1.2 here: https://travis-ci.org/github/mapbox/rasterio. We are not currently checking the 1.1.x branch, but in my experience there are no problems. I have rasterio 1.1.5, GDAL 3.1.2, and PROJ 7.1.0 in production. Sean Gillies
|
|
GDAL doesn't include file gcs.csv anymore
pierrick.rambaud49@...
descriptionI'm using [geemap](https://github.com/giswqs/geemap) to display a raster on a created map.
This lib use `xarray_leaflet` to display the raster and this lib will end up using `rasterio` to manipulate the .tif file.
When I launch my display :
m = geemap.Map()
m.add_raster(clip_map, colormap='terrain', layer_name='gfc')
I get the following error :
> CRSError: Unable to open EPSG support file gcs.csv. Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.
This error is everywhere on SO so I tried to verify if my GDAL_DATA env variable was coorectly set :
import os
import stat
gdal_data = os.environ['GDAL_DATA']
print('is dir: ' + str(os.path.isdir(gdal_data)))
gcs_csv = os.path.join(gdal_data, 'gcs.csv')
print('is file: ' + str(os.path.isfile(gcs_csv)))
st = os.stat(gcs_csv)
print('is readable: ' + str(bool(st.st_mode & stat.S_IRGRP)))
# out
# is dir: True
#is file: False
#FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/gdal/gcs.csv'
going to the glad distrib inb the `NEWS` file, I read that they removed lots of file in 3.0 including `gcs.csv`. So it's no longer included in my folder.
Is there a workaround ?
|
|
Status of GDAL 3.1 Support?
Herzmann, Daryl E [AGRON]
Howdy,
I am curious about rasterio's current GDAL version support? Presently, my conda environment is pinned down to GDAL < 3.1 https://github.com/conda-forge/rasterio-feedstock/pull/171#issuecomment-678631972 As I search around on rasterio's github, I find this PR which seems to pass tests against newer GDALs? https://github.com/mapbox/rasterio/pull/1987 Is there some GH issue tracking GDAL 3.1 support or should 1.1.5 rasterio work with GDAL 3.1? thanks! daryl
|
|
Re: Black border after running rio mask
ts@...
Thanks for your help Sean,
I can confirm the black artifacts come from jpeg compression. I also found this answered which explains the problem in detail: https://gis.stackexchange.com/a/114453/52871 best regards, Toni
|
|
Re: Black border after running rio mask
Sean Gillies
Hi, On Sat, Aug 29, 2020 at 8:52 AM <ts@...> wrote: Dear Rasterio developers and useers, It looks like your input.tif may have lossy compression applied, and the output will have the same compression by default. You might try rio mask --overwrite --crop in.tif out.tif --geojson-mask mask.geojson --co COMPRESS=NONE Sean Gillies
|
|
Black border after running rio mask
Dear Rasterio developers and users,
I' m masking geotiff files with geojson polygons: rio mask --overwrite --crop in.tif out.tif --geojson-mask mask.geojson
|
|
Re: Different values when I use a window
adrianocorbelinoii@...
Hello Sean, Sorry for abandoning the post.
|
|
Re: How sum two raster with different shapes?
Anderson Roberto da Silva
Thank's Amine. I create a function to resample the raster keeping the extents and resolution to calc with other rasters.
|
|
Re: rasterio opens file from AWS S3 bucket on local machine, but can't find file when deployed to Google App Engine
Sean Gillies
Hi Judson, On Fri, Aug 21, 2020 at 9:16 AM Judson Buescher <judson.buescher@...> wrote:
Sean Gillies
|
|
Re: rasterio opens file from AWS S3 bucket on local machine, but can't find file when deployed to Google App Engine
Judson Buescher <judson.buescher@...>
Hi Sean,
From: <main@rasterio.groups.io> on behalf of "Sean Gillies via groups.io" <sean@...>
Hi Judson,
On Wed, Aug 12, 2020 at 9:42 AM Judson Buescher <judson.buescher@...> wrote:
If the source data for your App Engine app is on AWS, you'll need to make sure that you're providing AWS keys to access it. You'll want
AWS_SECRET_ACCESS_KEY = secret_access_key etc.
in your environment, not GS_SECRET_ACCESS_KEY (etc.). I've never used boto3 on App Engine and wouldn't recommend that approach of configuring AWS for GDAL and rasterio.
-- Sean Gillies
|
|
Re: rasterio opens file from AWS S3 bucket on local machine, but can't find file when deployed to Google App Engine
Judson Buescher <judson.buescher@...>
Sean,
From: <main@rasterio.groups.io> on behalf of "Sean Gillies via groups.io" <sean@...>
Hi Judson,
On Wed, Aug 12, 2020 at 9:42 AM Judson Buescher <judson.buescher@...> wrote:
If the source data for your App Engine app is on AWS, you'll need to make sure that you're providing AWS keys to access it. You'll want
AWS_SECRET_ACCESS_KEY = secret_access_key etc.
in your environment, not GS_SECRET_ACCESS_KEY (etc.). I've never used boto3 on App Engine and wouldn't recommend that approach of configuring AWS for GDAL and rasterio.
-- Sean Gillies
|
|
Re: Iterate over elements in Rasterio window and obtain coordinates using transform.xy
Sean Gillies
Hi, On Wed, Aug 19, 2020 at 6:24 PM <whytefish1@...> wrote:
Excellent! I would however like to know if the rasterio.transform.xy method can be used when passing col, row from a dataset window, as I would like to get the coordinate for the center of the cell rather than the ul which results from the affine window transform. Yes. The important detail is that the transform matrix passed to xy() must apply to the window. You can't use the matrix from the dataset's .transform attribute unless your window has its origin at the upper left corner of the dataset. Dataset objects have a window_transform() method that can help compute the new transforms: https://rasterio.readthedocs.io/en/latest/api/rasterio.io.html?highlight=window_transform#rasterio.io.DatasetReader.window_transform. Sean Gillies
|
|
Re: Iterate over elements in Rasterio window and obtain coordinates using transform.xy
Worked it out using a previous thread, doing it using an affine transform on the window.
I would however like to know if the rasterio.transform.xy method can be used when passing col, row from a dataset window, as I would like to get the coordinate for the center of the cell rather than the ul which results from the affine window transform.
|
|
Iterate over elements in Rasterio window and obtain coordinates using transform.xy
whytefish1@...
Does a window generated by rasterio maintain the dataset origin and absolute col/row indices? I'd like to be able to iterate over a window of a dem dataset, find the highest value in the window and return it's lat long coordinates using rasterio.transform.xy or similar. Obviously the below isn't suitable (the arr is invalid), it illustrates what I'm trying to achieve. Window is generated using slices and row/col high and lows which are provided by a valid function called extract_block.
|
|
Re: How sum two raster with different shapes?
Amine Aboufirass <amine.aboufirass@...>
You can't sum rasters with different shapes. Resample your rasters to a common resolution and align them so that they can be read as arrays with the same shape, then add the two arrays together and write to a new raster.
On Tue, 18 Aug 2020, 19:03 , <byander@...> wrote:
|
|
How sum two raster with different shapes?
Anderson Roberto da Silva
Hi, I'm developing a system and I need sum two raster with different shapes. When I trying sum the rasters I get the error: I know that rasterio read raster as numpy array, but If I use the Raster Calculator from QGIS software, I can sum the rasters without problem. I would like sum the rasters without use command line, e.g. Thank's for any help.
|
|
Re: Automate process of creating a mask
Jaime Lopez
Hi, You can also use skimage package, it has a filters module with threshold_otsu. Hope it helps, JL
On Mon, Aug 17, 2020 at 3:47 AM <ts@...> wrote: hi Jaime, --
Jaime Lopez Carvajal
|
|
Re: Automate process of creating a mask
ts@...
hi Jaime,
thanks for your reply. Do you know if there is Otsu segmentation in rasterio? Or should I use f.e. OpenCV?
|
|
Re: Automate process of creating a mask
Jaime Lopez
Hi, It seems to me that you can apply Otsu segmentation first to every image, to detect the threshold. Then you can use the threshold as a mask's parameter. Sorry, if I could misunderstood the point. JL
On Sat, Aug 15, 2020 at 8:53 AM <ts@...> wrote: Dear Rasterios, --
Jaime Lopez Carvajal
|
|