error occurred when loading multiple dem files

classic Classic list List threaded Threaded
4 messages Options
Yami Yami
Reply | Threaded
Open this post in threaded view
|

error occurred when loading multiple dem files

Hello, everybody.
    I get a problem when working with multiple SRTM data files.
    I load the datas in the earth file in two methods as below. The first fails, while the second works fine.
    test.earth:
-----------------------------------------
    ...
    <elevation driver="gdal" name="ele1">
         <url>k:\\demDownloads\\ASTGTM2_N22E052_dem.tif</url>
    </elevation>
   ...
-----------------------------------------
    As I get a thousand of SRTM files in the path, I create a thousand of such layers in my earth file.
    However, when I run the command line "osgearth_viewer test.earth", a pop-up window informs me sgearth_viewer.exe has stopped working due to some problem.
    Then I modified my .earth file as below:
     test1.earth:
----------------------------------------
   ...
   <elevation name="terrain" driver="gdal">
        <url>K:\\demDownloads</url>
        <extensions>tif</extensions>
   </elevation>
  ...
-----------------------------------------
  it works fine!
  I doubt what's the difference between the two method?

  In addition, I meet another problem. When I was flying to a viewpoint in  the above second instance, the osgearth_viewer will show the terrain data in that viewpoint. However, if I pressed the escape key during its loading process, somtimes the computer will crash, and I got a black screen. Could someone guide me the problem?
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: error occurred when loading multiple dem files

Yami,

In the first case, osgEarth creates a separate layer for each file, which is just too much overhead for that many data files. You are probably running out of memory.

In the second case, the GDAL plugin is creating a "VRT" (see: http://www.gdal.org/gdal_vrttut.html) that virtualizes the many files into a single layer. Much more efficient in terms of memory management and performance. And, osgEarth can treat the whole collection as a single layer.

If you get a crash, please run in Debug mode and post a stack trace. Thanks!
Glenn Waldron / Pelican Mapping
Yami Yami
Reply | Threaded
Open this post in threaded view
|

Re: error occurred when loading multiple dem files

Got it! Thanks, Mr Glenn.
donghaimoon donghaimoon
Reply | Threaded
Open this post in threaded view
|

Re: error occurred when loading multiple dem files

In reply to this post by gwaldron
Glenn Waldron´╝î

How to create a Google Maps scale feature