1

I am trying to create a DEM from a bathymetric contour lines. Contours are in vector format and the elevation value is negative. 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. I think that it would be because the negative values of the created raster. Could someone help me?

2 Answers 2

4

What are your region settings? I tried this set of commands, and succeeded to create a DEM with negative values, with no problems:

# Set region to low resoution
GRASS 7.0.0 (ITM):~ > g.region -p res=5

# The contour vector
GRASS 7.0.0 (ITM):~ > v.db.select test_ctours
cat|elev
1|-100
2|-80
3|-60
4|-40
5|-20

# Create rasterized contours
GRASS 7.0.0 (ITM):~ > v.to.rast test_ctours type=line use=attr attribute=elev out=test_ctours --o
# Create DEM
GRASS 7.0.0 (ITM):~ > r.surf.contour test_ctours out=test_dem
GRASS 7.0.0 (ITM):~ > r.info test_dem
 +----------------------------------------------------------------------------+
 | Map:      test_dem                       Date: Fri May  8 13:02:06 2015    |
 | Mapset:   Arava                          Login of Creator: micha           |
 | Location: ITM                                                              |
 | DataBase: /home/micha/GIS/grass                                            |
 | Title:     ( test_dem )                                                    |
 | Timestamp: none                                                            |
 |----------------------------------------------------------------------------|
 |                                                                            |
 |   Type of Map:  raster               Number of Categories: 0               |
 |   Data Type:    DCELL                                                      |
 |   Rows:         200                                                        |
 |   Columns:      300                                                        |
 |   Total Cells:  60000                                                      |
 |        Projection: Transverse Mercator                                     |
 |            N:     500000    S:     499000   Res:     5                     |
 |            E:     211500    W:     210000   Res:     5                     |
 |   Range of data:    min = -100  max = -20                                  |
 |                                                                            |
 |   Data Description:                                                        |
 |    generated by r.surf.contour                                             |
 |                                                                            |
 |   Comments:                                                                |
 |    r.surf.contour input="test_ctours" output="test_dem"                    |
 |                                                                            |
 +----------------------------------------------------------------------------+

The point is that r.surf.contour is very slow when there are large gaps between the contour lines. So, either very dense contours, or a rougher resolution setting might help.

1
1

This are the settings of my vector layer:

g.region -p vector=CT_ISOBATAS_5m_ETRS89@froga                                  
projection: 1 (UTM)
zone:       30
datum:      etrs89
ellipsoid:  grs80
north:      4818925.16988824
south:      4791485.92527958
west:       486512.5000001
east:       601274.08203047
nsres:      1.00011826
ewres:      1.00010965
rows:       27436
cols:       114749
cells:      3148253564

After executing the v.to.rast command, I get a raster, and it seems that is correct (pixels have the value of the elevation)

r.info isobatas5rast                                                            
 +----------------------------------------------------------------------------+
 | Map:      isobatas5rast                  Date: Fri May  8 14:45:44 2015    |
 | Mapset:   froga                          Login of Creator: gepalgoi        |
 | Location: froga1                                                           |
 | DataBase: /gscratch/gepalgoi                                               |
 | Title:    Categories ( isobatas5rast )                                     |
 | Timestamp: none                                                            |
 |----------------------------------------------------------------------------|
 |                                                                            |
 |   Type of Map:  raster               Number of Categories: 0               |
 |   Data Type:    DCELL                                                      |
 |   Rows:         27436                                                      |
 |   Columns:      114749                                                     |
 |   Total Cells:  3148253564                                                 |
 |        Projection: UTM (zone 30)                                           |
 |            N: 4818925.16988824    S: 4791485.92527958   Res: 1.00011826    |
 |            E: 601274.08203047    W: 486512.5000001   Res: 1.00010965       |
 |   Range of data:    min = -115  max = -5                                   |
 |                                                                            |
 |   Data Source:                                                             |
 |    Vector Map: CT_ISOBATAS_5m_ETRS89@froga                                 |
 |    Original scale from vector map: 1:1                                     |
 |                                                                            |
 |   Data Description:                                                        |
 |    generated by v.to.rast                                                  |
 |                                                                            |
 |   Comments:                                                                |
 |    v.to.rast input="CT_ISOBATAS_5m_ETRS89@froga" layer="1" type="line" \   |
 |    output="isobatas5rast" use="attr" attribute_column="CONTOUR" value=1\   |
 |     memory=300                                                             |
 |                                                                            |
 +----------------------------------------------------------------------------+

Then, I interpolate the surface, but the resulting raster is exactly the same as the previos one. There is no an interpolate surface (although is hasn't give any error message):

r.surf.contour --overwrite input=isobatas5rast@froga output=mdt_isobata5
5
  • Note the non-square pixels - better to use the align flag -a of g.region with res=XX to set it properly (you need to do that at the very beginning of your workflow to not propagate odd resolution throughout your work).
    – markusN
    Commented May 15, 2015 at 13:59
  • I have used the flag -a as you said but it doesn't work. The resulting raster is again exactly the same as the one I have rasterised.
    – Irantzu
    Commented May 15, 2015 at 17:58
  • g.region -p -a raster=isobatas5rast@froga nsres=1 ewres=1 v.to.rast --overwrite input=CT_ISOBATAS_5m_ETRS89@froga type=line output=isobatas5rast use=attr attribute_column=CONTOUR
    – Irantzu
    Commented May 15, 2015 at 17:59
  • You region settings are giving you rasters of over 3 billion cells. Are you sure you need such high resolution? If I'm not mistaken, each raster layer will take 25GB of disk space.
    – Micha
    Commented May 15, 2015 at 18:50
  • Yes, I need a DEM of very high resolution of a wide area. I am using a computer with large capacities for it.
    – Irantzu
    Commented May 16, 2015 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.