Changes between Version 6 and Version 7 of Help/DEM_scripts


Ignore:
Timestamp:
Feb 9, 2012, 4:14:23 PM (12 years ago)
Author:
adbe
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Help/DEM_scripts

    v6 v7  
    1313
    1414To get started download the template grass database: [attachment:grass_db_template.zip]
    15   *  Run the command: {{{unzip grass_db_template.zip}}}
     15  *  Run the command:
     16     *  {{{unzip grass_db_template.zip}}}
    1617  *  To check that the grass download works run: grass63 -text grass_db_template/UKBNG/PERMANENT/
    1718    *  If it did not work successfully check the grass version that you have and the path to the grass template database
     
    6667If projecting the aster data to another projection with a differing elevation model a separation file needs to be used to elevate the aster correctly. For example if projecting the DEM to a osgb36 UKBNG projection from wgs84 lat/lon the elevation model is different. To elevate the aster we need a description of the height differences between the geoid and the spheroid, a file describing the differences between the two can be found at:
    6768  *  http://www.ordnancesurvey.co.uk/oswebsite/gps/docs/OSTN02_OSGM02files.zip
    68   *  Once the file has been downloaded run the command: {{{mkdir OSTN02_OSGM02files; unzip OSTN02_OSGM02files.zip -d OSTN02_OSGM02files}}}
    69   *  Now run: {{{grass63 -text /PATH/TO/grass_db_template/UKBNG/PERMANENT/}}}
     69  *  Once the file has been downloaded run the command:
     70     *  {{{mkdir OSTN02_OSGM02files; unzip OSTN02_OSGM02files.zip -d OSTN02_OSGM02files}}}
     71  *  Now run:
     72     *  {{{grass63 -text /PATH/TO/grass_db_template/UKBNG/PERMANENT/}}}
    7073  *  Grass should have opened if it did not look at the section above on Grass GIS
    7174  *  First get the region that is going to be read in:
     
    7780            ||z:    ||-81.603000||0.000000     ||
    7881     *  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: {{{r.in.xyz input=OSTN02_OSGM02_GB.txt output=OSTN02_OSGM02_GB.txt x=2 y=1 z=6 fs="," --overwrite}}}
    81      *  Now to check that the reading in of the file has worked run: {{{gis.m}}}
    82         *  In the manager click on "Add raster layer"
    83         *  Then click on "Base map" and select "OSTN02_OSGM02_GB.txt"
    84         *  In the "Map Display" click on "Redraw all layers".
    85         *  You should now see the raster map that has been read in
     82        *  {{{g.region e=700001 w=-1 n=876952 s=0 res=1000}}}
     83     *  Now read in the separation file:
     84        *  {{{r.in.xyz input=OSTN02_OSGM02_GB.txt output=OSTN02_OSGM02_GB.txt x=2 y=1 z=6 fs="," --overwrite}}}
     85     *  Now to check that the reading in of the file has worked run:
     86        *  {{{gis.m}}}
     87           *  In the manager click on "Add raster layer"
     88           *  Then click on "Base map" and select "OSTN02_OSGM02_GB.txt"
     89           *  In the "Map Display" click on "Redraw all layers".
     90           *  You should now see the raster map that has been read in
    8691     *  Now the separation file has been read in a separation DEM can be created
    87         *  The raster map can be output to a file with the following command: {{{r.out.gdal input=OSTN02_OSGM02_GB.txt output=uk_separation_file_UKBNG.dem format=ENVI type=Float32 nodata=0 --overwrite}}}[[BR]]{{{rm -f uk_separation_file_UKBNG.dem.aux.xml}}}
     92        *  The raster map can be output to a file with the following command:
     93           *  {{{r.out.gdal input=OSTN02_OSGM02_GB.txt output=uk_separation_file_UKBNG.dem format=ENVI type=Float32 nodata=0 --overwrite}}}
     94           *  {{{rm -f uk_separation_file_UKBNG.dem.aux.xml}}}
    8895        *  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.
    8996     *  To project the DEM:
    90         *  First we need to get a vector representing the entire region of the DEM: {{{v.in.region output=vector_box type=area --overwrite}}}
     97        *  First we need to get a vector representing the entire region of the DEM:
     98           *  {{{v.in.region output=vector_box type=area --overwrite}}}
    9199        *  Then to get the resolution projected:
    92            *  Save the region so that we can get back here: {{{g.region save=actualregion --overwrite}}}
    93            *  Set the region to the the bottom left corner based on the resolution: {{{g.region n=s+`echo \`g.region -p | grep nsres\` | awk '{print $2}'` e=w+`echo \`g.region -p | grep ewres\` | awk '{print $2}'`}}}
    94            *  Create a vector box based on the resolution: {{{v.in.region output=vector_box_res type=area --overwrite}}}
    95            *  Reset the region: {{{g.region actualregion}}}
     100           *  Save the region so that we can get back here:
     101              *  {{{g.region save=actualregion --overwrite}}}
     102           *  Set the region to the the bottom left corner based on the resolution:
     103              *  {{{g.region n=s+`echo \`g.region -p | grep nsres\` | awk '{print $2}'` e=w+`echo \`g.region -p | grep ewres\` | awk '{print $2}'`}}}
     104           *  Create a vector box based on the resolution:
     105              *  {{{v.in.region output=vector_box_res type=area --overwrite}}}
     106           *  Reset the region:
     107              *  {{{g.region actualregion}}}
    96108        *  To get the DEM in another projection:
    97            *  Project the resolution vector to the wgs84 lat/lon location: {{{v.proj input=vector_box_res location=UKBNG mapset=PERMANENT output=vector_box_res --overwrite}}}
    98            *  Set the region to be the size of the vector and then set the resolution: {{{g.region vect=vector_box_res rows=1 cols=1}}}
    99            *  Project the total region vector to the wgs84 lat/lon location: {{{v.proj input=vector_box location=UKBNG mapset=PERMANENT output=vector_box --overwrite}}}
    100            *  Set the total region: {{{g.region vect=vector_box}}}
    101            *  Project the separation file to the current location: {{{r.proj input=OSTN02_OSGM02_GB.txt location=UKBNG mapset=PERMANENT output=OSTN02_OSGM02_GB.txt --overwrite}}}
    102            *  Output the separation file: {{{r.out.gdal input=OSTN02_OSGM02_GB.txt output=uk_separation_file_WGS84LL.dem format=ENVI type=Float32 nodata=0 --overwrite}}}[[BR]]{{{rm -f uk_separation_file_WGS84LL.dem.aux.xml}}}
     109           *  Project the resolution vector to the wgs84 lat/lon location:
     110              *  {{{v.proj input=vector_box_res location=UKBNG mapset=PERMANENT output=vector_box_res --overwrite}}}
     111           *  Set the region to be the size of the vector and then set the resolution:
     112              *  {{{g.region vect=vector_box_res rows=1 cols=1}}}
     113           *  Project the total region vector to the wgs84 lat/lon location:
     114              *  {{{v.proj input=vector_box location=UKBNG mapset=PERMANENT output=vector_box --overwrite}}}
     115           *  Set the total region:
     116              *  {{{g.region vect=vector_box}}}
     117           *  Project the separation file to the current location:
     118              *  {{{r.proj input=OSTN02_OSGM02_GB.txt location=UKBNG mapset=PERMANENT output=OSTN02_OSGM02_GB.txt --overwrite}}}
     119           *  Output the separation file:
     120              *  {{{r.out.gdal input=OSTN02_OSGM02_GB.txt output=uk_separation_file_WGS84LL.dem format=ENVI type=Float32 nodata=0 --overwrite}}}
     121              *  {{{rm -f uk_separation_file_WGS84LL.dem.aux.xml}}}
    103122           
    104123