[GRASS-user] DEM with bathymetric contour lines

I am trying to create a DEM from a bathymetric contour lines. Contours are in vector format and the elevation value is negative (integers). To create the surface I have converted the contours in raster (v.to rast) and then I have used r.surf.contour, but It doesn’t work (there is no error but the resulting output raster is exactly the same as the previous one, without any interpolation).

This are my region settings:

g.region -p -a raster=contours@iiaa nsres=1 ewres=1

projection: 1 (UTM)

zone: 30

datum: etrs89

ellipsoid: grs80

north: 4818927

south: 4791484

west: 486512

east: 601275

nsres: 1

ewres: 1

rows: 27443

cols: 114763

cells: 3149441009

I need a DEM of very high resolution of a wide area. I am using a computer with large capacities for it.

Could someone help me please?

Hello,
I tried to process bathymetry lines with negative elevation and it just worked in GRASS 7.0.1svn r65198 @Linux. Maybe try if it works with coarser resolution or region subset to test if the data volume is the problem, or if your version of GRASS really has problem with negative elevation values. Also try to look if the input raster contains expected values, if you did not check that already.
If the problem persists, post your findings with log of the commands you used, your GRASS version and platform.
If it seems a problem of the GRASS module, and you are using a recent version of GRASS, it would be better to fill a bug, instructions at http://grass.osgeo.org/development/bug-tracking/
Regards,
Tomas Brunclik

···

Dne 18.5.2015 v 16:47 Irantzu Alvarez napsal(a):

I am trying to create a DEM from a bathymetric contour lines. Contours are in vector format and the elevation value is negative (integers). To create the surface I have converted the contours in raster (v.to rast) and then I have used r.surf.contour, but It doesn’t work (there is no error but the resulting output raster is exactly the same as the previous one, without any interpolation).

This are my region settings:

g.region -p -a raster=contours@iiaa nsres=1 ewres=1

projection: 1 (UTM)

zone: 30

datum: etrs89

ellipsoid: grs80

north: 4818927

south: 4791484

west: 486512

east: 601275

nsres: 1

ewres: 1

rows: 27443

cols: 114763

cells: 3149441009

I need a DEM of very high resolution of a wide area. I am using a computer with large capacities for it.

