[GRASS-user] about resampling DEMs and DEM-derived parameters

Hi all.

The other day something popped on my mind, which I think could end in some research paper, but
before I venture into it I decided to ask you guys about it. I did some googling and got nothing.

So, considering a large area DEM: if I want its derivatives (slope, aspect, etc) in large-scale (larger than
the original DEM), which one is best, to resample the DEM and then calculate the derivatives, or to calculate
the derivatives and resample them? Much difference expected? The same?

best

Carlos


Prof. Carlos Henrique Grohmann
Institute of Geosciences - Univ. of São Paulo, Brazil

  • Digital Terrain Analysis | GIS | Remote Sensing -

http://carlosgrohmann.com


Can’t stop the signal.

Sent with Sparrow

Definitely first resample, then calculate derivatives - otherwise your results will be totally wrong. Depending on what kind of resampling you do, you could e.g. take a flat area and see it as slanted in a DEM with reduced resolution.

B.Sc. Daniel Lee
Geschäftsführung für Forschung und Entwicklung
ISIS - International Solar Information Solutions GbR
Vertreten durch: Daniel Lee, Nepomuk Reinhard und Nils Räder

Softwarecenter 3
35037 Marburg
Festnetz: +49 6421 379 6256
Mobil: +49 176 6127 7269
E-Mail: Lee@isi-solutions.org
Web: http://www.isi-solutions.org

2012/6/3 Carlos Grohmann <carlos.grohmann@gmail.com>

Hi all.

The other day something popped on my mind, which I think could end in some research paper, but
before I venture into it I decided to ask you guys about it. I did some googling and got nothing.

So, considering a large area DEM: if I want its derivatives (slope, aspect, etc) in large-scale (larger than
the original DEM), which one is best, to resample the DEM and then calculate the derivatives, or to calculate
the derivatives and resample them? Much difference expected? The same?

best

Carlos


Prof. Carlos Henrique Grohmann
Institute of Geosciences - Univ. of São Paulo, Brazil

  • Digital Terrain Analysis | GIS | Remote Sensing -

http://carlosgrohmann.com


Can’t stop the signal.

Sent with Sparrow


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Carlos Grohmann wrote:

The other day something popped on my mind, which I think could end
in some research paper, but before I venture into it I decided to
ask you guys about it. I did some googling and got nothing.

So, considering a large area DEM: if I want its derivatives (slope,
aspect, etc) in large-scale (larger than the original DEM), which
one is best, to resample the DEM and then calculate the derivatives,
or to calculate the derivatives and resample them? Much difference
expected? The same?

You get better results if you know what you're actually trying to
measure. The concept of a derivative is only meaningful for a
continuous surface, which a DEM isn't. Do you want the actual
derivative at a specific point (which may be the side of a rock), or
the slope of some "best-fit" plane?

It also helps if you know what the DEM represents. E.g. is the
elevation a sample at a specific point within the cell, or an average
over the area of the cell?

As a general guide, you probably want to apply some form of low-pass
filter to the data, so that the derivatives at each point are
calculated for a local best-fit curve.

7.0 has r.resamp.filter, which performs resampling with an analytic
(continuous) kernel. In 6.x, you can obtain similar results using a
combination of upsampling, filtering with r.neighbors or r.mfilter.fp,
then downsampling.

--
Glynn Clements <glynn@gclements.plus.com>

Not sure for slope and asect but for flow direction and accumulation,
you run into trouble if you resample the dem and then run the
algorithms for flowdir. There are actually some interesting works
around saying that the best thing to do in this case would be to get
the flowdir and accumulation on a finer grid and then use a special
method to rescale that.

This paper comes to mind

Olivera, F., M. S. Lear, J. S. Famiglietti, and K. Asante. “Extracting
Low-resolution River Networks from High-resolution Digital Elevation
Models.” Water Resources Research 38, no. 11 (2002): 1–8.

Cheers
Daniel

On Mon, Jun 4, 2012 at 2:44 PM, Glynn Clements <glynn@gclements.plus.com> wrote:

Carlos Grohmann wrote:

The other day something popped on my mind, which I think could end
in some research paper, but before I venture into it I decided to
ask you guys about it. I did some googling and got nothing.

So, considering a large area DEM: if I want its derivatives (slope,
aspect, etc) in large-scale (larger than the original DEM), which
one is best, to resample the DEM and then calculate the derivatives,
or to calculate the derivatives and resample them? Much difference
expected? The same?

You get better results if you know what you're actually trying to
measure. The concept of a derivative is only meaningful for a
continuous surface, which a DEM isn't. Do you want the actual
derivative at a specific point (which may be the side of a rock), or
the slope of some "best-fit" plane?

It also helps if you know what the DEM represents. E.g. is the
elevation a sample at a specific point within the cell, or an average
over the area of the cell?

As a general guide, you probably want to apply some form of low-pass
filter to the data, so that the derivatives at each point are
calculated for a local best-fit curve.

7.0 has r.resamp.filter, which performs resampling with an analytic
(continuous) kernel. In 6.x, you can obtain similar results using a
combination of upsampling, filtering with r.neighbors or r.mfilter.fp,
then downsampling.

--
Glynn Clements <glynn@gclements.plus.com>
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Hello all

Trying to update my GRASS installation from the svn to 6.4.2 on Ubuntu Lynx using these instructions

http://grass.osgeo.org/wiki/Compile_and_Install_Ubuntu

Having worked through all the dependencies I get as far as

make -j2 && sudo make install && sudo ldconfig

and get the following error

make: *** No rule to make target `include/Make/Platform.make’. Stop.

I’m not very good at this so any ideas most welcome!

best wishes,
Rebecca

Hey Rebecca,

Does the ./configure prior issuing the make command ends successfully?

Nick Ves

On Fri, 2012-06-08 at 14:17 +0100, Rebecca Bennett wrote:

Hello all

Trying to update my GRASS installation from the svn to 6.4.2 on Ubuntu
Lynx using these instructions

http://grass.osgeo.org/wiki/Compile_and_Install_Ubuntu

Having worked through all the dependencies I get as far as

    make -j2 && sudo make install && sudo ldconfig

and get the following error

    make: *** No rule to make target `include/Make/Platform.make'.
Stop.

I'm not very good at this so any ideas most welcome!

best wishes,
Rebecca
        
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

On Fri, 8 Jun 2012, Rebecca Bennett wrote:

Having worked through all the dependencies I get as far as

make \-j2 &amp;&amp; sudo make install &amp;&amp; sudo ldconfig

and get the following error

