|
Surfer: Converting Drawn Objects from
Page Coordinates to Map Coordinates
Surfer uses two sets of coordinates to keep
track of objects - map coordinates and page coordinates. Maps, which are
always contained within a map frame, are stored in map coordinates.
Objects drawn with the drawing tools (lines, polygons, text, etc.) are
stored in page coordinates.
Since drawn objects are anchored to the page using page coordinates,
they do not move if the map is rescaled or repositioned. It is possible, however, to convert the drawn objects into map coordinates
and overlay them into the map frame.
Maps are objects within a map frame and use map
coordinates.
Drawn objects use page coordinates.
To convert an object from page coordinates to map coordinates, export
the drawn objects to a DXF file using map coordinates, load the DXF file
as a base map, and overlay with your other maps.
Exporting drawn objects to a DXF file is a two step process. First,
export the map to a DXF file and save the map coordinates. Next, export
the drawn objects to a DXF file using the saved coordinates.
Step-by-step procedure
- Click on the map to select it. The status bar should then
indicate that a single map is selected.
- Choose the File | Export menu command.
- Specify a DXF file name in the Export dialog box.
- Click the check box to enable the Selected objects only
option.
- Click the Save button.
Select the map, choose
File | Export, specify a DXF
file name, enable the Selected objects only check box, and click
Save.
- In the AutoCAD DXF Export dialog box,
make sure the Scaling
source is set to Application.
- Verify that the coordinates in the DXF Rectangle section are
different than those in the Page Rectangle section.
- Click the check box to enable the Save scaling info option.
- Click OK.
When exporting the map to a DXF file, verify that
the Scaling source is set to Application, and click the check box to
Save scaling info.
- In the plot window, deselect the map and select all the drawn
objects using the Edit | Invert Selection menu command.
- Choose the File | Export menu command.
- Specify the DXF file name in the Export dialog box.
- Click the check box to enable the Selected objects only
option.
- Click the Save button.
- In the AutoCAD DXF Export dialog box, verify that the Scaling
source is set to Saved.
- Verify that the coordinates in the DXF Rectangle section are
different than those in the Page Rectangle section.
- Click OK.
When exporting the drawn objects to a DXF file,
change the Scaling source to Saved.
- Load the DXF file as a base map.
- Select the maps (Edit | Select All) and choose Map |
Overlay Maps.
Automating the process
A rudimentary script to automate this process has been written and is
available for download from www.goldensoftware.com/public/scripts/surfer7/Export2Base.BAS.
It handles the case where there is one map frame, and all drawn objects
are to be converted. For more complicated situations, this script could
serve as the starting point for further development.
Back
to Newsletter Index
|