| User Opinions |
|
No users have voted.
|
|
Thank you for rating this answer.
|
You can subsitute the data in an area of one grid with data from a second grid by blanking the area of interest in the first grid, converting the blanking value to a new number, then use Grid Math to subsitute the new number with the data from the second grid. For example, you can replace the data inside a lake boundary of a DEM file with bathymetric data.
These are the steps:
1. Make sure the second grid has the exact same grid extents and resolution as the first grid. If it does not, I suggest going to Grid | Data and regridding the data. In the Grid Data dialog, in the Grid Line Geometry section, set the X and Y Minimum and Maximum values and # of lines so that they are exactly the same as the first grid file. Click OK to create the new grid file.
2. Then, blank the area you want to replace in the first file. The first step is to create a BLN file of the boundary. If you already have the boundary in BLN format, you can go to the next paragraph. If you have the boundary in another vector format (ie. DXF, SHP, etc), you can use Map | Base Map to create a base map of the boundary, turn off the axes in the Object Manager, and use File | Export to export to a BLN file. If you need to create the BLN file from scratch, you can do this by creating a contour map of the grid file, right clicking over the map and going to Digitize. Click in a clockwise or counter-clockwise direction around the area of interest. For each click, the XY coordinates of that location will be entered in a text editor window. Copy the first set of coordinates and paste it to the bottom of the list to "close" the area and go to File | Save As and save it to a BLN file.
Once you have the area in BLN format, go to Grid | Blank, select the first grid file and click Open, select the BLN file and click Open, then specify a new name for the blanked grid file and click Save. The new blanked grid file will be created.
3. Next, convert the blanked nodes to 0 (or some other unique value). To do this, follow the instructions here: http://www.goldensoftware.com/activekb/questions/450
4. Lastly, use Grid | Math to subsitute the 0 (or whatever unique value you used in Step 3 above) in the blanked grid file with the data from the second grid grid. Go to Grid | Math, select the grid created in Step 3 above and click Open. In the Grid Math dialog, click the open folder icon to the right of Input Grid File B, select the second grid file and click Open. Then enter the function: C = if(A=0, B, A). Replace the 0 in the function with the unique value if you used one. Click OK and the new grid is created. This grid will have the data from the second grid file inside the boundary of the first grid file.
|