Skip to content

Ruby on Rails web-application that leverages libvips image processing library to apply VARI, NDVI and others Vegetation Indices (VIs) on map tiles.

Notifications You must be signed in to change notification settings

dirceu-jr/tiled-vegetation-indices

Repository files navigation

Tiled Vegetation Indices

Ruby on Rails web-application that leverages libvips image processing library and Leaflet interactive maps library to apply Vegetation Indices (VIs) on map tiles.

The approach was taken after analyzing how DroneDeploy works with VIs.

It is being published as open source to demonstrate how WebODM contributors can apply VIs on-the-fly on map tiles. This approach avoids the need to store different tiles for each VI.

Approach

It is generated a thumbnail of the full orthophoto. Then it is applied each one of the implemented indices on the thumbnail and is saved a histogram of each index result.

The histogram is then used to calculate a min and max used to "clip" results bellow/above min/max on individual tiles.

Implemented Indices

RGB based:

  • VARI
  • GLI
  • IOR
  • NGRI

NIR based:

  • NDVI
  • BAI
  • SAVI
  • MNLI
  • MSR
  • RDVI
  • TDVI
  • OSAVI
  • LAI

Screen Capture

RGB based VARI

alt text

NIR based NDVI

alt text

Where to look

app/lib/vegetation_index.rb

app/controllers/vegetation_index_controller.rb

app/assets/javascripts/map.js

Wait, what?

Please follow through this file: app/lib/vegetation_index.rb and below explanation →

The method generate_orthophoto_statistics does generate a reduced dimension version of the full orthophoto because it is more efficient computationally to proceed with it reduced. It then calls run_and_store_indices_statistics that will call index_statistics for each Vegetation Index that we want to use.

index_statistics does apply a specified Vegetation Index to the reduced orthophoto and returns it's "min" and "max" values along with their "histogram with 256 bins".

Now you can call apply_index for each tile generated from the full dimension orthophoto sending the "min"/"max" calculated by index_statistics. Or even better, you can use findClippedMinMax() JavaScript method to increase the contrast by ignoring "the first and last 3% histogram values" and calculating a better "min"/"max" (clipped_min/clipped_max) to use in apply_index.

JavaScript Libraries Used

Requeriments

About

Ruby on Rails web-application that leverages libvips image processing library to apply VARI, NDVI and others Vegetation Indices (VIs) on map tiles.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published