GithubHelp home page GithubHelp logo

geotiff's Introduction

A GeoTIFF reader Library for Rust

Version

This has been forked from https://github.com/georust/geotiff

I have added in the ability to read and access geotiff specific information, read tiled tiff images and generally cleaned up the code and hopefully made it easier to extend. I have moved to using the GDAL bindings now but may update this in the future as a full featured geotiff library would be useful to have in rust.

Original README

I needed this library to import elevation models for a routing library. As elevation models usually come in GeoTIFF format, but no such library was available for Rust, I created this library, taking other libraries as inspiration:

The purpose of this library is to simply read GeoTIFFs, nothing else. It should work for other TIFFs as well, I guess, but TIFFs come in many flavors, and it's not intended to cover them all.

In its current state, it works for very basic GeoTIFFs, which sufficed to extract elevation data for use in the routing library. In case you want to extend the library or have suggestions for improvement, feel free to contact me, open an issue ticket or send a pull request.

You might also consider the GDAL bindings for Rust. Depending on your usecase, it might be easier to use.

Library Usage

The library exposes a TIFF struct that can be used to open GeoTIFFs and interact with them. Its use is simple:

TIFF::open("geotiff.tif");

TIFF::open(...) returns an Option, depending if the open operation was successful or not. Individual values can then be read (for the moment, only at pixels) using:

x.get_value_at(longitude, latitude);

Where longitude corresponds to the image_length and latitude to the image_width. This might be a bit counter intuitive, but seems consistent with GDAL (have to look into this).

Caution: the longitude and latitude are only in pixels, no coordinate transformations are applied!

Development and Testing

Simply run the tests using:

cargo test

TIFF Basics

Several documents describe the structure of a (Geo)TIFF:

geotiff's People

Contributors

dominikbucher avatar frewsxcv avatar isaac-leonard-uni avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.