Changes between Version 5 and Version 6 of Help/DEM_scripts
- Timestamp:
- Feb 9, 2012, 2:42:06 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Help/DEM_scripts
v5 v6 78 78 * Then actually set the region based on this, include a buffer size of 1 metre, resolution is 1000 for this file: 79 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}}} 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}}} 84 82 * In the manager click on "Add raster layer" 85 83 * Then click on "Base map" and select "OSTN02_OSGM02_GB.txt" … … 87 85 * You should now see the raster map that has been read in 88 86 * 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}}} 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 88 * 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 89 * 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}}} 90 * First we need to get a vector representing the entire region of the DEM: {{{v.in.region output=vector_box type=area --overwrite}}} 96 91 * 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 * 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}}} 96 * 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}}} 106 103 107 104