Opened 7 years ago

Closed 6 years ago

#2163 closed patch (fixed)

[raster] Add st_tpi

Reported by: nclay Owned by: Bborie Park
Priority: medium Milestone: PostGIS 2.1.0
Component: raster Version: trunk
Keywords: history Cc:

Description

Add the ability to calculate the Topographic Position Index for a DEM raster.

Attachments (5)

st_tpi.sql (3.6 KB) - added by nclay 7 years ago.
st_tpi
Wilson-MarGeo-2007.pdf (1.4 MB) - added by nclay 7 years ago.
Definition of TPI via BPI pg 10
st_tpi.xml (1.8 KB) - added by nclay 6 years ago.
rt_st_tpi.sql (1.8 KB) - added by nclay 6 years ago.
rt_st_tpi_expected (677 bytes) - added by nclay 6 years ago.

Download all attachments as: .zip

Change History (17)

Changed 7 years ago by nclay

Attachment: st_tpi.sql added

st_tpi

comment:1 Changed 7 years ago by nclay

Version: 2.0.xtrunk

comment:2 Changed 7 years ago by Bborie Park

Summary: Add st_tpi[raster] Add st_tpi

Can I get some reference material describing TPI and TRI? That way appropriate regression tests can be created. I can't really consider committing this without a good understanding of the operations and verifying that the code is doing what it is saying it is doing.

Changed 7 years ago by nclay

Attachment: Wilson-MarGeo-2007.pdf added

Definition of TPI via BPI pg 10

comment:3 Changed 6 years ago by Bborie Park

Milestone: PostGIS 2.1.0PostGIS Future

No regression tests or docs... punting to the future. Should also add roughness...

comment:4 Changed 6 years ago by nclay

Added docs, is there anything other than regression test that I need to do?

Thanks,

Nathan

comment:5 Changed 6 years ago by robe

Milestone: PostGIS FuturePostGIS 2.1.0
Type: enhancementpatch

nclay -- roughness?(though guess that can wait if it's a feature) Also the id of your function in doc has to be <refentry id="RT_ST_TPI"> to agree with other documented raster functions.

I'm willing to accept this for 2.1 (since it was originally slated for 2.1) if you can get the regress in by next week and dustymugs is fine with it.

dustymugs -- what d'ya think?

comment:6 Changed 6 years ago by Bborie Park

Assuming regression tests are done and code review, I'm fine with 2.1. roughness would be a separate function and the last one needed to complete the "basic" set of DEM processing functions.

Changed 6 years ago by nclay

Attachment: st_tpi.xml added

comment:7 Changed 6 years ago by nclay

Regression tests, how should or should I, I add rasters to the testing environment? What rasters am I to expect to be available, for my regression scripts? I know that these are basic questions but I want to get things right and up to snuff.

Thanks,

Nathan

comment:8 Changed 6 years ago by Bborie Park

Generally, you want to create a raster within the database using ST_MakeEmptyRaster(), ST_AddBand() and ST_SetValues(). That way, everything is portable regardless of filesystem.

comment:9 Changed 6 years ago by nclay

Just to be clear, I should build up and tear down any needed raster within the regression script.

comment:10 Changed 6 years ago by Bborie Park

Yes. You may want to consider regression tests that focus only upon the callback function. Take a look at rt_4ma.sql and rt_invdistweight4ma.sql in raster/test/regress. The idea is to test just the code that needs testing rather than the whole map algebra framework, which is tested elsewhere. This way any failures can only originate in the callback function.

Changed 6 years ago by nclay

Attachment: rt_st_tpi.sql added

Changed 6 years ago by nclay

Attachment: rt_st_tpi_expected added

comment:11 Changed 6 years ago by nclay

I've added the regression tests.

comment:12 Changed 6 years ago by Bborie Park

Keywords: history added
Resolution: fixed
Status: newclosed

Added in r11378

Note: See TracTickets for help on using tickets.