Image Pyramid data model for Geoanalytics
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


ga_pyramid - Geoanalytics Image Pyramid

The Image Pyramid is a data model within Geoanalytics to hold tiled pyramidal datasets. Like the DataCube on which it is based, Pyramids can contain images at multiple times and elevations, and WMS queries support these.

The Image Pyramid is distributed as a reusable Django app. Installation is as simple as running:

$ pip install mongoengine pymongo gdal # install dependencies
$ git clone git://
$ cd ga_ows
$ python install
$ cd ..
$ cd ga_pyramid
$ python install

And then adding ga_ows and ga_pyramid to your list of INSTALLED_APPS in You will also need to add ga_pyramid.urls to your base file.

External Dependencies

ga_pyramid requires MongoDB to work properly. MongoDB and MongoEngine should be setup via the Django settings. If you are unfamiliar with how to do this, consult .

Loading a Pyramid

Loading a pyramid is a simple command. To load a pyramid, navigate to a directory containing a collection of georeferenced images and type:

$ python $VIRTUAL_ENV/ga/ load_pyramid [options] mypyramid_name *.tif

Where options are any of:

                      Verbosity level; 0=minimal output, 1=normal output,
                      2=all output
--settings=SETTINGS   The Python path to a settings module, e.g.
                      "myproject.settings.main". If this isn't provided, the
                      DJANGO_SETTINGS_MODULE environment variable will be
                      A directory to add to the Python path, e.g.
--traceback           Print traceback on exception
--drop                drop the old pyramid before loading a new one.
--levels=LEVELS       the number of levels of pyramid to calculate - the
                      default is 7
--srs=SRS             the spatial reference system that the tiles are in
                      (default is EPSG:900913, the Google Mercator
                      | CCITTFAX4 | NONE
--format=FORMAT       GTiff | PNG | JPEG
--quality=QUALITY     JPEG encoding quality
                      Interpolation : bilinear | near | cubic | cubicspline
                      | lanczos
                      Set to YCBCR if using JPEG TIFF compression : MINISBLA
                      driver specific creation options for GDAL
--size=SIZE           number of pixels per row/column
--time=TIME           [YYYY-MM-DD-hh:mm:ss] The UTC time value for this
                      pyramid, if there is one
                      The elevation value for this pyramid if there is one
--append              Append to the current pyramid (useful for adding times
                      or elevations
--version             show program's version number and exit
-h, --help            show this help message and exit

Be sure when loading a pyramid that MongoDB is up and running. GDAL formats for GeoTiff, PNG, and JPEG are supported. GeoTIFF is the default format. If you use JPEG or PNG, you will have to pass your own creation options via --create_options. These options will be passed to GDAL via The future path for this software is to make the use of optional, as it does no parallel processing at all, and we want to support parallel retiling.

Note --srs does NOT transform tiles. It is simply there as an option if your tileset doesn't have a PRJ file and is not a collection of GeoTIFFs.

Size is by default 1024. This generally need not be changed.

Accessing loaded pyramids via WMS

Once you have a loaded pyramid, you can access it via WMS with the layers parameter being set to the layer name: