Editing DSP

From BRL-CAD

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 79: Line 79:
 
Example 1.
 
Example 1.
  
In [[mged]] create a dsp object of width 142, length 150, no interpolation, cut direction 'ad', cell size 1 (in current units), and unit elevation 0.005 (in current units):
+
In mged create a dsp object of width 142, length 150, no interpolation, cut direction 'ad', cell size 1 (in current units), and unit elevation 0.005 (in current units):
  
 
  mged> in dsp1.s dsp f Ex1.dsp 142 150 0 ad 1 0.005
 
  mged> in dsp1.s dsp f Ex1.dsp 142 150 0 ad 1 0.005
Line 168: Line 168:
 
(The TGM creation is left as an exercise for the reader.)
 
(The TGM creation is left as an exercise for the reader.)
  
=== A practical example ===
+
=== A practical example [UNDER CONSTRUCTION] ===
  
Now let's consider a more practical example and a real test of BRL-CAD.  We can import topological (topo) data and produce a realistic ground surface.  There are many free sources of such data, but these, for US topo data, seem to be the most likely:
+
Now let's consider a more practical example and a real test of BRL-CAD.  We can import topological (topo) data and produce a realistic ground surface.  There are many free sources of such data, but this, for US topo data, seems to be the most likely:
  
  http://nationalmap.gov/viewer.html/
+
  http://nationalmap.gov/viewer.html
http://earthexplorer.usgs.gov/
 
  
Trying to find suitable topo data, in a desired format for a specific area, is not so easy there, so we located another source of topological data (digital elevation models [DEM]) in [http://mcmcweb.er.usgs.gov/sdts/ SDTS] format:
+
For now, though, the format for the data is not easily found so we located another source of topological data (digital elevation models [DEM]) in [http://mcmcweb.er.usgs.gov/sdts/ SDTS] format:
  
 
  http://data.geocomm.com/dem/demdownload.html
 
  http://data.geocomm.com/dem/demdownload.html
Line 182: Line 181:
 
[http://data.geocomm.com/catalog/US/61076/1231/index.html El Paso County], and [http://data.geocomm.com/catalog/US/61076/1231/group4-3.html Digital Elevation Models].
 
[http://data.geocomm.com/catalog/US/61076/1231/index.html El Paso County], and [http://data.geocomm.com/catalog/US/61076/1231/group4-3.html Digital Elevation Models].
  
On that page we downloaded all six 10-meter data archive files for complete coverage of the county. We also downloaded the six *TXT files which contain metadata about each archive. [Note that you are required to have a Geo Community account for any downloads (membership is free).]   
+
On that page we downloaded all six 10-meter data archive files because we were not yet sure which one we wanted. We also downloaded the six *TXT files which contain metadata about each archive. [Note that you are required to have a Geo Community account for any downloads (membership is free).]   
  
 
The six archive files are:
 
The six archive files are:
Line 193: Line 192:
 
  4057865.DEM.SDTS.TAR.GZ
 
  4057865.DEM.SDTS.TAR.GZ
  
Taking the first archive as an example:
+
Note that taking the first archive as an example:
  
 
  $ tar -tvzf 3818122.DEM.SDTS.TAR.GZ
 
  $ tar -tvzf 3818122.DEM.SDTS.TAR.GZ
  
we see that the archive files are not in a directory (but they are a set with possibly redundant file names found in other sets), so we create a directory for each:
+
we see that the archive files are not in a directory, so we create a directory for each:
  
 
  $ mkdir 3818122.dem
 
  $ mkdir 3818122.dem
Line 231: Line 230:
 
  http://www.visualizationsoftware.com/3dem
 
  http://www.visualizationsoftware.com/3dem
  
In order to manipulate the data in SDTS files we used the [http://gdal.org/ GDAL library] and then created a C++ program called 'sdtsdem2asc' which can be found here:
+
In order to examine the data in SDTS files there are two directions to take: (1) use a [http://mcmcweb.er.usgs.gov/sdts/sdtsxx/index.html government supplied library] or (2) use the [http://gdal.org/ GDAL library].  We chose both because they both have useful utility programs.
  
https://github.com/tbrowder/brlcad-usgs-topo-tools
+
To help select the data to be used we put pertinent metadata into a spreadsheet to calculate delta altitudes and to easily compare min and max altitudes as well as the lat/long boundaries of each data set.
 
 
After building and installing that program, we can change directory to the desired data set and create the dsp.  We enter the desired base name of the image (we choose the unique data set base name)  and use the '--chop' option to minimize the dsp's vertical height to the default one meter below the lowest height in the data set. Note the program will do all the work for us with the options shown:
 
 
 
$ cd /path/to/3818122.dem
 
$ sdtsdem2asc 3814CATD.DDF --base=3818122 --chop
 
 
 
The resulting default png file (but cropped) is shown below.
 
 
 
[[Image:381822-az35-el25.png]]
 

Please note that all contributions to BRL-CAD may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see BRL-CAD:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)
Retrieved from "https://brlcad.org/wiki/DSP"