Giter VIP home page Giter VIP logo

leaflet-geotiff's Introduction

leaflet-geotiff

A LeafletJS plugin for displaying geoTIFF raster data. Data can drawn as colored rasters or directon arrows. The layer can be clipped using a polygon.

DEMO

Sample

This plugin uses geotiff.js and plotty.

Instructions

  1. Include the JavaScript file and dependencies:
    <script src="https://npmcdn.com/[email protected]/dist/leaflet.js"></script>
    <script src="vendor/geotiff.js"></script>
    <script src="vendor/plotty.js"></script>
    <script src="leaflet-geotiff.js"></script>
  1. Add a geoTIFF layer L.leafletGeotiff(url,options)
  • url - geoTIFF file url. Currently only EPSG:4326 files are supported.
  • options:
    • displayMin,displayMax - Minimum and maximum values to plot.
    • clampLow, clampHigh - (optional, default = true) If true values outside displayMin to displayMax will be rendered as if they were valid values.
    • bounds - (optional) An array specifying the corners of the data, e.g. [[40.712216, -74.22655], [40.773941, -74.12544]]. If omitted the image bounds will be read from the geoTIFF file.
    • band - (optional, default = 0) geoTIFF band to read.
    • image - (optional, default = 0) geoTIFF image to read.
    • colorScale - (optional, default = "rainbow"). Plotty color scale used to render the image.
    • vector - (optional, default = false) If true the data is interpreted as a direction and rendered as arrows.
    • arrowSize - (optional, default = 20) Size in pixels of direction arrows for vector data.
    • clip - (optional, default = undefined) Clipping polygon, provided as an array of [lat,lon] coordinates. Note that this is the Leaflet [lat,lon] convention, not geoJSON [lon,lat].
  1. Data values can be extracted using the getValueAtLatLng(lat,lng) method.

  2. New color scales can be created using plotty's addColorScale method.

Dependencies

  • leaflet-geotiff works with Leaflet 0.7.7 and >=1.0
  • Requires:

leaflet-geotiff's People

Watchers

James Cloos avatar Mihir Mone 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.