HANDLING TOPOGRAPHIC MAPS: FROM SURFER TO AUTOCAD


Back to Handout's Index


HOW TO EDIT SURFER PLOTS IN AUTOCAD, AND HOW TO WORK WITH ACTUAL GRID COORDINATES IN AUTOCAD

WHY AUTOCAD AND NOT SURFER?

Autocad is a more flexible tool for editing the contour plots produced by Surfer. Surfer is not very flexible in the editing of drawings, or, more importantly, for adding other data that an archaeological map would need, such as architectural features. While Surfer is a very important tool for constructing topographic contour maps, based on the readings of the Total Station (X, Y & most importantly Z), it is not useful in plotting data that are not related to contour lines, such as walls, structures, features, whose coordinates have also been collected with a theodolite or a Total Station (X, Y & LESS importantly Z). Explanations here are set for work with a Total Station.

It is therefore recommended to move the drawings from Surfer to Autocad for the editing process.

FOREWORD

The ease and expediency to produce topographic maps in Surfer, edit them in Autocad, and then add, say, architectural features in Autocad depends on how the data was obtained with the Total Station. Therefore, a consistent and efficient use of the Total Station will greatly facilitate matters in the software manipulation of the data. Namely, the surveyors must have recorded basic data as the height of the instrument, cases when the pole was extended for readings in areas or depression or slopes, and more importantly a consistent calibration of the Station.

Calibration of the Total Station can be simple or complex. The simple procedure consists in setting the datum point, and set another fixed point at 50 or 100 m to the N, S, W or E of the datum. By using these two fixed points the surveyor will be able to set an angle 0 on the datum-100 m axis; the datum will be, by default, point X 400, Y 400 and all readings will be set according to those coordinates. In a next session the surveyor will be able to repeat the same process (by orienting 0 degrees in towards the same point) and obtain coordinates that match the previous ones (2nd day Z values could be used if height of the instrument is recorded).

The more complex procedure requires two known points in a grid in addition to the datum point (that is three known points in a pre-established grid). Calibration will consist in shooting, say, points N 400 E 350 and N 450 E 350, feeding those coordinates to the machine, while the station is set at N 400 E 400. The Total Station will then produce coordinates based on a preset grid.

ATTENTION ON COORDINATES: The Total Station can record points in a Cartesian Grid XYZ; those coordinates will correspond to E N & depth (and not N E & depth). If you want to keep the NE grid you will have to set the machine to the YXZ coordinate (or "surveying") mode. This is not really important since a simple 90 (or 180) degree rotation (in Autocad) of the contour plot can set the grid on a North orientation. Being aware of this facilitates many tasks while editing the map in Autocad.

START: SURFER stage.

1. Enter X, Y & Z data in SURFER's worksheet; save as "filename.DAT" file;

2. Produce filename.GRD (in SURFER Grid/Data)

surfergrid.jpg (47746 bytes)

1. Make sure that you have your cartesian coordinates in the correct order: data from the Total station is often in the N, E, Z form, that you will enter as A, B, C, but that corresponds to the Y, X, and Z in cartesian coordinates. In this case you should change X to column B and Y to column Y.

2. Make a note of the Xmin, Xmax, Ymin, and Ymax numbers; you will need this information in Autocad (otherwise you can get this info by clicking "Grid info" in the Map/Contour window);

3. Produce a contour plot in Map/Contour:

surfercontour.jpg (27266 bytes)

And then you get to the following screen, where you will decide on the details of the contour plot. First, it is not good to check "Fill Contours" as it will put the shades in the legend in thr plot; but is is good to check "Smooth Contours".

surferlevel1.jpg (45673 bytes)

Then it is essential to decide ferquency of the contour line intervals since you will not be able to play with contour lines in Autocad very easily. Open the "Level" column and set the interval (in m); play with this tool in Surfer to decide which is the best view to faithfully represent the topography you are plotting (see examples below):

surferlevel.jpg (42721 bytes)

Then open as well the "Label" column to decide the frequency of Z labels (in m) to be plotted - you can always erase excessive ones in Autocad; as for creating new ones in Autocad you will have a hard time getting the angle for the labels right in the middle of contour lines.

surfercontfreq.jpg (43923 bytes)

surfercontfreq.jpg (43923 bytes)

I present here two examples for two different settings:

EXAMPLE 1:  Level interval is .5 m and Label frequency is 10 (each 10 contour lines)

surferex1.jpg (37210 bytes)

EXAMPLE 2:  Level interval is .1 m and Label frequency is 5 (each five contour lines)

surferex2.jpg (58998 bytes)

 

Avoid changing in Surfer the labels on the X and Y axis; use the scale produced by default in Surfer (it is also cumbersome to make those changes in Surfer -an inflexible part of this program).

4. Once you are satisfied with the result (and after you save it as a .SRF file) you will have to export the plot as a .WMF (Windows Metafile) or as .DXF (Autocad interchange format). I have experienced several problems by using the .DXF option. It is recommended to use the .WMF option.

AUTOCAD stage

1. Open File/Import and select the .WMF file to import;

2. Your task in Autocad can take two directions now:

A. Editing the contour plot (adding the items for publication of the map); and/or,

B. Adding architectural features to the contour plots -features consisting in lines joined at X & Y points. This latter information is used only in Autocad (points for contour lines and for architectural features are two different batches of numbers) since Surfer cannot plot 2D coordinates for drawing architectural features.

In either case I suggest finishing the plot in Autocad. Explore nonetheless the options in Surfer for doing simple additions (I underline additions and not editing tasks) to your plot (like text for labels). Surfer might suffice for simple plots and for inputting simple identification elements.

