| 5 | | load arc files into grass |
| 6 | | * import->raster->gdal |
| 7 | | * pick file |
| 8 | | * choose create new location if this is the first import |
| 9 | | * run (will fail for UK as it needs user input) |
| 10 | | * copy and paste command into grass shell so you can respond (e.g. `r.in.gdal -e input=/data/aegean1/nextmap_dems/neodc/by_tile/by_product/dsm/nk/nk02/nk02dsm/w001001.adf output=nk02` |
| 11 | | * if you need to import multiple rasters, you can use the location created, but must select extend region |
| 12 | | * (need to figure out how to join rasters into one, then subset in grass) |
| 13 | | |
| 14 | | export as ASCII grid |
| | 5 | NextMAP DEMs are supplied in Arc format. To do the conversion, we use GRASS, though other tools will probably work fine too. Basic process is: |
| | 6 | * load in the tiles you need |
| | 7 | * patch them together, adding zero levels if necessary |
| | 8 | * output as ASCII |
| | 9 | * add the azgcorr header line (manually or by script) |
| 18 | | The azgcorr format is plain ASCII text, with decimal numbers separated by spaces, one row per row of the DEM. At the top of the file, you need a single line that describes the geographic position of the DEM. |
| | 15 | {{{ |
| | 16 | # read in a couple of tiles |
| | 17 | r.in.gdal -e input=/data/aegean1/nextmap_dems/neodc/by_tile/by_product/dsm/tl/tl17/tl17dsm/w001001.adf output=tl17 |
| | 18 | r.in.gdal -e input=/data/aegean1/nextmap_dems/neodc/by_tile/by_product/dsm/tl/tl17/tl17dsm/w001001.adf output=tl27 |
| | 19 | # set the region of interest to the (two) tiles we want to export |
| | 20 | g.region rast=tl17,tl27 |
| | 21 | # patch them together into a single raster |
| | 22 | r.patch input=tl17,tl27 output=tl17and27 |
| | 23 | # write out as an ASCII DEM (needs editing as below) |
| | 24 | r.out.ascii input=tl17and27 output=/tmp/tl17and27.dem null=0 |
| | 25 | }}} |
| | 26 | |
| | 27 | Then run the demheaderconvert.sh script or manually edit the DEM file to include an azgcorr header (or you can specify this on the command line if you prefer). |
| | 28 | |
| | 29 | |
| | 30 | == Adding the azgcorr header == |
| 44 | | ---------- |
| 45 | | = Command line method = |
| 46 | | Starting from a valid location (in correct projection?) |
| 47 | | |
| 48 | | {{{ |
| 49 | | # read in a tile |
| 50 | | r.in.gdal -e input=/data/aegean1/nextmap_dems/neodc/by_tile/by_product/dsm/tl/tl17/tl17dsm/w001001.adf output=tl17 |
| 51 | | # set the region of interest to the (two) tiles we want to export |
| 52 | | g.region rast=tl17,tl27 |
| 53 | | # patch them together into a single raster |
| 54 | | r.patch input=tl17,tl27 output=tl17and27 |
| 55 | | # write out as an ASCII DEM (needs editing as above) |
| 56 | | r.out.ascii input=tl17and27 output=/tmp/tl17and27.dem null=0 |
| 57 | | }}} |
| 58 | | |
| 59 | | (then remember to run the demheaderconvert.sh script). |
| | 86 | |
| | 87 | |
| | 88 | == GRASS GUI method == |
| | 89 | |
| | 90 | (brief description) |
| | 91 | |
| | 92 | load arc files into grass |
| | 93 | * import->raster->gdal |
| | 94 | * pick file |
| | 95 | * choose create new location if this is the first import |
| | 96 | * run (will fail for UK as it needs user input) |
| | 97 | * copy and paste command into grass shell so you can respond (e.g. `r.in.gdal -e input=/data/aegean1/nextmap_dems/neodc/by_tile/by_product/dsm/nk/nk02/nk02dsm/w001001.adf output=nk02` |
| | 98 | * if you need to import multiple rasters, you can use the location created, but must select extend region |
| | 99 | * (need to figure out how to join rasters into one, then subset in grass) |
| | 100 | |
| | 101 | export as ASCII grid, manually add header as above |
| | 102 | |
| | 103 | [you can load this grid into ENVI to test against vector layers, etc - file->open external->generic->ascii, then georeference (edit headers->mapinfo, etc)] |