Skip to main content

A general purpose AIS I/O library using the GPSd AIVDM schema.

Project description

https://codeship.com/projects/234cd8a0-0199-0133-5687-5ab5ab3bbe8f/status?branch=master

Figure out which files to touch when working with spatiotemporal data.

Overview

We have a lot of data that needs to be chunked by primary key, datetime, and space but we don’t want to sort through all of it whenever we just want to look at a small piece. The solution is a sidecar metadata file and a file structure organized as a spatial quadtree that is interacted with via a simple and lightweight NoSQL engine that is aware of these components.

Data is grouped in directories matching quadtree nodes in files that are grouped time and primary key. Managing the actual files is up to the user. This library only knows how to interact with the sidecar files.

We want to have both an API:

import melvil
import datetime

# The base directory, match expression, etc. are all defined in a configfile

# Only process data from the past 30 days that appears in the lower left
# quadrant of the world, as specified by WGS84
max_ts = datetime.datetime.now()q
min_ts = max_ts - datetime.timedelta(days=30)
bbox = (-180, -90 0, 0)

for fp in melvil.search(min_ts=min_ts, max_ts=max_ts, bbox=bbox):
    with open(fp) as f:
        # Do something

And a CLI:

$ melvil search --min-ts 2014-01-01 --max-ts 2015-01-01 --bbox -180 -90 0 0
/path/to/output/file/1
/path/to/output/file/2
/path/to/output/file/3
...

Under the hood melvil is looking for

Developing

$ git clone https://github.com/SkyTruth/Dewey
$ cd Dewey
$ virtualenv venv
$ pip install -e .[test]
$ py.test tests --cov melvil --term-missing melvil

License

See LICENSE.txt.

Project details


Release history Release notifications | RSS feed

This version

0.1

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