EarthPy is a python package that makes it easier to plot and work with spatial raster and vector data using open source tools. Earthpy depends upon geopandas which has a focus on vector data and rasterio with facilitates input and output of raster data files. It also requires matplotlib for plotting operations.
Questions tagged [earthpy]
12 questions
13
votes
3 answers
Plot data on satellite maps
How to plot (lat, lon, value) data on a map using satellite background images at high resolution in python (notebooks)?
I was crawling the whole internet but could not find anything useful. Folium does not provide satellite tiles. SimpleKML and…

Martin
- 1,395
- 1
- 11
- 33
3
votes
1 answer
How to place a shapefile on top of raster file in one plot, and then save the plot in a Jpeg file format
I am posting this question after three days searching the net but no success. Hope can get the answer here. Please do NOT delete the post as I did not find an answer for it here also. Thanks.
I have 2 files:
A raster image file (i.e., Air…

Canada2015
- 187
- 1
- 12
3
votes
2 answers
Add projection imported .asc file
I'm trying to import an .asc file in python to clip it with a shapefile. For the clipping I'll use:
import earthpy.clip as cl
clip = cl.clip_shp(shp_file, asc_file)
However this won't work since my .asc doesn't have a CRS. This is how the header of…

Dylan_w
- 472
- 5
- 19
3
votes
2 answers
use time series data in python to calculate mean, variance std deviation
I have data collected from sensors that looks like:
sec nanosec value
1001 1 0.2
1001 2 0.2
1001 3 0.2
1002 1 0.1
1002 2 0.2
1002 3 0.1
1003 1 0.2
1003 2 0.2
1003 …

AMisra
- 1,869
- 2
- 25
- 45
2
votes
1 answer
Sentinel-2 data: plotting RGB Composite Image using Python3
I am using Sentinel-2 data for Satellite Image Analysis. The code can be viewed here.
The problem is while plotting the RGB composite image. "To plot RGB composite images, you will plot the red, green and blue bands, which are bands 4, 3 and 2,…

Arun
- 2,222
- 7
- 43
- 78
2
votes
5 answers
Regridding regular netcdf data
I have a netcdf file containing global sea-surface temperatures. Using matplotlib and Basemap, I've managed to make a map of this data, with the following code:
from netCDF4 import Dataset
import numpy as np
import matplotlib.pyplot as plt
from…

NickF
- 169
- 1
- 3
- 13
1
vote
1 answer
Exporting multiband Earthpy masked GeoTIFF with Rasterio resulted in original non-masked file
I currently wanted to mask a stacked Landsat 8 GeoTIFF file with the Pixel QA band to remove the clouds and cloud shadows. So far, I have successfully followed the tutorial here, and have properly plotted the masked scene using a combination of…
1
vote
1 answer
Detecting custom events in time series data in Python
I'm looking for a neat way to detect particular events in time series data.
In my case, an event might consist of a value changing by more than a certain amount from one sample to the next, or it might consist of a sample being (for example) greater…

Jon Mills
- 1,855
- 4
- 19
- 28
0
votes
1 answer
How to show negative values in an NDVI image?
I am fairly new to python. I am working with some Landsat 8 .tiff images to produce an NDVI image. When I produce the image, the river does not show as a negative value. NDVI goes from -1 to 1, but the lowest it goes to is 0 in this image. This is a…

techsense
- 15
- 4
0
votes
1 answer
GeoTIFF raster mirrored on Python basemap
I am trying to plot a .tif raster on my map with basemap. With QGIS I see the raster layer as it is supposed to be:
QGIS image
However, when then plotting with python basemap the colours are off, and the projection is somehow both rotated 180…

ElsRi
- 37
- 1
- 5
0
votes
1 answer
Visualising geospatial .tiff images with Rasterio
I am trying to visualise a .tiff image in Jupiter Notebook using Rasterio. I am a Junior Data Scientist for an AgriTech company and we just got access to 8 data layers (NDVI etc.) for two farms in .tiff format.
Here is the metadata for one…

Thabied Majal
- 27
- 1
- 5
0
votes
1 answer
How to use cython compiler in python
in this link: http://earthpy.org/speed.html I found the following
%%cython
import numpy as np
def useless_cython(year):
# define types of variables
cdef int i, j, n
cdef double a_cum
from netCDF4 import Dataset
f =…

macnair
- 13
- 5