make: \*\*\* No rule to make target \`include/Make/Platform\.make&#39;\. Stop\.

I'm not very good at this so any ideas most welcome!

Rebecca,

   Compiling from souce with the gcc suite is a 3-step process: configure,
make, and make install. I highly recommend a pre-processing step, 'make
clean' to remove cruft left over from previous builds so you're always
starting from a known, good base.

   The configuration step defines what you want included (or specifically
excluded) from the executable and structures the Makefiles based on your
instructions.

   If you don't know what options are available, from the command line type
(without the quotes, of course): './configure --help | less'. This lets you
page through the configuration options. I keep my choices in a text file
called 'configure-options.sh' that I run each time; I include it here just
to show what's available.

./configure --with-postgres --with-sqlite --with-cairo --with-freetype --with-cxx --with-geos=usr/bin/geos-config --with-gdal=/usr/bin/gdal-config --with-python=/usr/bin/python-config --with-wxwidgets=/usr/bin/wx-config --enable-largefile --with-postgres-includes=/usr/local/pgsql/include/ --with-postgres-libs=/usr/local/pgsql/lib/ --with-openmp --with-sqlite-includes=/usr/include/ --with-sqlite-libs=/usr/lib/

   Once the configuration step completes without error you can run 'make'. If
you are curious, you can pre-pend the 'time' command to learn how long the
build took. When it completes without error, you can finish with 'sudo
make_install'.

   If you have other questions, ask.

Rich

--
Richard B. Shepard, Ph.D. | Integrity - Credibility - Innovation
Applied Ecosystem Services, Inc. | Helping Ensure Our Clients' Futures
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863

Thanks for your response.

No apparently the configure did not complete without error, as I got

checking whether to use Tcl/Tk… yes
checking for location of Tcl/Tk includes…
checking for tcl.h… no
configure: error: *** Unable to locate Tcl includes.

So that explains why the make won’t run. Here is the configure command I’m trying to use (which probably isn’t perfect it was just culled of the instructions site)

–with-sqlite --with-cairo --with-freetype --with-cxx --with-geos=usr/bin/geos-config --with-gdal=/usr/bin/gdal-config --with-python=/usr/bin/python-config --with-wxwidgets=/usr/bin/wx-config --enable-largefile --with-proj-share=/usr/share/proj/

full output in text file attached.

Cheers!
Rebecca


From: nikos ves vesnikos@gmail.com
To: Rebecca Bennett rabennett@ymail.com
Cc: GRASS user List grass-user@lists.osgeo.org
Sent: Friday, 8 June 2012, 14:32
Subject: Re: [GRASS-user] Compilation of GRASS 6.4.2 from svn on Ubuntu 10.04

Hey Rebecca,

Does the ./configure prior issuing the make command ends successfully?

Nick Ves

On Fri, 2012-06-08 at 14:17 +0100, Rebecca Bennett wrote:

Hello all

Trying to update my GRASS installation from the svn to 6.4.2 on Ubuntu
Lynx using these instructions

http://grass.osgeo.org/wiki/Compile_and_Install_Ubuntu

Having worked through all the dependencies I get as far as

make -j2 && sudo make install && sudo ldconfig

and get the following error

make: *** No rule to make target `include/Make/Platform.make’.
Stop.

I’m not very good at this so any ideas most welcome!

best wishes,
Rebecca


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

(attachments)

Config error (11.8 KB)

Dear Rebecca,

Since you're on ubuntu I suggest downloading a pre-compiled binary for
grass ready for use for your distribution (unless you want grass to be
able to handle something more exotic):

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install grass grass-dev

Regards,
Nick Ves

On Fri, 2012-06-08 at 15:00 +0100, Rebecca Bennett wrote:

Thanks for your response.

No apparently the configure did not complete without error, as I got

checking whether to use Tcl/Tk... yes
checking for location of Tcl/Tk includes...
checking for tcl.h... no
configure: error: *** Unable to locate Tcl includes.

So that explains why the make won't run. Here is the configure command
I'm trying to use (which probably isn't perfect it was just culled of
the instructions site)

--with-sqlite --with-cairo --with-freetype --with-cxx
--with-geos=usr/bin/geos-config --with-gdal=/usr/bin/gdal-config
--with-python=/usr/bin/python-config
--with-wxwidgets=/usr/bin/wx-config --enable-largefile
--with-proj-share=/usr/share/proj/

full output in text file attached.

