| 49 | |
| 50 | --------- |
| 51 | To add a zero-level area to a map (ie sea level): |
| 52 | |
| 53 | In GRASS: |
| 54 | {{{ |
| 55 | # Restrict active region to area you're interested in - must use eastings/northings, lat/long seems to have problems determining valid values |
| 56 | g.region n=601000 e=451000 s=579000 w=389000 |
| 57 | |
| 58 | # Check region is restricted correctly |
| 59 | g.region -gb |
| 60 | |
| 61 | # Create vector map of active region, output param is name of output map |
| 62 | v.in.region output=v_sealevel |
| 63 | |
| 64 | # Convert vector map to raster map |
| 65 | v.to.rast input=v_sealevel output=r_sealevel use=val value=0.0 |
| 66 | |
| 67 | # Create raster maps for areas with OS data as first line only in section above |
| 68 | r.in.gdal -e input=/data/aegean1/nextmap_dems/neodc/by_tile/by_product/dsm/ny/ny98/ny98dsm/w001001.adf output=ny98 |
| 69 | r.in.gdal -e input=/data/aegean1/nextmap_dems/neodc/by_tile/by_product/dsm/ny/ny99/ny99dsm/w001001.adf output=ny99 |
| 70 | ... |
| 71 | |
| 72 | # Patch raster maps together as section above |
| 73 | # NOTE SEA LEVEL MAP MUST BE LAST IN LIST, since Grass starts with a blank map and adds patched raster maps in order |
| 74 | r.patch input=ny98,ny99,...,r_sealevel output=map_with_added_sea_level |
| 75 | |
| 76 | # Create DEM from raster map as section above |
| 77 | r.out.ascii input=map_with_added_sea_level output=/tmp/map_with_added_sea_level.dem null=0 |
| 78 | }}} |