Changes between Version 4 and Version 5 of Help/DEM_scripts


Ignore:
Timestamp:
Feb 9, 2012, 2:26:47 PM (13 years ago)
Author:
adbe
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Help/DEM_scripts

    v4 v5  
    1111=== GRASS GIS ===
    1212GRASS is a GIS (Geograohic Information System) and details of it can be found at: http://grass.fbk.eu/. There is a detailed api and usage guide, it is available for free download at: http://grass.fbk.eu/download/index.php, as the scripts are written to run on linux, depending on your build of fedora run the following to install grass, the scripts use grass63 by default:
    13   *  {{{sudo yum install grass}}}
    14   *  {{{sudo apt-get install grass}}}
    15 To get started download the template grass database: [attachment:grass_db_template]
     13
     14To get started download the template grass database: [attachment:grass_db_template.zip]
     15  *  Run the command: {{{unzip grass_db_template.zip}}}
     16  *  To check that the grass download works run: grass63 -text grass_db_template/UKBNG/PERMANENT/
     17    *  If it did not work successfully check the grass version that you have and the path to the grass template database
     18    *  If it did work successfully press Ctrl-D or type exit to exit
    1619
    1720=== Creating a DEM from ASTER data using ''asterdem.sh'' script ===
     
    6467  *  http://www.ordnancesurvey.co.uk/oswebsite/gps/docs/OSTN02_OSGM02files.zip
    6568  *  Once the file has been downloaded run the command: {{{mkdir OSTN02_OSGM02files; unzip OSTN02_OSGM02files.zip -d OSTN02_OSGM02files}}}
    66   * 
     69  *  Now run: {{{grass63 -text /PATH/TO/grass_db_template/UKBNG/PERMANENT/}}}
     70  *  Grass should have opened if it did not look at the section above on Grass GIS
     71  *  First get the region that is going to be read in:
     72     *  {{{r.in.xyz input=OSTN02_OSGM02_GB.txt output=OSTN02_OSGM02_GB.txt x=2 y=1 z=6 fs="," --overwrite -s}}}
     73        *  This should return:
     74            ||Range:||min       ||max          ||
     75            ||x:    ||0.000000  ||700000.000000||
     76            ||y:    ||1.000000  ||876951.000000||
     77            ||z:    ||-81.603000||0.000000     ||
     78     *  Then actually set the region based on this, include a buffer size of 1 metre, resolution is 1000 for this file:
     79        {{{g.region e=700001 w=-1 n=876952 s=0 res=1000}}}
     80     *  Now read in the separation file:
     81        {{{r.in.xyz input=OSTN02_OSGM02_GB.txt output=OSTN02_OSGM02_GB.txt x=2 y=1 z=6 fs="," --overwrite}}}
     82     *  Now to check that the reading in of the file has worked run:
     83        {{{gis.m}}}
     84        *  In the manager click on "Add raster layer"
     85        *  Then click on "Base map" and select "OSTN02_OSGM02_GB.txt"
     86        *  In the "Map Display" click on "Redraw all layers".
     87        *  You should now see the raster map that has been read in
     88     *  Now the separation file has been read in a separation DEM can be created
     89        *  The raster map can be output to a file with the following command:
     90           {{{r.out.gdal input=OSTN02_OSGM02_GB.txt output=uk_separation_file_UKBNG.dem format=ENVI type=Float32 nodata=0 --overwrite}}}[[BR]]
     91           {{{rm -f uk_separation_file_UKBNG.dem.aux.xml}}}
     92        *  This DEM can be used as a separation file when projecting from osgb36 UKBNG to wgs84 lat/lon, however, we want it for projecting the other way. The DEM we have created here can be used later for use with the LiDAR, so do not remove it.
     93     *  To project the DEM:
     94        *  First we need to get a vector representing the entire region of the DEM:
     95           {{{v.in.region output=total_reg type=area --overwrite}}}
     96        *  Then to get the resolution projected:
     97           *  Save the so that we can get back here
     98              {{{g.region save=actualregion --overwrite}}}
     99           *  Set the region to the the bottom left corner based on the resolution:
     100              {{{g.region n=s+`echo \`g.region -p | grep nsres\` | awk '{print $2}'` e=w+`echo \`g.region -p | grep ewres\` | awk '{print $2}'`}}}
     101           *  Create a vector box based on the resolution:
     102              {{{v.in.region output=vector_box_res type=area --overwrite}}}
     103           *  Reset the region:
     104              {{{g.region actualregion}}}
     105        * 
     106           
     107
     108
     109
     110
     111
     112
     113
     114
     115
    67116
    68117