Skip to content

Commit

Permalink
version 0.1
Browse files Browse the repository at this point in the history
GeoRasters
  • Loading branch information
ozak committed Dec 2, 2014
0 parents commit 159961e
Show file tree
Hide file tree
Showing 7 changed files with 1,118 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
@@ -0,0 +1,11 @@
# Compiled python modules.
*.pyc

# Setuptools distribution folder.
/dist/

# Setuptools build folder.
/build/

# Python egg metadata, regenerated from source files by setuptools.
/*.egg-info
674 changes: 674 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions MANIFEST.in
@@ -0,0 +1,2 @@
include LICENSE.txt README.rst
exclude MANIFEST.in
43 changes: 43 additions & 0 deletions README.rst
@@ -0,0 +1,43 @@
GeoRaters
===========

The ``Georasters`` is a python module that provides a fast and flexible
tool to work with GIS raster files. It includes tools to

- 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

Install
-------

.. code-block:: python
pip install gisrastertools
Example Usage
-------------

.. code-block:: python
from gisrastertools import *
# Get info on raster
NDV, xsize, ysize, GeoT, Projection, DataType = 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 = 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
aggregate(data,NDV,(10,10))
# Align two rasters
data2 = load_tiff(raster2)
(alignedraster_o, alignedraster_a, GeoT_a) = align_rasters(raster, raster2, how=np.mean)
5 changes: 5 additions & 0 deletions georasters/__init__.py
@@ -0,0 +1,5 @@
# This file allows all subdirectories in this directroy to loaded by Python
# -*- coding: utf-8 -*-
from .georasters import get_geo_info, map_pixel, aggregate, create_geotiff, align_rasters, load_tiff, union, GeoRaster, RasterGeoError, RasterGeoTError

__all__ = ['get_geo_info','map_pixel','aggregate','create_geotiff','align_rasters','load_tiff', 'union', 'GeoRaster', 'RasterGeoError', 'RasterGeoTError']

0 comments on commit 159961e

Please sign in to comment.