TopoToolbox

The Big Tujunga stream network
The Big Tujunga stream network

What is TopoToolbox?

TopoToolbox provides a set of Matlab functions that support the analysis of relief and flow pathways in digital elevation models. The major aim of TopoToolbox is to offer helpful analytical GIS utilities in a non-GIS environment in order to support the simultaneous application of GIS-specific and other quantitative methods.

Who should use TopoToolbox?

TopoToolbox is not a click & go software. You should be familiar with Matlab and its programming syntax. If you feel well versed in Matlab, you will like TopoToolbox for its versatility, functionality and ability to be customized.

Where can I find a documentation?

Until now there is no full documentation of TopoToolbox. Yet, you’ll find a help section in (nearly) each function including syntax, input and output arguments, and an example. This blog is intended as an additional resource of more comprehensive examples. In addition, you might want to take a look at two papers about TopoToolbox published in Environmental Modelling and Software and Earth Surface Dynamics.

Where can I report bugs or suggestions for enhancement?

You found a bug? Sorry for the inconvenience. Please tell me more about it here. The same holds for enhancement requests. I cannot guarantee that I’ll have the time to deliver, but I’ll do my best to keep TopoToolbox up-to-date.

How can I stay informed about updates?

There is no mailing list. All news about TopoToolbox will be posted in this blog. Just set up a RSS-feed.

 


