Opened 11 years ago

Closed 11 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: master
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 11 years ago.
st_tpi
Wilson-MarGeo-2007.pdf (1.4 MB ) - added by nclay 11 years ago.
Definition of TPI via BPI pg 10
st_tpi.xml (1.8 KB ) - added by nclay 11 years ago.
rt_st_tpi.sql (1.8 KB ) - added by nclay 11 years ago.
rt_st_tpi_expected (677 bytes ) - added by nclay 11 years ago.

Download all attachments as: .zip

Change History (17)

by nclay, 11 years ago

Attachment: st_tpi.sql added

st_tpi

comment:1 by nclay, 11 years ago

Version: 2.0.xtrunk

comment:2 by Bborie Park, 11 years ago

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.

by nclay, 11 years ago

Attachment: Wilson-MarGeo-2007.pdf added

Definition of TPI via BPI pg 10

comment:3 by Bborie Park, 11 years ago

Milestone: PostGIS 2.1.0PostGIS Future

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

comment:4 by nclay, 11 years ago

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

Thanks,

Nathan

comment:5 by robe, 11 years ago

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 by Bborie Park, 11 years ago

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.

by nclay, 11 years ago

Attachment: st_tpi.xml added

comment:7 by nclay, 11 years ago

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 by Bborie Park, 11 years ago

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 by nclay, 11 years ago

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

comment:10 by Bborie Park, 11 years ago

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.

by nclay, 11 years ago

Attachment: rt_st_tpi.sql added

by nclay, 11 years ago

Attachment: rt_st_tpi_expected added

comment:11 by nclay, 11 years ago

I've added the regression tests.

comment:12 by Bborie Park, 11 years ago

Keywords: history added
Resolution: fixed
Status: newclosed

Added in r11378

Note: See TracTickets for help on using tickets.