Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Is there a way to generate a DEM, programatically or otherwise (arcpy or R?), that will feed into ArcGIS for further spatial analysis?

Perhaps this needs to be broken down into smaller incremental steps...

  1. Generate a grid
  2. Fill grid with values where: 0 > value < maxElevation
  3. Neighbouring cells: (x1-x2) < maxSlope

Strange request? Anyone have any ideas?

share|improve this question
3  
The site @Igor points you to suggests a need to clarify this question. It focuses on "synthetic terrains," apparently to create backgrounds for games and the like. Most of those techniques do not appear to focus on recreating actual DEMs: "realistic" is in the eye of the beholder rather than having any scientific content. In your question, "further spatial analysis" suggests you need your synthetic DEMs to reproduce certain characteristics of some class of actual DEMs. If this is so, just what features do you need to capture? –  whuber Feb 28 '12 at 16:30
add comment

7 Answers 7

up vote 5 down vote accepted

try or read this page for some good information. and second link show you the way of random digital elevatin model...

  1. Numerical and Scientific Python and Data Visualisation
  2. creating elevation/height field gdal numpy python

i hope it helps you

share|improve this answer
    
First link is broken. –  Bach Jun 27 at 13:19
add comment

Here's a great resource on terrain generation algorithms and software on vterrain.org: http://vterrain.org/Elevation/Artificial/

share|improve this answer
add comment

You could also consider having a script that takes random part of an existing real DEM.

share|improve this answer
    
(+1) That can be a surprisingly effective approach. –  whuber Feb 28 '12 at 19:10
    
Plus it would need some kind of filltering at the end to nivelate those mosaic edges of random parts.. –  najuste Nov 26 '12 at 8:02
add comment

You can use fractals for this: Artificial DEMs created with fractals.

The upper row was generated with the fractal dimension d=2.0005 (left: elevation map, right: aspect map), the lower row with fractal dimension d=2.90 (left: elevation map, right: aspect map). I used r.surf.fractal of GRASS GIS. Then simply export the artificial DEM with r.out.gdal (or the GUI) to GeoTIFF.

share|improve this answer
add comment

You could try using Perlin noise to create some random fractal terrain. This answer on Stackoverflow explains a way you could get started in Python. The trick would be to zoom in on a very small area of the noisy grid so it's not too irregular looking.

share|improve this answer
add comment

Here is an R solution using a Gaussian Kernel to add autocorrelation to a random raster. Although, I have to say that the GRASS r.surf.fractal function, suggested by @markusN, seems like the best approach.

require(raster)

# Create 100x100 random raster with a Z range of 500-1500
r <- raster(ncols=100, nrows=100, xmn=0)
  r[] <- runif(ncell(r), min=500, max=1500)  

# Gaussian Kernel Function
GaussianKernel <- function(sigma=s, n=d) {
          m <- matrix(nc=n, nr=n)
            col <- rep(1:n, n)
            row <- rep(1:n, each=n)
          x <- col - ceiling(n/2)
          y <- row - ceiling(n/2)
         m[cbind(row, col)] <- 1/(2*pi*sigma^2) * exp(-(x^2+y^2)/(2*sigma^2))
        m / sum(m)
       }

# Create autocorrelated raster using 9x9 Gaussian Kernel with a sigma of 1
r.sim <- focal(r, w=GaussianKernel(sigma=1, n=9))

# Plot results
par(mfcol=c(1,2))
  plot(r, main="Random Raster")
  plot(r.sim, main="Autocorrelated Random Raster sigma=1, n=9")
share|improve this answer
add comment

libnoise gives you what you want. You will likely have to customize it to some extent. Check the 'complex planetary surface' example.

libnoise is a portable C++ library that is used to generate coherent noise, a type of smoothly-changing noise. libnoise can generate Perlin noise, ridged multifractal noise, and other types of coherent-noise.

Coherent noise is often used by graphics programmers to generate natural-looking textures, planetary terrain, and other things. The mountain scene shown above was rendered in Terragen with a terrain file generated by libnoise. You can also view some other examples of what libnoise can do.

In libnoise, coherent-noise generators are encapsulated in classes called noise modules. There are many different types of noise modules. Some noise modules can combine or modify the outputs of other noise modules in various ways; you can join these modules together to generate very complex coherent noise.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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