20 thoughts on “TopoToolbox

    Jean-Marie AUGUSTIN said:
    May 3, 2015 at 12:41 pm

    Hi,
    I have just discovered you toolbox which seems very interesting. I am the developer of a software suite written in Matlab language (SonarScope : http://flotte.ifremer.fr/fleet/Presentation-of-the-fleet/On-board-software/SonarScope http://fr.mathworks.com/company/newsletters/articles/developing-and-deploying-sonar-and-echosounder-data-analysis-software.html)
    I would be very interested to propose DEM processings using TopoToolbox in SonarScope.
    In addition to SonarScope I developped a 3DViewer based on Nasa World Wind that could interest you. If you are interested in getting copies of these software suites please tell me,

    Jean-Marie Augustin, Ifremer, France augustin@ifremer.fr

    Martine Collaud Coen said:
    August 25, 2016 at 11:28 am

    Hi,
    I do use TopoToolbox since several months and have a Problem with the coor2ind function. There is almost always a shift between the IX linear index calculated by coor2ind leading to an error between 0 and 50 on IX. If I plot on the topography the x,y coordinate (latitude and longitude), the shift can be visualised. Up to now I always plot them and caculate manually the shift. I have now to make calculation for a whole grid. Do you have a solution ?
    Martine

    wschwanghart responded:
    August 25, 2016 at 1:56 pm

    Hi Martine, I do not fully understand the error. coord2ind snaps x and y coordinates to the center of the nearest cell, and returns this cell’s linear index. Thus, there will usually always a shift between the x and y coordinates that you supply to coord2ind, and those coordinates that you obtain from ind2coord.

    Without knowing exactly your application, would the function GRIDobj/interp do the job? This function interpolates values in a grid to your coordinates.

    Best, Wolfgang

    Martine Collaud Coen said:
    August 25, 2016 at 2:28 pm

    Hi Wolfgang,

    I do not know if I’m doing something wrong. But coord2ind does not give me the nearest cell, but sometimes some 10 to 30 cells before or after the real cell. So that I implemented my Points with latitude, longitude and with the number of cells that have to be shifted to have the real Point. For example, using
    IX=coord2ind(X,Y, lon_st, lat_st),
    Figure
    imagesc(DEM1);
    hold on;
    plot(lon_st,lat_st,’xc’);
    [xx1,yy1]=ind2coord(DEM1,IX);
    plot(xx1,yy1,’ow’);

    then I Count on the map the difference d and if I plot

    [xx2,yy2]=ind2coord(DEM1,IX+d);
    plot(xx2,yy2,’ow’);

    then xx2 and yy2 are on the right place.

    d can be up to 45 sometimes. There is gridcells where this shift is small, then it increases and becomes suddently negatives and then decrease again. I asked my self is this can be due to a wrong rounding of the coordinates.
    I hope that you understand my Problem and many thanks for your answer
    Best regards
    Martine

    wschwanghart responded:
    August 26, 2016 at 7:34 am

    Hi Martine,
    quite difficult to judge from distance. But following possible errors come to my mind:
    – Do the GRIDobj and lon_st, lat_st share the same coordinates?
    – isequal(DEM.size,size(DEM.Z))
    If that doesn’t help, please write me an email (http://www.geo.uni-potsdam.de/mitarbeiterdetails/show/421/Wolfgang_Schwanghart.html).

    Best regards, Wolfgang

    Francisco Peña said:
    November 4, 2016 at 5:05 pm

    Hi Wolfgang,
    I’m very interested in using your software as part of my PhD research.
    I’ve recently downloaded Topotoolbox and I have experience some issues using basic commands during the 1st tutorial such as crop, resample or imageschs. For instance, after writing the command imageschs(DEM,min(gradient8(DEM),1)) I received the following error:
    ??? Undefined function or method ‘narginchk’ for input arguments of type ‘double’.

    Error in ==> GRIDobj.min at 5
    narginchk(1, 2)

    The paths have been correctly assigned so basically I don’t understand what I’m doing wrong.
    Could you please provide some advice in order to solve the problem?
    Thank you in advance,
    Francisco

    floodriskgis said:
    November 4, 2016 at 5:26 pm

    Dear Wolfgang,
    I’m very interested in using your software for my PhD research project.
    I recently downloaded Topotoolbox and unfortunately I’ve experienced some issues during the 1st tutorial.
    This happens when using the command >> imageschs(DEM,min(gradient8(DEM),1))
    ??? Undefined function or method ‘narginchk’ for input arguments of type ‘double’.

    Error in ==> GRIDobj.min at 5
    narginchk(1, 2)
    The paths were added correctly and I’ve followed the user guide step-by-step.
    Could you please provide some advice to solve this issue?
    Thanks in advance,

    Francisco Peña
    email- francisco.pena@unistrapg.it
    website- http://warredoc.unistrapg.it/

    wschwanghart responded:
    November 4, 2016 at 6:36 pm

    Dear Francisco,

    I guess that these issues arise due to an outdated version of matlab. narginchk was introduced in 2011b (https://de.mathworks.com/help/matlab/ref/narginchk.html). It seems your version is older than that.

    Best, Wolfgang

    ahmed said:
    November 26, 2016 at 12:01 pm

    Hi There, I have just start to work on TopoToolbox that i worked on TecDEM and stream profiler. Kindly I would like to ask if there someone in the UK working on TopoToolbox to contact him and see how to work. Another question is there a window appears to to choose the function(similler to TecDEM) or i have to write a command for each process in the MATLAB window.

    Many thanks

    VBuford said:
    December 4, 2016 at 3:43 am

    Hi there,

    I am currently using topotools to run ksn analyses. My tif is from Peru, so both negative lat and long. When I run the ksn help matlab code, and I get to L86 (the STATS section), I get this error:
    Error using histc
    Edge vector must be monotonically non-decreasing.

    Error in slopearea (line 141)
    [~,ix] = histc(a,edges);
    Do you have any idea why this is ocurring or how to fix this?

      wschwanghart responded:
      December 4, 2016 at 9:30 pm

      Hi, I had this issue before. It happened because a user worked with a geographic coordinate system (latitude, longitude). Please work with projected coordinate systems (e.g. UTM) with the horizontal and vertical coordinates having the same unit, e.g. [m]. You can use the function

      DEM = reproject2utm(DEM);

      Hope this works out. Please let me know if it doesn’t.
      Best regards, Wolfgang

        Ramendra Sahoo said:
        March 28, 2017 at 4:51 am

        Dear Wolfgang, I have recently started using topotoolbox for my research, which mainly focuses on quantitative attributes of drainage network. I was going through the userguide_XX.m files for acquaintance with the available functions. One of the example in that is the derivation of flow direction (both single and multiple) from a dem(baranja_hill.mat). Upon executing the line 28, I got an error message. Following are the line and the associated error message.

        load baranja_hill
        demf = fillsinks(dem);
        Undefined function ‘fillsinks’ for input arguments of type ‘double’.

        Later I checked and saw that ‘fillsinks’ use a GRIDobj as an input. Also, in case of the ‘flowdir’ function, I tried both the ‘GRIDobj’ type argument and ‘double’ type argument. For both of them, it returns the same type of error.

        Kindly look into this. I am using MATLAB R2015a, and I have licenses for both image processing and mapping toolbox. Please help me with the proble.

        Regards
        Ramendra

    wschwanghart responded:
    March 28, 2017 at 7:37 am

    Dear Ramendra, many thanks for your comment. You are right. The baranja_hill.mat contained the matrices X,Y and dem as they were used by TopoToolbox before we introduced GRIDobj. I have now updated the file which now contains the GRIDobj. At the same time, I realized that userguide_2_flats.m is completely outdated and incompatible with version 2 of TopoToolbox. At has been a while since I have looked at these files. Thanks for these hints!
    Best regards, Wolfgang

      Ramendra Sahoo said:
      March 28, 2017 at 8:25 am

      Dear Wolfgang, thank you for addressing my concern. I have downloaded the latest work-in-progress copy of topotoolbox only. But as per your suggestion, I again downloaded it and checked for the banjara_hills file. The same problem persists and there is no GRIDobj type file. And can you also kindly check the ‘flowdir’ tool, as it is taking neither mat file nor GRIDobj file as input. All the examples concerning the flowdir function has shown a mat file as input. But it is throwing the same error.
      ‘Undefined function ‘fillsinks’ for input arguments of type ‘double’.’

      Regards
      Ramendra

    Ramendra Sahoo said:
    March 28, 2017 at 9:36 am

    Dear Wolfgang, thank you very much. All the confusions seems to have been sorted out for now.

    Thanks and Regards
    Ramendra

    Ramendra Sahoo said:
    April 4, 2017 at 10:09 am

    Dear Wolfgang, can you kindly suggest any way to write a 2-d matrix into a geotiff file? I have been trying to do that using the geotiifwrite. But the function doesn’t perform consistently and throws some errors now and then.

    Regards
    Ramendra

      wschwanghart responded:
      April 8, 2017 at 8:06 pm

      Dear Ramendra, without seeing the error message, it is difficult to help out here. Unless you are writing a GRIDobj to a geotiff, please check the help of geotiffwrite (https://de.mathworks.com/help/map/ref/geotiffwrite.html ). It might also help to take a look at the code of GRIDobj2geotiff.
      Best regards, Wolfgang

    Caterina Samela said:
    May 4, 2017 at 1:54 pm

    Dear Wolfgang, thanks for these super-useful functions! Can you kindly suggest me the proper one to extract the main channel (e.g. the longest one) in a pre-identified river network?

      wschwanghart responded:
      May 4, 2017 at 2:09 pm

      Hi Caterina, thanks for your kind comment! trunk is the function you need.
      Best regard, Wolfgang

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s