Giter VIP home page Giter VIP logo

postgis_customtpi's Introduction

Postgis custom TPI

This is a generic implementation of TPI based on the current PostGIS TPI implementation, with the extra ability of allowing a custom focal inner and outter mean radius (different from one). This implementation of TPI was based on the current implementation of TPI by PostGIS (https://postgis.net/docs/RT_ST_TPI.html) and the folowing document http://www.jennessent.com/downloads/tpi-poster-tnc_18x22.pdf

Usage:

In order to create the new TPI functions in your database, execute the folowing queries:

  1. _st_tpicustom4ma.sql
  2. st_tpicustom.sql

After that you should have _st_tpicustom4ma and st_tpicustom functions in your database.

_st_tpicustom4ma is the callback function used by map algebra. The main function is:

st_tpicustom(raster rast, integer nband, raster customextent, text pixeltype="32BF", integer inner radius in pixels, integer outter radius in pixels, boolean interpolate_nodata=FALSE)

This is an example with a inner annnulus of 5 pixels and outter annulus of 10 pixels:

select st_tpicustom(r.rast,5,10) as rast
from srtm as r,parcels as foo
where foo.id=111 and ST_Intersects(foo.geometry,rast)

This query will generate a tpi 300 meters if the input is a SRTM of 30 meters of pixel size.

postgis_customtpi's People

Contributors

lcalisto 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.