Cheers!
Rebecca

        ______________________________________________________________
        From: nikos ves <vesnikos@gmail.com>
        To: Rebecca Bennett <rabennett@ymail.com>
        Cc: GRASS user List <grass-user@lists.osgeo.org>
        Sent: Friday, 8 June 2012, 14:32
        Subject: Re: [GRASS-user] Compilation of GRASS 6.4.2 from svn
        on Ubuntu 10.04
        
        Hey Rebecca,
        
        Does the ./configure prior issuing the make command ends
        successfully?
        
        Nick Ves
        
        On Fri, 2012-06-08 at 14:17 +0100, Rebecca Bennett wrote:
        > Hello all
        >
        >
        >
        > Trying to update my GRASS installation from the svn to 6.4.2
        on Ubuntu
        > Lynx using these instructions
        >
        >
        > http://grass.osgeo.org/wiki/Compile_and_Install_Ubuntu
        >
        >
        > Having worked through all the dependencies I get as far as
        >
        >
        > make -j2 && sudo make install && sudo ldconfig
        >
        >
        > and get the following error
        >
        >
        > make: *** No rule to make target
        `include/Make/Platform.make'.
        > Stop.
        >
        >
        > I'm not very good at this so any ideas most welcome!
        >
        >
        > best wishes,
        > Rebecca
        >
        > _______________________________________________
        > grass-user mailing list
        > grass-user@lists.osgeo.org
        > http://lists.osgeo.org/mailman/listinfo/grass-user
        

Hello,

Great idea but the reason I need to compile from source is to get a newer version than the 6.4.1 in the repo so it won’t work for me this time. :frowning:

Cheers,
Rebecca


From: nikos ves vesnikos@gmail.com
To: Rebecca Bennett rabennett@ymail.com
Cc: GRASS user List grass-user@lists.osgeo.org
Sent: Friday, 8 June 2012, 15:17
Subject: Re: [GRASS-user] Compilation of GRASS 6.4.2 from svn on Ubuntu 10.04

Dear Rebecca,

Since you’re on ubuntu I suggest downloading a pre-compiled binary for
grass ready for use for your distribution (unless you want grass to be
able to handle something more exotic):

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install grass grass-dev

Regards,
Nick Ves

On Fri, 2012-06-08 at 15:00 +0100, Rebecca Bennett wrote:

Thanks for your response.

No apparently the configure did not complete without error, as I got

checking whether to use Tcl/Tk… yes
checking for location of Tcl/Tk includes…
checking for tcl.h… no
configure: error: *** Unable to locate Tcl includes.

So that explains why the make won’t run. Here is the configure command
I’m trying to use (which probably isn’t perfect it was just culled of
the instructions site)

–with-sqlite --with-cairo --with-freetype --with-cxx
–with-geos=usr/bin/geos-config --with-gdal=/usr/bin/gdal-config
–with-python=/usr/bin/python-config
–with-wxwidgets=/usr/bin/wx-config --enable-largefile
–with-proj-share=/usr/share/proj/

full output in text file attached.

Cheers!
Rebecca


From: nikos ves <vesnikos@gmail.com>
To: Rebecca Bennett <rabennett@ymail.com>
Cc: GRASS user List <grass-user@lists.osgeo.org>
Sent: Friday, 8 June 2012, 14:32
Subject: Re: [GRASS-user] Compilation of GRASS 6.4.2 from svn
on Ubuntu 10.04

Hey Rebecca,

Does the ./configure prior issuing the make command ends
successfully?

Nick Ves

On Fri, 2012-06-08 at 14:17 +0100, Rebecca Bennett wrote:

Hello all

Trying to update my GRASS installation from the svn to 6.4.2
on Ubuntu
Lynx using these instructions

http://grass.osgeo.org/wiki/Compile_and_Install_Ubuntu

Having worked through all the dependencies I get as far as

make -j2 && sudo make install && sudo ldconfig

and get the following error

make: *** No rule to make target
`include/Make/Platform.make’.
Stop.

I’m not very good at this so any ideas most welcome!

best wishes,
Rebecca


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

On Fri, 8 Jun 2012, Rebecca Bennett wrote:

checking for tcl.h... no

Rebecca,

   Some distributions, such as Red Hat/Fedora/CentOS and their siblings, have
the headers in a separate development library. I've no idea if the ubuntus
are that way, too.

   I'd go look for a ubuntu development package and install that. Otherwise,
I'm not sufficiently familiar with that distribution to suggest where to
look.

Rich

On 08/06/12 16:41, Rebecca Bennett wrote:

Hello,

Great idea but the reason I need to compile from source is to get a
newer version than the 6.4.1 in the repo so it won't work for me this
time. :frowning:

6.4.2 now is in ubuntugis-unstable, at least for Ubuntu precise.

It's not very difficult to download the necessary patched source files from there and compile it for an older version of Ubuntu.

