hgrib-0.2.0.0: Unofficial bindings for GRIB API

Copyright(c) Mattias Jakobsson 2015
LicenseGPL-3
Maintainermjakob422@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Data.Grib.Raw.Iterator

Contents

Description

Iterate on latitude, longitude, values.

Most of the documentation herein was copied from the official documentation of grib_api.

Synopsis

The GRIB Iterator

newtype GribIterator Source

Grib iterator, structure supporting a geographic iteration of values on a grib message.

Constructors

GribIterator (Ptr GribIterator) 

gribIteratorNew Source

Arguments

:: GribHandle

the handle from which the iterator will be created

-> Int

flags for future use (ignored)

-> IO GribIterator

an IO action that will return the new iterator

Create a new iterator from a handle, using current geometry and values.

The returned iterator needs to be manually deleted with gribIteratorDelete. However, due to the reason given in that function, withGribIterator should be preferred over this function.

gribIteratorNext :: GribIterator -> IO (Bool, Double, Double, Double) Source

Get the next value from an iterator.

This function returns a tuple (status, latitude, longitude, value), where status is True if successful and False if no more data is available.

gribIteratorPrevious :: GribIterator -> IO (Bool, Double, Double, Double) Source

Like gribIteratorNext, but return the previous value instead.

gribIteratorHasNext :: GribIterator -> IO Bool Source

Test procedure for values in an iterator.

gribIteratorReset :: GribIterator -> IO () Source

Reset the iterator.

gribIteratorDelete :: GribIterator -> IO () Source

Frees an iterator from memory.

If the GribHandle used to create the iterator has been garbage collected by the time this function is called, the behavior is undefined. Because of this, withGribIterator should be preferred over directly using gribIteratorNew and this function.

withGribIterator Source

Arguments

:: GribHandle

the handle from which the iterator will be created

-> Int

flags for future use (ignored)

-> (GribIterator -> IO a)

a function that will be called with the newly created iterator

-> IO a

the result of the above function

Safely create, use and delete a GribIterator.

This function should be preferred over directly using gribIteratorNew and gribIteratorDelete.