CoordinateSystem Property
CoordinateSystem returns or sets the coordinate system for the map, layer, or grid. An options string can be specified in the script. The string consists of comma-separated parameters, which specify the behavior of the various coordinate system options.
Syntax
object. CoordinateSystem
object. CoordinateSystem = CoordinateSystem
Parameter |
Type |
Description |
CoordinateSystem |
String |
Specifies the coordinate system by name, token, or WKT string. |
To create a custom local coordinate system use the options below. When using a WKT (Well-Known Text) string, if you wish to create a custom local coordinate system, use the specification "SURFER_LOCAL_CS".
Option | Description |
Custom Name | Specifies a custom name for the coordinate system. Required to use a predefined unit or to specify the units per meter. |
UNIT | This specifies the units by name and value. Name can be any predefined name, otherwise specify a custom name and use a value for the units. |
X_Offset | This specifies the X offset value. UNIT must have either a predefined name, or a custom name and a non-0 units per meter value. |
Y_Offset | This specifies the Y offset value. UNIT must have either a predefined name, or a custom name and a non-0 units per meter value. |
Remarks
Specify a predefined coordinate system by name by using the coordinate system name from the Assign Coordinate System dialog.
Specify a predefined coordinate system by token by using the token string from the system.gsj file in the Surfer program files directory.
Specify a coordinate system by a WKT (Well-Known Text) string. See the OpenGIS Implementation Specification for Geographic information - Simple feature access - Part 1: Common architecture document at http://www.opengeospatial.org/standards/sfa for more information on using WKT strings to specify a coordinate system. To use quotes in a string, use two double quotes ("this is a string that has a ""quoted string"" in it").
Example 1
The following example specifies a contour layer coordinate system using a predefined coordinate system name.
ContourLayer.CoordinateSystem = "World Geodetic System 1984"
Example 2
The following example sets the map coordinate system to unreferenced using the token name.
MapFrame.CoordinateSystem = "UNREF"
Example 3
The following example sets a grid coordinate system using a WKT string.
Grid.CoordinateSystem = "PROJCS[""NAD83 / BC Albers""," + _
"GEOGCS[""NAD83"", " + _
" DATUM[""North_American_Datum_1983"", " + _
" SPHEROID[""GRS 1980"", 6378137.0, 298.257222101, AUTHORITY[""EPSG"",""7019""]], " + _
" TOWGS84[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], " + _
" AUTHORITY[""EPSG"",""6269""]], " + _
" PRIMEM[""Greenwich"", 0.0, AUTHORITY[""EPSG"",""8901""]], " + _
" UNIT[""degree"", 0.017453292519943295], " + _
" AXIS[""Lon"", EAST], " + _
" AXIS[""Lat"", NORTH], " + _
" AUTHORITY[""EPSG"",""4269""]], " + _
"PROJECTION[""Albers_Conic_Equal_Area""], " + _
"PARAMETER[""central_meridian"", -126.0], " + _
"PARAMETER[""latitude_of_origin"", 45.0], " + _
"PARAMETER[""standard_parallel_1"", 50.0], " + _
"PARAMETER[""false_easting"", 1000000.0], " + _
"PARAMETER[""false_northing"", 0.0], " + _
"PARAMETER[""standard_parallel_2"", 58.5], " + _
"UNIT[""m"", 1.0], " + _
"AXIS[""x"", EAST], " + _
"AXIS[""y"", NORTH], " + _
"AUTHORITY[""EPSG"",3005]]"
Example 4
This example sets a contour layer to use a custom unreferenced local system using meters for the units.
ContourLayer.CoordinateSystem = "SURFER_LOCAL_CS [ ""Local Meters"", UNIT[""METERS""]]"
Example 5
The following example sets a contour layer to use a custom local system with 1234 units per meter, an X offset of -5 and Y offset of 10.
ContourLayer.CoordinateSystem = "SURFER_LOCAL_CS [ ""Custom CS Name"", UNIT[""Custom Name"", 1234], X_OFFSET[""-5""], Y_OFFSET[""10""]]"
Used by: Grid Object, Layer Object, MapFrame Object