Click her to go to 'Figures/Overheads' section.
Click here to return to course outline.
Click here to return to W.R. Church's home page.
Click here to return to Earth Science course list.
DXF Vector to Raster Conversion Autocad vector geological maps drawn by a geologist on the basis of point data contained in the Fieldlog database can be converted to Idrisi raster images by: 1) outputting the vector map as a filtered .DXF vector file; 2) importing the .DXF file into to IDRISI as a vector polyline file; and 3) converting the vector image to a raster image using the IDRISI vector to raster conversion routine. Alternatively, the whole map generation process can be left to the computer software with minimal input on the part of the geologist/geophysicist by: 1) outputting the point data as an xyz.txt file (x and y being the coordinates and `z' the geographic identifier), accompanied by a `statnum' `Z' attribute file (stz.txt to be renamed stz.val); 2) converting the xyz.txt file to an IDRISI vector file; and 3) creating the raster image with the INTERPOLATION routine using the attribute values file option. In using both methods, the exercise will serve to underline the role of the geologist/geophysicist in the interpretation procedure, as compared to leaving all choices to the computer software. Procedure It is assumed that a geological map showing the relative distribution of units of granite, diabase, sandstone and limestone has already been drawn and stored as flyourinitials.dwg in c:\flyourinitials. Start Autocad and load the Autocad flyourinitials.dwg drawing file. ************************************************************************** Selecting a rectangular section of a map to output Open the .dwg geological map you created earlier from the Fieldlog dataset, and outline the area to be preserved with a rectangle drawn with the DRAW RECTANGLE command. Enter the ERASE command prompt and type ALL at the select objects prompt. Next, do not hit the ENTER key but type R (for remove entities not to be erased), and then CROSSING. Drag the `crossing rectangle' to just fit your bounding rectangle, and press `ENTER'. All entities outside the rectangle that are not connected to entities inside the rectangle will be erased. Enter the TRIM command and in response to `Select cutting edges(s)... Select objects' , click on the rectangle boundary as the cutting edge and press ENTER. At the `select objects to trim' prompt, type F for FENCE and draw a line around the outside edge of the rectangle as close to the rectangle as you can without crossing the rectangle boundary, and press ENTER. (The Fence does not have to be closed - it could be just a single straight line - but should cross all the lines to be erased. If all the lines do not get erased, type F again and repeat the operation. You may have to carry out this operation several times.) If you have removed parts of polygons with the trim operation it will be necessary to use BPOLY to re-define the polygons affected. [Note: The same result can be obtained using the module `section.lsp' written by Bob Jones. Enter `appload section.lsp' at the command line, followed by the command SCB (erase and trim outside a specified border and leave the border); SC (erase and trim but do not draw a border; or SCD (erase all entities inside the border)]. ***************************************************************************************** 1) Exporting the .DXF file Start the DXFOUT command from the FILES EXPORT menu, select your directory (flyourinitials - only two lettersfor your initials, please!, e.g. flml) and define the file name (yourinitialsts1), type E at the `enter decimal place...' prompt, and type 'FILTER (must include the ' ) to grab only the entities that you want. The Filter menu will appear. Click the filter box and scroll down to and select LAYER. Scroll and click the layers you wish to output, ie, granite, diabase, sandstone and limestone ONLY. Click the Add to list button, and then the APPLY button. In response to the Select option, enter `all' and press ENTER four times. A DXF file will be created including only the data referenced in the Layer Filter option. This file can now be imported into IDRISI. Importing the DXF file into IDRISI Load IDRISI and set the ENVIRON to `c:\flyourinitials', your directory. Make work symbol files (click DISPLAY-Symbol Workshop-Files-New) for `line' to correspond to the Acad palette 1-red, 2-dark blue, 3-yellow, 4 - light blue (cyan). Name the file `acadln' and save it to your local work file `c:\yourintitals'. Also create a `polygon' symbol file using a hatched fill, and save as `acadpl' (Note that selecting `transparent' as the fill option is equivalent to displaying a `polygon' object only in outline, as if it were a `polyline' object Import `yourinitialsts1.dxf' using DXFIDRIS in FILES-IMPORT-DESKTOP PUBLISHING FORMATS. Select DXFTOIDRIS , give the DXF file name and `Continue'. In the following menu box, click the `Polyline' button and name the output file `yourinitialsts1pl'; click the Z-value button (can also use colour or Name as the attribute identifier), and enter `plane', `meters', and `1' in the relevant projection reference boxes. ***************************************************************************************** (If you select Name as the attribute location, you will be given the opportunity to change the attribute number of the polyline entities according to the LAYER name, but with the first entity (e.g. Granite) given the default value of 1. Note that IDRISI imports DXF polygons as polylines rather than as polygons (even although the resulting vector file has the structure of a polygon file!) and that therefore the corresponding symbol palette is a `line' palette. To convert the vector file to a polygon image, change the `Object type' in the corresponding document file from `line' to `polygon'.) **************************************************************************************** Display the image `yourinitialsts1pl' using the acadln symbol palette. Because the boundaries of adjacent objects overlie oneanother, the colours of the lines in the image are not significant. To fill the vector objects with a colour, fetch the document file of the vector image and change the `Object type' from `line' to `polygon'. Redisplay the vector image using the `acadpl' palette. Converting the Vector image to a Raster image Select INITIAL in the DATA ENTRY menu, followed by 'Define spatial parameters individually', and name the output image `yourintitialsts1in'. Click CONTINUE. In the subsequent reference parameters menu, enter, e.g. 512x512 for the number of columns and rows, and the values for the Min Max coordinate values. (Check the DOCUMENT file for these values and make them slightly smaller and slightly larger than the actual MIN and Max values, respectively, reported in the DOCUMENT file; that is, make the dimensions those of a rectangle drawn around your Autocad vector file `yourinitialsts1pl'. Enter m for value units and 1 for unit distance. Click OK. COPY `yourinitialsts1in' to `yourinitialsts1r1' (so that `yourinitialsts1in' is preserved as a base file for other vector to raster operations). Use POLYRAS in REFORMAT, RASTER/VECTOR CONVERSION to convert the vector image to a raster image, and enter `yourinitialsts1pl' as the vector polygon file name and `yourinitialsts1r1' as the image to be updated, that is the file created with INITIAL. Click OK. After the conversion is complete (follow the comment line at the bottom right of the screen), display the image file `yourinitialsts1r1'. The raster image can then be overlaid with the `yourinitialsts1pl' vector file using the standard symbol palette rather than acadpl (so that the lines have a different colour to the polygon fill).
FIGURES
RETURN TO:
Click here to return to beginning.
Click here to return to course outline.