Skip to main content

A bit like PostGIS ST_SummaryStats for files on disk

Project description

A bit like the PostGIS ST_SummaryStats function for rasters on your filesystem. Mostly we’re just stringing together some awesome libraries:

Install

Activate your project virtual environment, and then:

pip install winston

If you just want to use the command-line features, you could:

pip install --user winston

Usage

On the command-line:

winston --help

For example, to get stats for all WKTs in a text file for a given raster:

winston some_file.tif -f wkts.txt

or just for one point, including raster metadata:

winston /path/to/data/*.tif -w 'POINT (-4.483545 54.150744)' -m

Since we require rasterio, you can also use the rio command-line tool to inspect your rasters:

rio insp /path/to/geo.tif

Read more in the Rasterio docs.

You can also use Winston as a module:

>>> import rasterio
>>> from winston.stats import summary
>>> src = rasterio.open('/path/to/raster.tif')
>>> print summary(src)
[37324800.0, 37324800.0, 281865888.0, 7.552, 3.45, 0.0, 10.0]
>>> print summary(src, bounds=(4, 6))
[37324800.0, 1772928.0, 9023566.0, 5.09, 0.573, 4.122, 5.929]
>>> print summary(src, bounds=(4, 6), mean_only=True)
5.09

History


0.1.0 (2016-10-12)


  • First release on PyPI.

Project details


Download files

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

Source Distribution

winston-0.1.0.tar.gz (6.6 kB view hashes)

Uploaded Source

Built Distribution

winston-0.1.0-py2.py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page