Skip to main content

Tools for working with Geographical Information System Rasters

Project description

BuildStatus CoverageStatus PyPiVersion PyPiDownloads

The GeoRasters package is a python module that provides a fast and flexible tool to work with GIS raster files. It provides the GeoRaster class, which makes working with rasters quite transparent and easy. In a way it tries to do for rasters what GeoPandas does for geometries.

It includes tools to

  • Merge rasters
  • Plot rasters
  • Extract information from rasters
  • Given a point (lat,lon) find its location in a raster
  • Aggregate rasters to lower resolutions
  • Align two rasters of different sizes to common area and size
  • Get all the geographical information of raster
  • Create GeoTiff files easily
  • Load GeoTiff files as masked numpy rasters


pip install git+git://
pip install georasters

Example Usage: GeoRasters

import georasters as gr

# Load data
raster = './data/slope.tif'
data = gr.from_file(raster)

# Plot data

# Get some stats

Example Usage: Other functions

import georasters as gr

# Get info on raster
NDV, xsize, ysize, GeoT, Projection, DataType = gr.get_geo_info(raster)

# Load raster
data = load_tiff(raster)

# Find location of point (x,y) on raster, e.g. to extract info at that location
col, row = gr.map_pixel(x,y,GeoT[1],GeoT[-1], GeoT[0],GeoT[3])
value = data[row,col]

# Agregate raster by summing over cells in order to increase pixel size by e.g. 10

# Align two rasters
data2 = load_tiff(raster2)
(alignedraster_o, alignedraster_a, GeoT_a) = gr.align_rasters(raster, raster2, how=np.mean)

# Create GeoRaster
A=gr.GeoRaster(data, GeoT, nodata_value=NDV)

# Load another raster
NDV, xsize, ysize, GeoT, Projection, DataType = gr.get_geo_info(raster2)
data = load_tiff(raster2)
B=gr.GeoRaster(data2, GeoT, nodata_value=NDV)

# Plot Raster

# Merge both rasters and plot


Find a bug? Report it via github issues by providing

  • a link to download the smallest possible raster and vector dataset necessary to reproduce the error
  • python code or command to reproduce the error
  • information on your environment: versions of python, gdal and numpy and system memory

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
georasters-0.1.1.tar.gz (21.9 kB) Copy SHA256 hash SHA256 Source None Dec 4, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page