A million thanks to Hamish and Frankie who have made it possible that 6.4.2 just entered Debian unstable and some of the Debian derivatives !

Moritz

On 08/06/2012 17:00, Rebecca Bennett wrote:

Thanks for your response.

No apparently the configure did not complete without error, as I got

checking whether to use Tcl/Tk… yes
checking for location of Tcl/Tk includes…
checking for tcl.h… no
configure: error: *** Unable to locate Tcl includes.

You probably need:
sudo apt-get install tcl-dev
(and most likely other *-dev packages.) Keep re-running ./configure until it completes without errors, and scan thru the last summary to make sure all elements you expect are enabled.

So that explains why the make won’t run. Here is the configure command I’m trying to use (which probably isn’t perfect it was just culled of the instructions site)

–with-sqlite --with-cairo --with-freetype --with-cxx --with-geos=usr/bin/geos-config --with-gdal=/usr/bin/gdal-config --with-python=/usr/bin/python-config --with-wxwidgets=/usr/bin/wx-config --enable-largefile --with-proj-share=/usr/share/proj/

full output in text file attached.

Cheers!
Rebecca


Rebecca,

To compile grass (or any other software for a matter of fact), you must
first meet the pre-requirement, usually libraries which provide
secondary functions of some-kinds. As a program grows in complexity so
does the number of those libraries it depends upon.

Since you're in a debian-based distribution (ubuntu), which has an older
version of grass in its repositories you can one-shot the installation
of the required libraries with the following :

$ sudo apt-get update
$ sudo apt-get build-dep grass

The above commands will install all dependencies the package grass needs
to compile/run. Even if the grass package that residents in the
repositories is an older version, with that way you will have installed
the majority of the libraries the updated versions of grass depend on,
and thus minimize the library hunt later on.

After you've installed the dependencies you run the ./configure script
which produces a file with all the variables that they will be used in
the compilation phase.
The best way to run the ./configure is to create a basic script which it
will call the ./configure with its all its parameters.

$ cd <folders where grass src code residents>
$ touch grass-install.sh
$ chmod +a grass-install.sh

Open grass-install.sh with your favorite text editor and copy/paste this
[1]:
CFLAGS="-g -Wall" ./configure \
       --with-cxx --with-freetype=yes \
       --with-postgres=no --with-sqlite=yes --enable-largefile=yes \
       --with-readline --with-python=yes
       
Save it and run it. (From terminal you just type ./grass-install.sh )

The script will NOT complete successfully since most likely will
encounter a tcl.h error. this means that the ./configure script can find
the tcl header file, because either its not where the script expects it
to be or because you don't have it installed. Since most likely you will
encounter same errors for others files, i'll describe bellow a
semi-universal way locating the libraries you need:

Say the script can't find tcl.h , so you must install the package which
contains it. One way is to google the name of the package which contains
is, find the corresponding name of that package and then apt-get it. The
smart way tho is to make the apt-get do the searching for you:

$ sudo apt-get install apt-file
$ sudo apt-file update
$ apt-file search <name-of-file>

and for this example
$ apt-file search tcl.h

which is the commands which you ask apt to answer you for all the
packages which contain the tcl.h . Normally you want the package which
ends in -dev:

$ sudo apt-get install tcl8.5-dev

after the isntallation ofthe package completes, dont forget to run

$ sudo updatedb

which refreshes the file database.

After updatedb completes, locate where the file tcl.h lingers

locate tcl.h

which in my case is : /usr/include/tcl8.5/tcl.h .

Open again grass-install.sh you created before and add at the end the
following

--with-tcltk-includes="/usr/include/tcl8.5"

I found about the parameter "--with-tcltk-includes=" by
running ./configure --help | grep tcl from the grass directory.

Re-run the script and it should complete the tcl check successfully,
only to hinder in another error. Re-run the above patern for the new
error, adjust your configuration script accordingly until it completes
successfully.

Then you can run :

$ make
$ make install

