View Source GeoTIFF (GeoTIFF v0.1.0)

This library reads specially formatted TIFF files that contain metadata abot the geographics transformation. This implimentation is specific to TIFF files sourced from NOAA charts.

Lambert Conformal Conic to Geographic Transformation Formulae

See https://www.linz.govt.nz/data/geodetic-system/coordinate-conversion/projection-conversions/lambert-conformal-conic-geographic

Link to this section Summary

Functions

Given geotiff struct, convert the coordinate to a pixel offset

Parse the tiff headers for Geo TIFF related tags, then generate and calculte the parameters required to transform pixels to coordinates and vise versa.

Given geotiff struct, convert a pixel offset to world coordinates

Link to this section Functions

Link to this function

coord_to_pixel(g, coord)

View Source

Given geotiff struct, convert the coordinate to a pixel offset

Examples

iex> GeoTIFF.coord_to_pixel(GeoTIFF.parse_geotiff_file("res/Sample.tiff"), {-95, 39})
{5212, 5934}
Link to this function

parse_geotiff_file(filename)

View Source

Parse the tiff headers for Geo TIFF related tags, then generate and calculte the parameters required to transform pixels to coordinates and vise versa.

Examples

iex> GeoTIFF.parse_geotiff_file("res/Sample.tiff").easting |> Float.round(9)
110334.526523672
Link to this function

pixel_to_coord(g, pixel)

View Source

Given geotiff struct, convert a pixel offset to world coordinates

Examples

iex> GeoTIFF.pixel_to_coord(GeoTIFF.parse_geotiff_file("res/Sample.tiff"), {5212, 5934}) |> Tuple.to_list |> Enum.at(1) |> Float.round(5)
38.99943