Clean and fast and geospatial raster I/O for Python programmers who use Numpy
Questions tagged [rasterio]
440 questions
0
votes
1 answer
Python 2.7 - CV2, Rasterio gets an error numpy.ndarray object is not callable
I'm trying to mask an image with a shape from a geojson.
First thing I do is get the pixels that represent my lat,long coordinates in the image.
When I have that information I build a 'Polygon' with that coordinates and then I try to crop the image,…

WikiOverflow
- 75
- 3
- 13
0
votes
1 answer
Installation of GDAL with Conda on Windows
I have Anaconda Python 3.6 on Windows 7. I frequently use GeoPandas and it worked fine. Yesterday I tried to install rasterio and georasters, and they seemed to install fine using the suggested method
conda config --add channels conda-forge
conda…

jberrio
- 972
- 2
- 9
- 20
0
votes
1 answer
Rasterize Geometry Example not working
I am trying to recreate this rasterio example:
import numpy as np
import rasterio
from rasterio.features import rasterize
from rasterio.transform import IDENTITY
rows = cols = 10
geometry = {
'type': 'Polygon',
'coordinates': [[(2, 2),…

John Moutafis
- 22,254
- 11
- 68
- 112
0
votes
1 answer
Dependencies tracking on python application
I am trying to make a portable application from a python app I developped on Windows 7 - 32 bits using python3.4. My first idea was to use py2exe combined with a ThinApp equivalent, but as I use rasterio which is not a pure python library, py2exe…

L. Chaumartin
- 54
- 9
0
votes
0 answers
Rasterio/GDAL read and write modified data
I'm having an issue where I'm trying to read and write from the same data set. As data gets modified there are situations where that data needs to be read and modified again, immediately. The python code looks pretty straight forward, but it seems…

four43
- 1,675
- 2
- 20
- 33
0
votes
1 answer
Planet NDVI calculation: ModuleNotFoundError: No module named 'rasterio'
I'm performing NDVI calculation on a Planet Scope 4 band image as per Planet's documentation
The following block of code is what I wrote:
Extract band data from original image in working directory
import rasterio import numpy
image_file =…

Sergio Escalante
- 219
- 1
- 2
- 6
0
votes
1 answer
How to put a comma separated value to a numpy cell
I have the georeferenced image with coordinates values like (475224.0, 4186282.0).The dimension of my image is (647, 2180). ie there are 647 columns and 2180 rows. I would like to take the coordinate values into a numpy array with size (647, 2180),…

bibinwilson
- 348
- 2
- 6
- 20
0
votes
1 answer
Plotting with rasterio
I'm following the example at https://mapbox.github.io/rasterio/topics/plotting.html
And am using this geotiff file http://download.osgeo.org/geotiff/samples/spot/chicago/SP27GTIF.TIF
Here is my code:
import rasterio
from matplotlib import…

J-Win
- 1,322
- 16
- 35
0
votes
1 answer
Storing output of URL directly into numpy raster
Is there a way to store the output of a url that returns a geotiff (or tiff file) directly into a numpy array or rasterio variable using the python requests library (or any other python library)? I can use python requests for a json like…

user308827
- 21,227
- 87
- 254
- 417
0
votes
1 answer
what is the return value of numpy mean()?
I found this problem when calculating array from rasters:
with rasterio.open(file) as ds:
arr3d=ds.read()
arr3d=np.ma.masked_where(arr3d==-32768,arr3d,False)
list=[]
for i in range(0,24):
tmean=arr3d[i,:,:].mean()
…

Cobin
- 888
- 13
- 25
-1
votes
1 answer
Reproject geo data and save to NetCDF4
I need to reproject geodetic point data from Gauß-Krüger coord system with discrete data values into a UTM coord system and finally write that data into a netCDF raster file. I was recommended to use python to do this. I tried with PyProj4 which…

Tobias
- 33
- 5
-1
votes
1 answer
Why all the data is Nan when I load NDVI image by rasterio or gdal
I calculated NDVI value and saved single band images following this page; https://developers.planet.com/docs/planetschool/calculate-an-ndvi-in-python/. After that I wanted to load those images on python by rasterio or gdal, loading images were…

Mashiro
- 1
- 1
-1
votes
1 answer
Getting basic stats from Np.array within a for loop in python
I don't have a lot of python experience and I'm trying something rather complicated for me, so excuse my messy code. I have a few arrays that were generated with rasterio from raster layers (tif), and ultimately I want to get some basic statistics…

Naama
- 39
- 4
-1
votes
1 answer
how to handle every (polygon) item in a shapefile as single geometry?
import of packages:
from rasterio.mask import mask
import geopandas as gpd
opened a shapefile:
gdf = gpd.read_file(shpfilepath+clipshape)
and opened a rasterfile:
img =…

Allian Python
- 1
- 1
-1
votes
1 answer
Clipping geodataframe points by raster extent in Python
Background
Thanks to the kind souls who answered my previous question here: Faster methods to create geodataframe from a Dask or Pandas dataframe, I have successfully imported my massive block model as a geodataframe. This was done with the…

William Taylor
- 35
- 6