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 | |
| 14 | To 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 |
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 | |