Home - General / All posts - Topographic Placement Index
 Pierre57 post(s) #02-Oct-19 14:25 HiI'm new to Manifold 9. I'm trying to calculate Topographic Placement Index for a DEM. I could not find anything concrete to show how to do this.TPI values above zero show locations that are higher than the average of the local window (neighbor radius) e.g. ridges. In contrast, negative TPI values represent locations that are lower e.g. valleys. Lastly, TPI values near zero represent areas of constant slope. I see that the average transform allows for setting the radius of neighbors. Can one thus somehow incorporate a subtraction of the cell value from this average neighbor value to directly calculate the TPI value?Thanks
 Dimitri5,752 post(s) #02-Oct-19 14:42 Very close I think would be plan curvature. See the entry for that in the Transform: Images topic. See also the discussion and links in the curvature example topic. Edited... Nope.. the above is wrong (not thinking straight...sorry!). You could probably calculate TPI precisely. I'll ask around.
 adamw8,878 post(s) #02-Oct-19 14:54 Yes.Open the source image. Go to the Transform pane. Select the Average transform (if you don't see it, that's probably because the image contains multiple channels - separate the channel you want to operate on into an image of its own). Set up the parameters of the Average transform.Press Edit Query. This will open the command window with the query that will do the transform. Locate the line that does the average and alter it to do original data - average. In my test, the original line was:--SQL9...INSERT INTO [... Average] (  [mfd_id], [X], [Y],  [Tile]) SELECT  [mfd_id], [X], [Y],  CASTV ((TileRemoveBorder(TileFilter(    TileCutBorder([...], VectorMakeX2([X], [Y]), 3), 3,    TileFilterDefSquare(3, 1)), 3)) AS FLOAT64)-- all of the above on a single lineFROM [...]......and I altered it (altered the bolded) to:--SQL9... [Tile] - CASTV ((TileRemoveBorder(TileFilter(    TileCutBorder([...], VectorMakeX2([X], [Y]), 3), 3,    TileFilterDefSquare(3, 1)), 3)) AS FLOAT64)...Press Run. This will create a new image with the TPI. You would probably like to adjust the names of created components to reflect that.
 Pierre57 post(s) #02-Oct-19 15:21 Thanks. Seems to give the correct results.
 oeaulong237 post(s) #02-Oct-19 15:45 Very Nice, Adam. Ran this on a lidar county wide dataset sitting around. Instructive on manipulating default transform queries.
 Dimitri5,752 post(s) #03-Oct-19 17:48 Adamw's example now appears in a new SQL Example: Create Topographic Position Index (TPI) Displays topic in help that shows how to do TPIs and provides an example of TPI use to enhance a terrain elevation map.