(I recommend installing grass in userland (check the --prefix argument
for ./configure).

Compiling from source is really fun!

Regards,

Nick Ves

--------------------------
[1] modified version of http://grass.osgeo.org/wiki/Compile_and_Install

On Fri, 2012-06-08 at 15:41 +0100, Rebecca Bennett wrote:

Hello,

Great idea but the reason I need to compile from source is to get a
newer version than the 6.4.1 in the repo so it won't work for me this
time. :frowning:

Cheers,
Rebecca

        ______________________________________________________________
        From: nikos ves <vesnikos@gmail.com>
        To: Rebecca Bennett <rabennett@ymail.com>
        Cc: GRASS user List <grass-user@lists.osgeo.org>
        Sent: Friday, 8 June 2012, 15:17
        Subject: Re: [GRASS-user] Compilation of GRASS 6.4.2 from svn
        on Ubuntu 10.04
        
        Dear Rebecca,
        
        Since you're on ubuntu I suggest downloading a pre-compiled
        binary for
        grass ready for use for your distribution (unless you want
        grass to be
        able to handle something more exotic):
        
        sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
        sudo apt-get update
        sudo apt-get install grass grass-dev
        
        Regards,
        Nick Ves
        
        On Fri, 2012-06-08 at 15:00 +0100, Rebecca Bennett wrote:
        > Thanks for your response.
        >
        >
        >
        > No apparently the configure did not complete without error,
        as I got
        >
        >
        > checking whether to use Tcl/Tk... yes
        > checking for location of Tcl/Tk includes...
        > checking for tcl.h... no
        > configure: error: *** Unable to locate Tcl includes.
        >
        >
        > So that explains why the make won't run. Here is the
        configure command
        > I'm trying to use (which probably isn't perfect it was just
        culled of
        > the instructions site)
        >
        >
        >
        > --with-sqlite --with-cairo --with-freetype --with-cxx
        > --with-geos=usr/bin/geos-config
        --with-gdal=/usr/bin/gdal-config
        > --with-python=/usr/bin/python-config
        > --with-wxwidgets=/usr/bin/wx-config --enable-largefile
        > --with-proj-share=/usr/share/proj/
        >
        >
        > full output in text file attached.
        >
        >
        >
        > Cheers!
        > Rebecca
        >
        >
        >
        >
        >
        ______________________________________________________________
        > From: nikos ves <vesnikos@gmail.com>
        > To: Rebecca Bennett <rabennett@ymail.com>
        > Cc: GRASS user List <grass-user@lists.osgeo.org>
        > Sent: Friday, 8 June 2012, 14:32
        > Subject: Re: [GRASS-user] Compilation of GRASS 6.4.2
        from svn
        > on Ubuntu 10.04
        >
        >
        > Hey Rebecca,
        >
        >
        > Does the ./configure prior issuing the make command
        ends
        > successfully?
        >
        >
        > Nick Ves
        >
        >
        > On Fri, 2012-06-08 at 14:17 +0100, Rebecca Bennett
        wrote:
        > > Hello all
        > >
        > >
        > >
        > > Trying to update my GRASS installation from the svn
        to 6.4.2
        > on Ubuntu
        > > Lynx using these instructions
        > >
        > >
        > >
        http://grass.osgeo.org/wiki/Compile_and_Install_Ubuntu
        > >
        > >
        > > Having worked through all the dependencies I get as
        far as
        > >
        > >
        > > make -j2 && sudo make install && sudo ldconfig
        > >
        > >
        > > and get the following error
        > >
        > >
        > > make: *** No rule to make target
        > `include/Make/Platform.make'.
        > > Stop.
        > >
        > >
        > > I'm not very good at this so any ideas most
        welcome!
        > >
        > >
        > > best wishes,
        > > Rebecca
        > >
        > > _______________________________________________
        > > grass-user mailing list
        > > grass-user@lists.osgeo.org
        > > http://lists.osgeo.org/mailman/listinfo/grass-user
        >
        >
        >
        >
        >