Could someone help me please?

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-user](http://lists.osgeo.org/mailman/listinfo/grass-user)

On Mon, May 18, 2015 at 4:47 PM, Irantzu Alvarez <irantzu.alvarez@gmail.com> wrote:

I am trying to create a DEM from a bathymetric contour lines.

To replicate, I have downloaded a bathymetric DEM portion from
http://www.marine-geo.org/tools/maps_grids.php
(downloaded as GeoTIFF, LatLong, imported with r.in.gdal).

I am using GRASS GIS 7.0.svn here.

Contours are
in vector format and the elevation value is negative (integers).

ok, in my test case I have run

r.contour GMRTv2_7_bathy_mediterranean step=100 min=-4000 max=3500 output=GMRTv2_7_bathy_mediterranean_contours_100m

To create
the surface I have converted the contours in raster (v.to rast)

Yes:
v.to.rast input=GMRTv2_7_bathy_mediterranean_contours_100m output=GMRTv2_7_bathy_mediterranean_contours_100m use=attr attribute_column=level

and then I
have used r.surf.contour, but It doesn’t work (there is no error but the
resulting output raster is exactly the same as the previous one, without any
interpolation).

Strange. Here, with

r.surf.contour input=GMRTv2_7_bathy_mediterranean_contours_100m output=GMRTv2_7_bathy_mediterranean_interpol

… I got back a nice bathymetric DEM (naturally, the “differences” map generated with r.mapcalc shows some differences to the original map I derived the contour lines from given the oversimplification done with the vectorization).

This are my region settings:

g.region -p -a raster=contours@iiaa nsres=1 ewres=1
projection: 1 (UTM)
zone: 30

rows: 27443
cols: 114763
cells: 3149441009

Which GRASS GIS version are you using?

I need a DEM of very high resolution of a wide area. I am using a computer
with large capacities for it.

Yes, but which operating system?

My full procedure below.

HTH,
Markus


http://consulting.neteler.org
http://courses.neteler.org/next-training/
http://gis.cri.fmach.it/neteler/

######## Test case procedure (GRASS GIS 7)

import bathymetric map, downloaded from http://www.marine-geo.org/tools/maps_grids.php

r.in.gdal /home/neteler/data/GMRTv2_7_20150525topo.tif out=GMRTv2_7_bathy_mediterranean -o
g.region raster=GMRTv2_7_bathy_mediterranean
r.colors GMRTv2_7_bathy_mediterranean color=srtm_plus

visualize imported map

d.mon wx0
d.rast GMRTv2_7_bathy_mediterranean

generate contour lines (for our test case)

r.info GMRTv2_7_bathy_mediterranean
r.contour GMRTv2_7_bathy_mediterranean step=100 min=-4000 max=3500 output=GMRTv2_7_bathy_mediterranean_contours_100m
d.vect GMRTv2_7_bathy_mediterranean_contours_100m

rasterize contour lines

v.to.rast input=GMRTv2_7_bathy_mediterranean_contours_100m output=GMRTv2_7_bathy_mediterranean_contours_100m use=attr attribute_column=level

visualize colorized contour lines

d.mon wx1
r.colors GMRTv2_7_bathy_mediterranean_contours_100m color=srtm_plus
d.rast GMRTv2_7_bathy_mediterranean_contours_100m

interpolate DEM from contour lines

r.surf.contour input=GMRTv2_7_bathy_mediterranean_contours_100m output=GMRTv2_7_bathy_mediterranean_interpol
r.colors GMRTv2_7_bathy_mediterranean_interpol color=srtm_plus
r.info GMRTv2_7_bathy_mediterranean_interpol

visualize new resulting map

d.mon wx2
d.rast GMRTv2_7_bathy_mediterranean_interpol

generate differences map for validation

r.mapcalc “GMRTv2_7_bathy_mediterranean_diff = GMRTv2_7_bathy_mediterranean - GMRTv2_7_bathy_mediterranean_interpol”
r.colors GMRTv2_7_bathy_mediterranean_diff color=differences

visualize differences map

d.mon wx3
d.rast GMRTv2_7_bathy_mediterranean_diff

optionally generate histogram or profiles via wxGUI

Hello Irantzu,
As I said, for anyone to be able to help, please post the exact commands used (all from the beginning, not just the last one which fails) and GRASS version and operating system, just like Markus did in his post. If you are using GUI tools, there is the copy button in the command dialogs, that will allow you to paste the command parameters to e-mail. Also, address the reply back to the conference - more people may have ideas.
It occurs to me, that if there is no error, and the interpolation throws unchanged input raster on you, that perhaps the input raster contains zero values instead of no-data (null) values or something - then there would be nothing to interpolate… But without seeing the data or the commands used it is just wild guessing…
Regards,
Tomas

···

Dne 25.5.2015 v 13:43 Irantzu Alvarez napsal(a):

Hello Tomas,

As you said, I think that the problem could be in the volume of data. My contours are of 300 MB and if I set a region with resolution of 1 m (the one I would like to perform) the output raster has over 3 billion cells. Although I have a high capacity computer, grass doen’t compute the surface. With a resolution of 10 m my region setting are:
g.region -p
projection: 1 (UTM)
zone: 30
datum: etrs89
ellipsoid: grs80
north: 4818930
south: 4791480
west: 486510
east: 601280
nsres: 10
ewres: 10
rows: 2745
cols: 11477
cells: 31504365

I am trying to generalize contours, in order to reduce the contour file, but I don’t know which algorithm is better in that case.

After that I will try to use diferrent resolutions to see if that is the problem.

All the best,

irantzu

2015-05-25 10:12 GMT+02:00 Tomáš Brunclík <brunclik@atlas.cz>:

Hello,
I tried to process bathymetry lines with negative elevation and it just worked in GRASS 7.0.1svn r65198 @Linux. Maybe try if it works with coarser resolution or region subset to test if the data volume is the problem, or if your version of GRASS really has problem with negative elevation values. Also try to look if the input raster contains expected values, if you did not check that already.
If the problem persists, post your findings with log of the commands you used, your GRASS version and platform.
If it seems a problem of the GRASS module, and you are using a recent version of GRASS, it would be better to fill a bug, instructions at http://grass.osgeo.org/development/bug-tracking/
Regards,
Tomas Brunclik

Dne 18.5.2015 v 16:47 Irantzu Alvarez napsal(a):

I am trying to create a DEM from a bathymetric contour lines. Contours are in vector format and the elevation value is negative (integers). To create the surface I have converted the contours in raster (v.to rast) and then I have used r.surf.contour, but It doesn’t work (there is no error but the resulting output raster is exactly the same as the previous one, without any interpolation).

This are my region settings:

g.region -p -a raster=contours@iiaa nsres=1 ewres=1

projection: 1 (UTM)

zone: 30

datum: etrs89

ellipsoid: grs80

north: 4818927

south: 4791484

west: 486512

east: 601275

nsres: 1

ewres: 1

rows: 27443

cols: 114763

cells: 3149441009

I need a DEM of very high resolution of a wide area. I am using a computer with large capacities for it.

Could someone help me please?

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-user](http://lists.osgeo.org/mailman/listinfo/grass-user)

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

PS: Just another wild guess :wink:

  • Does the input vector bathymetry file contain vector lines? Because when I have tried my test, what I downloaded to play with contained polygons, not lines and I had to convert it to lines first (something like: v.type input=bathymetry output=bathymetry_lines from_type=boundary to_type=line). That would also explain your difficulties…
    Tomas
···

Dne 26.5.2015 v 10:38 Tomáš Brunclík napsal(a):

Hello Irantzu,
As I said, for anyone to be able to help, please post the exact commands used (all from the beginning, not just the last one which fails) and GRASS version and operating system, just like Markus did in his post. If you are using GUI tools, there is the copy button in the command dialogs, that will allow you to paste the command parameters to e-mail. Also, address the reply back to the conference - more people may have ideas.
It occurs to me, that if there is no error, and the interpolation throws unchanged input raster on you, that perhaps the input raster contains zero values instead of no-data (null) values or something - then there would be nothing to interpolate… But without seeing the data or the commands used it is just wild guessing…
Regards,
Tomas

Dne 25.5.2015 v 13:43 Irantzu Alvarez napsal(a):

Hello Tomas,

As you said, I think that the problem could be in the volume of data. My contours are of 300 MB and if I set a region with resolution of 1 m (the one I would like to perform) the output raster has over 3 billion cells. Although I have a high capacity computer, grass doen’t compute the surface. With a resolution of 10 m my region setting are:
g.region -p
projection: 1 (UTM)
zone: 30
datum: etrs89
ellipsoid: grs80
north: 4818930
south: 4791480
west: 486510
east: 601280
nsres: 10
ewres: 10
rows: 2745
cols: 11477
cells: 31504365

I am trying to generalize contours, in order to reduce the contour file, but I don’t know which algorithm is better in that case.

After that I will try to use diferrent resolutions to see if that is the problem.

All the best,

irantzu

2015-05-25 10:12 GMT+02:00 Tomáš Brunclík <brunclik@atlas.cz>:

Hello,
I tried to process bathymetry lines with negative elevation and it just worked in GRASS 7.0.1svn r65198 @Linux. Maybe try if it works with coarser resolution or region subset to test if the data volume is the problem, or if your version of GRASS really has problem with negative elevation values. Also try to look if the input raster contains expected values, if you did not check that already.
If the problem persists, post your findings with log of the commands you used, your GRASS version and platform.
If it seems a problem of the GRASS module, and you are using a recent version of GRASS, it would be better to fill a bug, instructions at http://grass.osgeo.org/development/bug-tracking/
Regards,
Tomas Brunclik

Dne 18.5.2015 v 16:47 Irantzu Alvarez napsal(a):

I am trying to create a DEM from a bathymetric contour lines. Contours are in vector format and the elevation value is negative (integers). To create the surface I have converted the contours in raster (v.to rast) and then I have used r.surf.contour, but It doesn’t work (there is no error but the resulting output raster is exactly the same as the previous one, without any interpolation).

This are my region settings:

g.region -p -a raster=contours@iiaa nsres=1 ewres=1

projection: 1 (UTM)

zone: 30

datum: etrs89

ellipsoid: grs80

north: 4818927

south: 4791484

west: 486512

east: 601275

nsres: 1

ewres: 1

rows: 27443

cols: 114763

cells: 3149441009

I need a DEM of very high resolution of a wide area. I am using a computer with large capacities for it.

Could someone help me please?

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-user](http://lists.osgeo.org/mailman/listinfo/grass-user)

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

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-user](http://lists.osgeo.org/mailman/listinfo/grass-user)

Hi Irantzu,
I am just trying again with this dataset:
https://dl.dropboxusercontent.com/u/24062833/ES2003_1m_mb_contour.zip
It is cosiderably smaller than yours, with 1m resolution the region is 5676x4142 pixels, but running r.surf.contour for 15 minutes and still 0% done. Hope it is able to finish before I have to leave, I have common office PC. In any case I will let you know what was the result, you can try with the same data for comparison.
Looking at the data, which are of some inland water body, I see the most of the region area is covered by land, which is not covered by contours (there are contours for elevation <= 0 only). Would see how the command copes with that, this could possibly be source of your problems, should your data also contain large areas not covered by the contours. It such case a mask may help.
Regards,
Tomas

For the record, the commands I used:

#First created new location using the data as source of its projection settings and imported the file (from startup GUI), then:

g.region vector=ES2003_1m_mb_contour@PERMANENT

g.region res=1

g.region -p
projection: 1 (UTM)
zone: 10
datum: wgs84
ellipsoid: wgs84
north: 4079792.873656
south: 4074116.9543482
west: 608344.55566446
east: 612486.8266235
nsres: 0.99998578
ewres: 1.00006542
rows: 5676
cols: 4142
cells: 23509992

v.to.rast input=ES2003_1m_mb_contour@PERMANENT output=contours_rast attribute_column=CONTOUR

r.surf.contour input=contours_rast output=dmt_rast

···

Dne 31.5.2015 v 20:21 Irantzu Alvarez napsal(a):

Hi Markus and Tomas,
Thank you very much for all your support.

I am using Grass 7.0 in linux and I am working in a high capacity computer.

My bathymetry input file contains vector lines, and all of them have an elevation value, from -2 to -116, with an interval of 1 m. The file have 300 MB.

After executing the v.to.rast command, I get a raster, and it seems that is correct (pixels have the value of the elevation).
I am trying to change te resolution in order to get the interpolation. If I choose a resolution of 1 meter, the output file is exactly the same as the previous one, but if I change it (for example a resolution of 100 m), it works, but with a very bis pixexl size. The question is that I need a high resolution DEM.
This are the commands I have used:

v.to.rast input=iso1@ras type=line output=ras_ir use=attr attribute_column=CONTOUR
r.surf.contour --overwrite input=ras_ir@ras output=mdt_ras

Regards,

Irantzu

2015-05-26 10:50 GMT+02:00 Tomáš Brunclík <brunclik@atlas.cz>:

PS: Just another wild guess :wink:

  • Does the input vector bathymetry file contain vector lines? Because when I have tried my test, what I downloaded to play with contained polygons, not lines and I had to convert it to lines first (something like: v.type input=bathymetry output=bathymetry_lines from_type=boundary to_type=line). That would also explain your difficulties…
    Tomas

Dne 26.5.2015 v 10:38 Tomáš Brunclík napsal(a):

Hello Irantzu,
As I said, for anyone to be able to help, please post the exact commands used (all from the beginning, not just the last one which fails) and GRASS version and operating system, just like Markus did in his post. If you are using GUI tools, there is the copy button in the command dialogs, that will allow you to paste the command parameters to e-mail. Also, address the reply back to the conference - more people may have ideas.
It occurs to me, that if there is no error, and the interpolation throws unchanged input raster on you, that perhaps the input raster contains zero values instead of no-data (null) values or something - then there would be nothing to interpolate… But without seeing the data or the commands used it is just wild guessing…
Regards,
Tomas

Dne 25.5.2015 v 13:43 Irantzu Alvarez napsal(a):

Hello Tomas,

As you said, I think that the problem could be in the volume of data. My contours are of 300 MB and if I set a region with resolution of 1 m (the one I would like to perform) the output raster has over 3 billion cells. Although I have a high capacity computer, grass doen’t compute the surface. With a resolution of 10 m my region setting are:
g.region -p
projection: 1 (UTM)
zone: 30
datum: etrs89
ellipsoid: grs80
north: 4818930
south: 4791480
west: 486510
east: 601280
nsres: 10
ewres: 10
rows: 2745
cols: 11477
cells: 31504365

I am trying to generalize contours, in order to reduce the contour file, but I don’t know which algorithm is better in that case.

After that I will try to use diferrent resolutions to see if that is the problem.

All the best,

irantzu

2015-05-25 10:12 GMT+02:00 Tomáš Brunclík <brunclik@atlas.cz>:

Hello,
I tried to process bathymetry lines with negative elevation and it just worked in GRASS 7.0.1svn r65198 @Linux. Maybe try if it works with coarser resolution or region subset to test if the data volume is the problem, or if your version of GRASS really has problem with negative elevation values. Also try to look if the input raster contains expected values, if you did not check that already.
If the problem persists, post your findings with log of the commands you used, your GRASS version and platform.
If it seems a problem of the GRASS module, and you are using a recent version of GRASS, it would be better to fill a bug, instructions at http://grass.osgeo.org/development/bug-tracking/
Regards,
Tomas Brunclik

Dne 18.5.2015 v 16:47 Irantzu Alvarez napsal(a):

I am trying to create a DEM from a bathymetric contour lines. Contours are in vector format and the elevation value is negative (integers). To create the surface I have converted the contours in raster (v.to rast) and then I have used r.surf.contour, but It doesn’t work (there is no error but the resulting output raster is exactly the same as the previous one, without any interpolation).

This are my region settings:

g.region -p -a raster=contours@iiaa nsres=1 ewres=1

projection: 1 (UTM)

zone: 30

datum: etrs89

ellipsoid: grs80

north: 4818927

south: 4791484

west: 486512

east: 601275

nsres: 1

ewres: 1

rows: 27443

cols: 114763

cells: 3149441009

I need a DEM of very high resolution of a wide area. I am using a computer with large capacities for it.

Could someone help me please?

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-user](http://lists.osgeo.org/mailman/listinfo/grass-user)

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

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-user](http://lists.osgeo.org/mailman/listinfo/grass-user)

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

Hello all,
after about 10 hours of processing (the computer got to sleep state over night) still progress 0%. Is it normal on such region size and core i5 PC?
T. Brunclik

···

Dne 1.6.2015 v 11:44 Tomáš Brunclík napsal(a):

Hi Irantzu,
I am just trying again with this dataset:
https://dl.dropboxusercontent.com/u/24062833/ES2003_1m_mb_contour.zip
It is cosiderably smaller than yours, with 1m resolution the region is 5676x4142 pixels, but running r.surf.contour for 15 minutes and still 0% done. Hope it is able to finish before I have to leave, I have common office PC. In any case I will let you know what was the result, you can try with the same data for comparison.
Looking at the data, which are of some inland water body, I see the most of the region area is covered by land, which is not covered by contours (there are contours for elevation <= 0 only). Would see how the command copes with that, this could possibly be source of your problems, should your data also contain large areas not covered by the contours. It such case a mask may help.
Regards,
Tomas

For the record, the commands I used:

#First created new location using the data as source of its projection settings and imported the file (from startup GUI), then:

g.region vector=ES2003_1m_mb_contour@PERMANENT

g.region res=1

g.region -p
projection: 1 (UTM)
zone: 10
datum: wgs84
ellipsoid: wgs84
north: 4079792.873656
south: 4074116.9543482
west: 608344.55566446
east: 612486.8266235
nsres: 0.99998578
ewres: 1.00006542
rows: 5676
cols: 4142
cells: 23509992

v.to.rast input=ES2003_1m_mb_contour@PERMANENT output=contours_rast attribute_column=CONTOUR

r.surf.contour input=contours_rast output=dmt_rast

Dne 31.5.2015 v 20:21 Irantzu Alvarez napsal(a):

Hi Markus and Tomas,
Thank you very much for all your support.

I am using Grass 7.0 in linux and I am working in a high capacity computer.

My bathymetry input file contains vector lines, and all of them have an elevation value, from -2 to -116, with an interval of 1 m. The file have 300 MB.

After executing the v.to.rast command, I get a raster, and it seems that is correct (pixels have the value of the elevation).
I am trying to change te resolution in order to get the interpolation. If I choose a resolution of 1 meter, the output file is exactly the same as the previous one, but if I change it (for example a resolution of 100 m), it works, but with a very bis pixexl size. The question is that I need a high resolution DEM.
This are the commands I have used:

v.to.rast input=iso1@ras type=line output=ras_ir use=attr attribute_column=CONTOUR
r.surf.contour --overwrite input=ras_ir@ras output=mdt_ras

Regards,

Irantzu

2015-05-26 10:50 GMT+02:00 Tomáš Brunclík <brunclik@atlas.cz>:

PS: Just another wild guess :wink:

  • Does the input vector bathymetry file contain vector lines? Because when I have tried my test, what I downloaded to play with contained polygons, not lines and I had to convert it to lines first (something like: v.type input=bathymetry output=bathymetry_lines from_type=boundary to_type=line). That would also explain your difficulties…
    Tomas

Dne 26.5.2015 v 10:38 Tomáš Brunclík napsal(a):

Hello Irantzu,
As I said, for anyone to be able to help, please post the exact commands used (all from the beginning, not just the last one which fails) and GRASS version and operating system, just like Markus did in his post. If you are using GUI tools, there is the copy button in the command dialogs, that will allow you to paste the command parameters to e-mail. Also, address the reply back to the conference - more people may have ideas.
It occurs to me, that if there is no error, and the interpolation throws unchanged input raster on you, that perhaps the input raster contains zero values instead of no-data (null) values or something - then there would be nothing to interpolate… But without seeing the data or the commands used it is just wild guessing…
Regards,
Tomas

Dne 25.5.2015 v 13:43 Irantzu Alvarez napsal(a):

Hello Tomas,

As you said, I think that the problem could be in the volume of data. My contours are of 300 MB and if I set a region with resolution of 1 m (the one I would like to perform) the output raster has over 3 billion cells. Although I have a high capacity computer, grass doen’t compute the surface. With a resolution of 10 m my region setting are:
g.region -p
projection: 1 (UTM)
zone: 30
datum: etrs89
ellipsoid: grs80
north: 4818930
south: 4791480
west: 486510
east: 601280
nsres: 10
ewres: 10
rows: 2745
cols: 11477
cells: 31504365

I am trying to generalize contours, in order to reduce the contour file, but I don’t know which algorithm is better in that case.

After that I will try to use diferrent resolutions to see if that is the problem.

All the best,

irantzu

2015-05-25 10:12 GMT+02:00 Tomáš Brunclík <brunclik@atlas.cz>:

Hello,
I tried to process bathymetry lines with negative elevation and it just worked in GRASS 7.0.1svn r65198 @Linux. Maybe try if it works with coarser resolution or region subset to test if the data volume is the problem, or if your version of GRASS really has problem with negative elevation values. Also try to look if the input raster contains expected values, if you did not check that already.
If the problem persists, post your findings with log of the commands you used, your GRASS version and platform.
If it seems a problem of the GRASS module, and you are using a recent version of GRASS, it would be better to fill a bug, instructions at http://grass.osgeo.org/development/bug-tracking/
Regards,
Tomas Brunclik

Dne 18.5.2015 v 16:47 Irantzu Alvarez napsal(a):

I am trying to create a DEM from a bathymetric contour lines. Contours are in vector format and the elevation value is negative (integers). To create the surface I have converted the contours in raster (v.to rast) and then I have used r.surf.contour, but It doesn’t work (there is no error but the resulting output raster is exactly the same as the previous one, without any interpolation).

This are my region settings:

g.region -p -a raster=contours@iiaa nsres=1 ewres=1

projection: 1 (UTM)

zone: 30

datum: etrs89

ellipsoid: grs80

north: 4818927

south: 4791484

west: 486512

east: 601275

nsres: 1

ewres: 1

rows: 27443

cols: 114763

cells: 3149441009

I need a DEM of very high resolution of a wide area. I am using a computer with large capacities for it.

Could someone help me please?

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-user](http://lists.osgeo.org/mailman/listinfo/grass-user)

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

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-user](http://lists.osgeo.org/mailman/listinfo/grass-user)

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

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-user](http://lists.osgeo.org/mailman/listinfo/grass-user)

On Tue, Jun 2, 2015 at 10:18 AM, Tomáš Brunclík <brunclik@atlas.cz> wrote:

Hello all,
after about 10 hours of processing (the computer got to sleep state over
night) still progress 0%.

You may file an enhancement ticket - likely r.surf.contour has never
been optimized.

Is it normal on such region size and core i5 PC?

Well, it will only use 1 CPU unless being parallelized. But often a
code optimization is more efficient (as done for many modules in GRASS
GIS 7, see https://trac.osgeo.org/grass/wiki/Grass7/NewFeatures).
Maybe there is potential in r.surf.contour as well.

Just one other hint below:

Dne 1.6.2015 v 11:44 Tomáš Brunclík napsal(a):

Hi Irantzu,
I am just trying again with this dataset:
https://dl.dropboxusercontent.com/u/24062833/ES2003_1m_mb_contour.zip

...

For the record, the commands I used:

#First created new location using the data as source of its projection
settings and imported the file (from startup GUI), then:

g.region vector=ES2003_1m_mb_contour@PERMANENT

g.region res=1

better use

g.region res=1 -a

in order to avoid "odd" pixel resolution:

g.region -p

...

nsres: 0.99998578
ewres: 1.00006542

... this will then become precisely 1.0.

I'll now try myself the interpolation.

Markus

Hello,
the problem for me really was the areas not filled by any contours - it is mentioned in the manual that it is not good.
I stopped the processing and first tried again on much smaller sub-region - on region about 1000x1000 pixels it was still as slow as showing 0% progress for several minutes, then tried with ~500x500 and it took few minutes and worked well. Then I returned to the whole region, but created mask using buffer 65m (this is more than maximal distance between two contours anywhere within the water areas) around the contours and it worked like a charm - the whole region of 5676x4142 pixels with 1m resolution minus the mask was processed with good results. I do not know exact time, because I left the computer for two hours, but according to the progress before I left it took minutes, not hours.

Irantzu, if you have places of size in hundreds of region pixels or more not covered by contours, try to use the mask as I did and tell us if it solved your problem. If these places are not inland, but just some flat parts of the water bottom, you can still fill the resulting holes in the dmt by other means later, like r.fillnulls or other interpolation methods.

What I did: looked at the data and found that the contours are max about 32m apart. Used double of that distance (65m) to be on the safe side.
The commands:

r.buffer input=“contours_rast” output=“contours_buff” distances=65 units=“meters”

to get the min and max of the contours_buff (min was 1, max was 2)

r.info contours_buff

r.mask raster=contours_buff cats=“1 thru 2”

r.surf.contour --overwrite input=contours_rast output=dmt_rast

Regards,

···

Tomas B.

Dne 2.6.2015 v 11:58 Markus Neteler napsal(a):

On Tue, Jun 2, 2015 at 10:18 AM, Tomáš Brunclík [<brunclik@atlas.cz>](mailto:brunclik@atlas.cz) wrote:

Hello all,
after about 10 hours of processing (the computer got to sleep state over
night) still progress 0%.

You may file an enhancement ticket - likely r.surf.contour has never
been optimized.

 Is it normal on such region size and core i5 PC?

Well, it will only use 1 CPU unless being parallelized. But often a
code optimization is more efficient (as done for many modules in GRASS
GIS 7, see [https://trac.osgeo.org/grass/wiki/Grass7/NewFeatures](https://trac.osgeo.org/grass/wiki/Grass7/NewFeatures)).
Maybe there is potential in r.surf.contour as well.

Just one other hint below:

Dne 1.6.2015 v 11:44 Tomáš Brunclík napsal(a):

Hi Irantzu,
I am just trying again with this dataset:
[https://dl.dropboxusercontent.com/u/24062833/ES2003_1m_mb_contour.zip](https://dl.dropboxusercontent.com/u/24062833/ES2003_1m_mb_contour.zip)

...

For the record, the commands I used:

#First created new location using the data as source of its projection
settings and imported the file (from startup GUI), then:

g.region vector=ES2003_1m_mb_contour@PERMANENT

g.region res=1

better use

g.region res=1 -a

in order to avoid "odd" pixel resolution:

g.region -p

...

nsres:      0.99998578
ewres:      1.00006542

... this will then become precisely 1.0.

I'll now try myself the interpolation.

Markus

Hi again,

On Tue, Jun 2, 2015 at 11:58 AM, Markus Neteler <neteler@osgeo.org> wrote:

I am just trying again with this dataset:
https://dl.dropboxusercontent.com/u/24062833/ES2003_1m_mb_contour.zip

Ok, I went through this example. Indeed, it only takes minutes even on my small laptop when reducing the area of computation to where the data actually are (there is no point in interpolation from contours where no contour lines are - this will also be MUCH faster). This is done by setting a raster MASK.
On order to do so, I modified the example posted earlier:

Generate new location, for the lazy via command line:

grass70 -c ES2003_1m_mb_contour.shp ~/grassdata/ES2003

verify projection

g.proj -w

import

v.in.ogr ES2003_1m_mb_contour.shp output=ES2003_1m_mb_contour

set computational region and get extent of vector map

g.region vector=ES2003_1m_mb_contour -e
north-south extent: 5405.637436
east-west extent: 3945.019961

generate points (point distance at e.g. circa 1% of extent)

v.to.points input=ES2003_1m_mb_contour output=ES2003_1m_mb_contour_points dmax=50

get alpha shape extension, see http://grass.osgeo.org/grass70/manuals/addons/v.concave.hull.html

g.extension v.concave.hull
v.concave.hull input=ES2003_1m_mb_contour_points output=riverbed threshold=5

note: we do not need to be perfect here since we buffer the area later on

d.vect ES2003_1m_mb_contour_points
d.vect riverbed color=red type=boundary

generate buffer in order to get a slightly larger bathymetry

v.buffer input=riverbed output=riverbed_50m distance=50

reset computational region to area of interest

g.region vector=riverbed_50m res=1 -ap
projection: 1 (UTM)
zone: 10
datum: wgs84
ellipsoid: wgs84
north: 4079844
south: 4074337
west: 608294
east: 612340
nsres: 1
ewres: 1
rows: 5507
cols: 4046
cells: 22281322

restrict computation to where the data are

r.mask vector=riverbed_50m

rasterize points

v.to.rast input=ES2003_1m_mb_contour use=attr output=contours_rast attribute_column=CONTOUR

interpolate DEM from contour lines (rather fast)

r.surf.contour input=contours_rast output=dmt_rast

remove MASK

r.mask -r

check the result

r.colors dmt_rast color=byr
d.rast dmt_rast

d.grid 1000

Screenshot of the result attached.

Hope this helps,
Markus


http://consulting.neteler.org
http://courses.neteler.org/blog
http://gis.cri.fmach.it/neteler/

(attachments)

r_surf_contour_output.png