If Autocad is used for editing and no further information is entered (information based on more Total Station readings) the real coordinates in Autocad (you can see these on the lower left corner of the screen) will not need to change. You might just want to edit the text coordinates on the two axis of the plot (use DDEDIT in Autocad after having used the EXPLODE command to break apart all the elements -text & lines- of the .WMF file.)

3. USING AUTOCAD FOR MORE THAN EDITING:

You will take these following steps if you have a set of features you want to plot in the contour map. The most important task here is to set the coordinates of the contour map in Autocad to the scale represented in the original Surfer plot. Only when this is done can the architectural features be plotted properly.

Three steps are needed:

1. Change the coordinate system in Autocad

This is essential for using the X & Y data for architectural features. Get the info on X min, X max, Y min and Y max for the data used in the contour plot (the plot that you created in Surfer). (Go to Surfer: Map/Contour, choose the .GRD file, and in the next window click on GRID INFO to the right of the window). Make a note of the X and Y limits of the plot. And determine, by substracting X min from X max the actual number of meters represented in the contour plot (if X min is 130 m, and X max is 268 m, then the mapped scale X axis represents 138 m; repeat the same for Y).

Now get X min, X max, Y min and Y max for the actual plot in Autocad. In most cases the distance in Autocad between X min and X max should be much less that the actual meters that you got above. Use the DIST command (and toggle Ortho -F8- on to insure you have a straight line): click first on the lower boundary, then on the upper boundary. Then press F2 to get at the Text Window and read the distance between the boundaries (Close the window with F2 again). Repeat for the distance from the left to right boundaries. [another less precise option is to just use your cursor and the coordinate display to record upper and lower boundaries, and then substract lower from upper reading.]. If X min is 1.76 and X max is 4.5, then X represents 2.74 (Autocad) units.

The next step is to get the factor by which you will have to scale (enlarge) the drawing in the Autocad screen in order to scale it to the original the units of the original contour map. Following the example above, we have 138 meters for the contour map and 2.74 units for the drawing in Autocad's screen. The factor will be 50.365, the result of 138 divided by 2.74. In other words the drawing will have to be enlarged 50.365 times in order to have the same unit scale as the actual contour plot. Proceed to use the SCALE command, enter (write) all, and enter 50.365. (then ZOOM; e  to have all the drawing in the screen; note how the coordinate scale has changed).

>Command: scale <enter>
>Select objects: all <enter>
1 found
>Select objects: <enter>
>Base point: <click anywhere on the map>
<Scale factor>/Reference: 50.365

The final step is to set in Autocad point 400,400 (the default point where the Total Station was sitting). Use the coordinates displayed in the X and Y axis of the original contour map (not the Autocad coordinates) to put your cursor on the 400,400 intersection. Enter the UCS command, type o (letter O) for origin <enter>, and click the crosshairs on the 400,400 intersection. You have just reset the coordinate system to 0,0 at the datum point (note how the coordinates scale has changed, it has negative numbers on the lower left quadrant). But we need that point to be actually 400,400. Repeat the UCS command, toggle-on the SNAP command with F9 to help you locate the cursor precisely on your 0,0 intersection, type o <enter>, type -400,-400 (use the minus sign). Again, you have just reset the coordinate system (note how the coordinate scale has changed) to the the actual grid you want and that is the same grid with which the readings with the total station were made (using 400,400 as the datum point). SAVE the drawing with the new coordinate system.

Sequence of commands:

Command: ucs <enter>
Origin/ZAxis/3point/OBject/View/X/Y/Z/Prev/Restore/Save/Del/?/<World>: o <enter>
Origin point <0,0,0>:<click on the 400,400 intesection>
Command: ucs<enter>
Origin/ZAxis/3point/OBject/View/X/Y/Z/Prev/Restore/Save/Del/?/<World>: o<enter>
Origin point <0,0,0>: -400,-400<enter>

2. Preparing a SCRIPT file for Autocad

One cumbersome way to draw those architectural features is to enter manually the coordinates of the four points that make, say, the external wall of a building. You could use the PLINE command and you should enter then the coordinates in the command line (in the form X , Y): 4.5,6 <enter> 6.5,8 <enter>, 8,9.5 <enter>, 10.5,12 <enter>, and a last <enter> to finish with the line. It might be easy for a single line, but imagine data for a few dozen structures!

You can automate the procedure by creating a file where you enter the coordinates for X and Y. It might not be a bad idea to have entered the X, Y and Z data in a worksheet (perhaps in SURFER where the Z data for the X & Y points might be useful also to prepare a more prescise contour plot; but this is just for recording purposes). From the worksheet copy all the X & Y entries into simple editor (like NOTEPAD) to produce a *.SCR (Script file) by saving it with the .SCR extension. You will then need to edit then the file. The file to draw the above wall would look like this:

pline
4.5,6
6.5,8
8,9.5
10.5,12
<end>

do not write <end> to finish the file; this is just to show that you need a blank line after listing the 4 pairs of X Y coordinates for the wall; the blank line will be read as an "enter" command. Say the 4 points represented the four corners of a house, you would want to close the line, creating a polygon by entering "c" instead of the blank line:

pline
4.5,6
6.5,8
8,9.5
10.5,12
c

Note that an important point in this task is to clearly know which points join which; in which cases there are open walls (lines) or should be closed because they represent structures. This information should be noted in the data record forms, or in a sketch of the architectural features where mapped points are pre-established , so that your task of editing the .SCR file is much easier.

You should preferably save the .SCR file in the R13 folder where Autocad resides.

(3) Feed the file with the coordinates into the contour map by going to Tools/Script and clicking on the .SCR file residing in the same folder. You will then see how Autocad takes care of drawing all those features for you.

acadrunscript.jpg (15772 bytes)


Back to Handout's Index