Giter VIP home page Giter VIP logo

sat-algo-ndvi's Introduction

NDVI Detection

The task is to determine NDVI values, reproject, scale, and output a geotiff based on another 8-band geotiff.

For more information, please refer to this explanation on wikipedia.

Prerequisite

To run the script, libraries are required.

  • GDAL
  • rasterio
  • numpy

These can be installed in a new virtual env or found in a pre-existing docker image Development Seed offers.

How to

The script can be ran from the command line or included in a project as an import.

Command line

The python script can be ran from the command line. Two arguments are required, an input and output file path, name.

python detect.py input.tif output.tif

Optional arguments include --crs and --range.

Including --crs tells the app to reproject the output to the given projection.

Including --range tells the app to clamp the output NDVI values to the given range.

Example

From README directory

python ndvidetect/detect.py sample/sample.tif output/output.tif --crs EPSG:4326 --range_min 0.2 --range_max 0.5

The geotif included (output/output.tif) was generated by the above command.

Importing

Once the repo is built/installed with python's setup tools (python install .), you can access key functions to calculate NDVI values of a geotiff.

from ndvidetect import evaluate_band_vegetation, evaluate_geotiff_vegetation

Once imported, these two functions can be used to determine NDVI values.

Example Usage

from ndvidetect import evaluate_geotiff_vegetation
    
if __name__ == "__main__":
    fn_in = 'sample.tif'
    fn_out = 'output.tif'
    evaluate_geotiff_vegetation(fn_in, fn_out, crs='EPSG:4326', range=[0.3, 0.6])

Further documentation is included on the functions.

sat-algo-ndvi's People

Contributors

f3rullo14 avatar

Watchers

 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.