GXIPJ class

class GXIPJ(handle=0)

GXIPJ class.

The GXIPJ class describes a single spatial reference in the world, defined under a coordinate system, an orientation, and a warp (which can be used to distort the projected object to a particular shape or boundary).

Note:

GXIPJ objects may be attached to channels or views. Two IPJs taken together are used to create a GXPJ object, which allows for the conversion of positions from one projection to the other. See also the GXLL2 class, which creates Datum correction lookups.

See also GXPJ Converts coordinates between projections GXLL2 Creates Datum correction lookups.

add_exagg_warp(x_exag, y_exag, z_exag, x_orig, y_orig, z_orig)

Add a warp to GXIPJ to exaggerate X, Y and Z.

Parameters:
  • x_exag (float) – X exaggeration, must be > 0.0
  • y_exag (float) – Y exaggeration, must be > 0.0
  • z_exag (float) – Z exaggeration, must be > 0.0
  • x_orig (float) – X reference origin
  • y_orig (float) – Y reference origin
  • z_orig (float) – Z reference origin

New in version 5.0.

License: Geosoft Open License

add_log_warp(x, y)

Add a warp to GXIPJ to log one or both coordinantes

Parameters:
  • x (int) – Log in X?
  • y (int) – Log in Y?

New in version 7.0.

License: Geosoft Open License

add_matrix_warp(v00, v01, v02, v03, v10, v11, v12, v13, v20, v21, v22, v23, v30, v31, v32, v33)

Add a warp to GXIPJ using a matrix

Parameters:
  • v00 (float) – Row 0 Element 0
  • v01 (float) – Row 0 Element 1
  • v02 (float) – Row 0 Element 2
  • v03 (float) – Row 0 Element 3
  • v10 (float) – Row 1 Element 0
  • v11 (float) – Row 1 Element 1
  • v12 (float) – Row 1 Element 2
  • v13 (float) – Row 1 Element 3
  • v20 (float) – Row 2 Element 0
  • v21 (float) – Row 2 Element 1
  • v22 (float) – Row 2 Element 2
  • v23 (float) – Row 2 Element 3
  • v30 (float) – Row 3 Element 0
  • v31 (float) – Row 3 Element 1
  • v32 (float) – Row 3 Element 2
  • v33 (float) – Row 3 Element 3

New in version 7.0.

License: Geosoft Open License

add_warp(type, vv_x_old, vv_y_old, vv_x_new, vv_y_new)

Add a warp to GXIPJ.

Parameters:

New in version 5.0.

License: Geosoft Open License

Note: There must be at least “warp type” points in the warp point GXVV‘s. All point GXVV‘s must have the same number of points. If there are more points than required by the warp, the warp will be determined by least-square fitting to the warp surface for all but the 4-point warp. The 4-point ward requires exactly 4 points.

Cannot be used with WARP_MATRIX or WARP_LOG

clear_coordinate_system()

Clear coordinate sytsem, except for units

New in version 7.2.

License: Geosoft Open License

Note: Clears the Datum, Local Datum and Projection info. Leaves units, any warp or orientation warp unchanged.

clear_orientation()

Clear an orientation warp from an GXIPJ.

New in version 5.1.6.

License: Geosoft Open License

clear_warp()

Clear warp parameters (if any) from an GXIPJ.

New in version 5.0.

License: Geosoft Open License

compare_datums(ipj2)

Compare the datums of two coordinate systems?

Parameters:ipj2 (GXIPJ) – GXIPJ 2
Returns:0 - Datums are different 1 - Datums are the same, but different LDT 2 - Datums and LTD are the same
Return type:int

New in version 6.2.

License: Geosoft Open License

Note: To transform between different datums requires the use of a local datum transform. The local datum transform can be defined when a coordinate system is created, but the definition is optional. This function will test that the local datum transforms are defined. Note that a coordinate transformation between datums without a local datum transform is still possible, but only the effect of ellipsoid shape will be modelled in the transform.

convert_orientation_warp_vv(vv_x, vv_y, vv_z, f_forward)

Convert X,Y and Z VVs using the orientation warp from an GXIPJ.

Parameters:
  • vv_x (GXVV) – X GXVV coordinates converted on output
  • vv_y (GXVV) – Y GXVV coordinates converted on output
  • vv_z (GXVV) – Z GXVV coordinates converted on output
  • f_forward (int) – 1 - Forward (raw -> coordinate) , 0 - (coordinate -> raw)

New in version 6.4.

License: Geosoft Open License

convert_warp(x, y, z, f_forward)

Converts a point X, Y, Z to the new GXIPJ plane.

Parameters:
  • x (float_ref) – X coordinates converted on output
  • y (float_ref) – Y coordinates converted on output
  • z (float_ref) – Z coordinates converted on output
  • f_forward (int) – 1 - Forward (raw -> coordinate) , 0 - (coordinate -> raw)
Returns:

0 if ok - 1 otherwise

Return type:

int

New in version 6.3.

License: Geosoft Open License

convert_warp_vv(vv_x, vv_y, f_forward)

Converts a set of X & Y VVs to the new GXIPJ plane. The Z is assumed to be 0

Parameters:
  • vv_x (GXVV) – X GXVV coordinates converted on output
  • vv_y (GXVV) – Y GXVV coordinates converted on output
  • f_forward (int) – 1 - Forward (raw -> coordinate) , 0 - (coordinate -> raw)
Returns:

0 if ok - 1 otherwise

Return type:

int

New in version 6.3.

License: Geosoft Open License

coordinate_systems_are_the_same(ipj2)

Are these two coordinate systems the same?

Parameters:ipj2 (GXIPJ) – GXIPJ 2
Returns:0 - No 1 - Yes
Return type:int

New in version 7.2.

License: Geosoft Open License

Note: This does not compare LDT information (use compare_datums for that).

coordinate_systems_are_the_same_within_a_small_tolerance(ipj2)

Same as coordinate_systems_are_the_same, but allows for small numerical differences

Parameters:ipj2 (GXIPJ) – GXIPJ 2
Returns:0 - No 1 - Yes
Return type:int

New in version 7.2.

License: Geosoft Open License

copy(ip_jd)

Copy IPJs

Parameters:ip_jd (GXIPJ) – Destination GXIPJ

New in version 5.0.

License: Geosoft Open License

copy_projection(ip_jd)

Copy the projection from one GXIPJ to another

Parameters:ip_jd (GXIPJ) – Source

New in version 7.0.

License: Geosoft Open License

Note: Copies the projection parameters, while leaving the rest (e.g. Datum, Local Datum Transform) unchanged.

classmethod create()

This method creates a projection object.

Returns:GXIPJ Object
Return type:GXIPJ

New in version 5.0.

License: Geosoft Open License

classmethod create_s(bf)

Create GXIPJ from serialized source.

Returns:GXIPJ Object
Return type:GXIPJ

New in version 5.0.

License: Geosoft Open License

classmethod create_xml(file)

Create an GXIPJ from serialized Geosoft MetaData XML file

Parameters:file (str) – File Name
Returns:GXIPJ Object
Return type:GXIPJ

New in version 7.0.

License: Geosoft Open License

get_3d_matrix_orientation(v00, v01, v02, v03, v10, v11, v12, v13, v20, v21, v22, v23, v30, v31, v32, v33)

Gets the coefficients of a 3D matrix orientation.

Parameters:

New in version 8.5.

License: Geosoft Open License

get_3d_view(x, y, z, rx, ry, rz, sx, sy, str_val)

Get 3D orientation parameters

Parameters:

New in version 6.3.

License: Geosoft Open License

Note: The view must have a 3D orientation

get_3d_view_ex(x, y, z, rx, ry, rz, sx, sy, str_val, rotate, flags)

Get 3D orientation parameters with new flags

Parameters:

New in version 7.0.

License: Geosoft Open License

Note: The view must have a 3D orientation

get_crooked_section_view_v_vs(dist_vv, xvv, yvv, log_z)

Get the crooked section path.

Parameters:
  • dist_vv (GXVV) – Section X locations (e.g. distance along the curve)
  • xvv (GXVV) – True X
  • yvv (GXVV) – True Y
  • log_z (int_ref) – Use logarithmic Y-axis (usually for data profiles) 0:No, 1:Yes

New in version 7.2.

License: Geosoft Open License

Note: Returns the orignal VVs used to set up the crooked section path.

get_display_name(str_val)

Get a name for display purposes from GXIPJ

Parameters:str_val (str_ref) – Name returned

New in version 6.3.

License: Geosoft Open License

get_esri(esri)

Store coordinate system in an ESRI prj coordinate string

Parameters:esri (str_ref) – ESRI projection string returned

New in version 5.1.8.

License: Geosoft Open License

Note: If the projection is not supported in ESRI, the projection string will be empty.

get_gxf(str1, str2, str3, str4, str5)

Store coordinate system in GXF style strings.

Parameters:
  • str1 (str_ref) – Projection name
  • str2 (str_ref) – Datum name, major axis, elipticity
  • str3 (str_ref) – Method name, parameters
  • str4 (str_ref) – Unit name, factor
  • str5 (str_ref) – Local transform name,dX,dY,dZ,rX,rY,rZ,Scale

New in version 5.0.

License: Geosoft Open License

Note: See GXF revision 3 for string descriptions All strings must be the same length, 160 (STR_GXF) recommended. Strings too short will be truncated.

classmethod get_list(parm, datum, lst)

Get a list of parameters.

Parameters:

New in version 6.0.

License: Geosoft Open License

Note: The datum filter string, if specified, will limit the requested list to those valid for the spacified datum.

get_method_parm(parm)

Get projection method parameter

Parameters:parm (int) – IPJ_CSP constants
Returns:Parameter setting, rDUMMY if dot used
Return type:float

New in version 5.0.

License: Geosoft Open License

get_mi_coord_sys(coord, units)

Store coordinate system in MapInfo coordsys pair

Parameters:
  • coord (str_ref) – MapInfo coordsys string returned
  • units (str_ref) – MapInfo unit string returned

New in version 7.0.

License: Geosoft Open License

get_name(type, str_val)

Get an GXIPJ name

Parameters:

New in version 5.0.

License: Geosoft Open License

get_north_azimuth(x, y)

Return the azimuth of geographic North at a point.

Parameters:
  • x (float) – Input X location
  • y (float) – Input Y location
Returns:

Azimuth (degrees CW) of geographic north from grid north at a location.

Return type:

float

New in version 7.3.

License: Geosoft Open License

Note: If the GXIPJ is not a projected coordinate system then the returned azimuth is GS_R8DM;

get_orientation()

Get GXIPJ orientation in space.

Returns:IPJ_ORIENT constants
Return type:int

New in version 5.1.4.

License: Geosoft Open License

Note: Projections can be created oriented horizontally (e.g. in plan maps) or vertically (in section maps - Wholeplot and GXIP).

get_orientation_info(x, y, z, az, swing)

Get GXIPJ orientation parameters.

Parameters:

New in version 5.1.6.

License: Geosoft Open License

Note: IPJ_ORIENT_TYPE: IPJ_ORIENT_DEFAULT - no special orientation - plan view. This is equivalent to IPJ_ORIENT_PLAN with dXo = dYo = dZo = dRotation = 0.0.

IPJ_ORIENT_PLAN Azimuth = Rotation CCW degrees The plan differs from the default view in that a reference level is set, and the axes can be rotated and offset from the local X,Y.

IPJ_ORIENT_SECTION Azimuth - CW degrees from North -360 <= azimuth <= 360 Swing - degrees bottom towards viewer -90 < swing < 90 The section view projects all plotted objects HORIZONTALLY onto the viewing plan in order to preserve elevations, even if the section has a swing.

get_orientation_name(str_val)

Get a name for display purposes from GXIPJ

Parameters:str_val (str_ref) – Name returned

New in version 6.3.

License: Geosoft Open License

get_plane_equation(min_x, min_y, max_x, max_y, pitch, yaw, roll, x, y, z, sx, sy, str_val)

Get the equation of a plane

Parameters:
  • min_x (float) – Min X of surface
  • min_y (float) – Min Y of surface
  • max_x (float) – Max X of surface
  • max_y (float) – Max Y of surface
  • pitch (float_ref) – Pitch angle (between -360 and 360)
  • yaw (float_ref) – Yaw angle (between -360 and 360)
  • roll (float_ref) – Roll angles (between -360 and 360)
  • x (float_ref) – X offset of plane
  • y (float_ref) – Y offset of plane
  • z (float_ref) – Z offset of plane
  • sx (float_ref) – X scale
  • sy (float_ref) – Y scale
  • str_val (float_ref) – Z scale

New in version 5.1.6.

License: Geosoft Open License

Note: Two opposite corners of the plane are required. Because the origin of the plane does not necessarily have a stable back-projection into true 3d coordinates. In practice, use the current view extents, or the corners of a grid.

get_plane_equation2(ip_jo, min_x, min_y, max_x, max_y, pitch, yaw, roll, x, y, z, sx, sy, str_val)

Get the equation of a plane with reprojection.

Parameters:
  • ip_jo (GXIPJ) – GXIPJ object for the output values
  • min_x (float) – Min X of surface (in grid coords)
  • min_y (float) – Min Y of surface
  • max_x (float) – Max X of surface
  • max_y (float) – Max Y of surface
  • pitch (float_ref) – Pitch angle (between -360 and 360) (in view coords)
  • yaw (float_ref) – Yaw angle (between -360 and 360)
  • roll (float_ref) – Roll angles (between -360 and 360)
  • x (float_ref) – X offset of plane (in view coords)
  • y (float_ref) – Y offset of plane
  • z (float_ref) – Z offset of plane
  • sx (float_ref) – X scale (in view coords)
  • sy (float_ref) – Y scale
  • str_val (float_ref) – Z scale

New in version 6.4.1.

License: Geosoft Open License

Note: This is the same as get_plane_equation, but the input projected coordinate system (PCS) may be different from that of the GXIPJ you want the plane equation values described in. This may be required, for instance, when a 3D view has been created in one PCS, and an oriented grid from a different PCS is to be displayed in that view.

If the two input IPJs share the same PCS then the get_plane_equation function is called directly, using the input GXIPJ.

get_units(scale, str_val)

Get unit parameters

Parameters:

New in version 5.0.

License: Geosoft Open License

get_xml(str_val)

Get an Geosoft Metadata XML string from an GXIPJ

Parameters:str_val (str_ref) – XML string returned

New in version 7.0.

License: Geosoft Open License

has_projection()

Does the GXIPJ object contain a projection?

Returns:0 - No 1 - Yes
Return type:int

New in version 7.2.

License: Geosoft Open License

has_section_orientation()

Does this projection contain an orientation used by section plots?

Returns:0 - No 1 - Yes
Return type:int

New in version 8.3.

License: Geosoft Open License

Note: Returns 1 if there is a section orientation

The following orientations can be used to orient sections or section views:

IPJ_ORIENT_SECTION - Target-type sections with Z projection horizontally IPJ_ORIENT_SECTION_NORMAL - Like IPJ_ORIENT_SECTION, but Z projects perpendicular to the secton plane. IPJ_ORIENT_SECTION_CROOKED - Crooked sections IPJ_ORIENT_3D - Some Sections extracted from a voxel - e.g. VoxelToGrids, as the voxel can have any orientation in 3D.

It is sometimes important to ignore the section orientation, for instance when rendering a grid in 3D where it has been located on a plane.

is_3d_inverted()

Is this 3D View inverted ?

Returns:0 - No 1 - Yes (inverted)
Return type:int

New in version 6.3.1.

License: Geosoft Open License

is_3d_inverted_angles()

Are the angles in this 3D View inverted ?

Returns:0 - No 1 - Yes (inverted)
Return type:int

New in version 6.3.1.

License: Geosoft Open License

is_geographic()

See if this projection is geographic

Returns:0 - No 1 - Yes
Return type:int

New in version 6.3.

License: Geosoft Open License

is_null()

Check if this is a null (undefined) instance

Returns:True if this is a null (undefined) instance, False otherwise.
Return type:bool
make_geographic()

Remove a projected coordinate system from an GXIPJ

New in version 5.1.5.

License: Geosoft Open License

Note: This function does nothing if the GXIPJ is not a projected coordinate system.

make_projected(min_lon, min_lat, max_lon, max_lat)

Create a default projected coordinate system from lat-long ranges.

Parameters:
  • min_lon (float) – Minimum longitude
  • min_lat (float) – Minimum latitude
  • max_lon (float) – Maximum longitude
  • max_lat (float) – Maximum latitude

New in version 5.1.5.

License: Geosoft Open License

Note: Terminates with invalid or unsupported ranges. If the map crosses the equator, or if map is within 20 degrees of the equator, uses an equatorial mercator projection centered at the central longitude. Otherwise, uses a Lambert Conic Conformal (1SP) projection for the map. Global maps outside of +/- 70 degrees latitude are not supported.

make_wgs84()

Make a WGS 84 geographic projection

New in version 5.1.8.

License: Geosoft Open License

new_box_resolution(ip_jo, res, min_x, min_y, max_x, max_y, min_res, max_res, diag_res)

Determine a data resolution in a new coordinate system

Parameters:
  • ip_jo (GXIPJ) – New GXIPJ
  • res (float) – Data resolution in original GXIPJ
  • min_x (float) – X minimum of bounding box in new GXIPJ
  • min_y (float) – Y minimum
  • max_x (float) – X maximum
  • max_y (float) – Y maximum
  • min_res (float_ref) – Minimum data resolution in new GXIPJ,
  • max_res (float_ref) – Maximum data resolution in new GXIPJ
  • diag_res (float_ref) – Diagonal data resolution in new GXIPJ

New in version 5.1.5.

License: Geosoft Open License

Note: if there are any problems reprojecting, new resolutions will dummy. The conversion to new resolution is based on measurements along the four edges and two diagonals.

classmethod null()

A null (undefined) instance of GXIPJ

Returns:A null GXIPJ
Return type:GXIPJ
orientations_are_the_same(ipj2)

Are these two orientations the same?

Parameters:ipj2 (GXIPJ) – GXIPJ 2
Returns:0 - No 1 - Yes
Return type:int

New in version 7.2.

License: Geosoft Open License

orientations_are_the_same_within_a_small_tolerance(ipj2)

Same as orientations_are_the_same, but allows for small numerical differences

Parameters:ipj2 (GXIPJ) – GXIPJ 2
Returns:0 - No 1 - Yes
Return type:int

New in version 7.2.

License: Geosoft Open License

projection_type_is_fully_supported()

Is the projection type fully supported?

Returns:0 - No 1 - Yes
Return type:int

New in version 7.2.

License: Geosoft Open License

Note: This function checks only the projected coordinated system in the GXIPJ object, so should only be used with projections of type IPJ_TYPE_PCS. This function does not test the validity of datums or local datum transforms.

read(type, str1, str2, str3)

Read and define an GXIPJ from a standard file.

Parameters:
  • type (int) – IPJ_TYPE constants
  • str1 (str) – String 1
  • str2 (str) – String 2
  • str3 (str) – String 3

New in version 5.0.

License: Geosoft Open License

reproject_section_grid(output_ipj, x0, y0, dx, dy, rot)

Reproject a section grid

Parameters:
  • output_ipj (GXIPJ) – Reprojected GXIPJ on input (need not include an orientation). On output contains the same type of orientation as the initial GXIPJ, adjusted to be in the same location.
  • x0 (float_ref) – X origin of grid (input initial value, output new value)
  • y0 (float_ref) – Y origin of grid (input initial value, output new value)
  • dx (float_ref) – X cell size of grid (input initial value, output new value)
  • dy (float_ref) – Y cell size of grid (input initial value, output new value)
  • rot (float_ref) – Grid rotation (degrees CCW) (input initial value, output new value)

New in version 9.0.

License: Geosoft Open License

Note: Reproject a section grid to a new GXIPJ, adjusting its orientation and registration so that it remains in the same location.

serial(bf)

Serialize GXIPJ to a GXBF.

New in version 5.0.

License: Geosoft Open License

serial_fgdcxml(file)

Write the GXIPJ as a FDGC MetaData XML object

Parameters:file (str) – Name of file to export to

New in version 7.0.

License: Geosoft Open License

serial_isoxml(file)

Write the GXIPJ as a ISO MetaData XML object

Parameters:file (str) – Name of file to export to

New in version 7.0.

License: Geosoft Open License

serial_xml(file)

Write the GXIPJ as a Geosoft MetaData XML object

Parameters:file (str) – Name of file to export to

New in version 7.0.

License: Geosoft Open License

set_3d_inverted(inverted)

Set whether a view is inverted (must be 3D already)

Parameters:inverted (int) – Inverted (0 or 1)

New in version 6.3.1.

License: Geosoft Open License

set_3d_inverted_angles(inverted)

Set whether the angles in this view are inverted (must be 3D already)

Parameters:inverted (int) – Inverted (0 or 1)

New in version 6.3.1.

License: Geosoft Open License

set_3d_matrix_orientation(v00, v01, v02, v03, v10, v11, v12, v13, v20, v21, v22, v23, v30, v31, v32, v33)

Apply a 3D orientation directly using matrix coefficients.

Parameters:
  • v00 (float) – Row 0 Element 0
  • v01 (float) – Row 0 Element 1
  • v02 (float) – Row 0 Element 2
  • v03 (float) – Row 0 Element 3
  • v10 (float) – Row 1 Element 0
  • v11 (float) – Row 1 Element 1
  • v12 (float) – Row 1 Element 2
  • v13 (float) – Row 1 Element 3
  • v20 (float) – Row 2 Element 0
  • v21 (float) – Row 2 Element 1
  • v22 (float) – Row 2 Element 2
  • v23 (float) – Row 2 Element 3
  • v30 (float) – Row 3 Element 0
  • v31 (float) – Row 3 Element 1
  • v32 (float) – Row 3 Element 2
  • v33 (float) – Row 3 Element 3

New in version 8.5.

License: Geosoft Open License

set_3d_view(x, y, z, rx, ry, rz, sx, sy, str_val)

Set 3D orientation parameters

Parameters:
  • x (float) – X location of view origin
  • y (float) – Y location of view origin
  • z (float) – Z location of view origin
  • rx (float) – Rotation in X
  • ry (float) – Rotation in Y
  • rz (float) – Rotation in Z
  • sx (float) – Scaling in X
  • sy (float) – Scaling in Y
  • str_val (float) – Scaling in Z

New in version 6.3.

License: Geosoft Open License

Note: Sets up translation, scaling and rotation in all three directions for 3D objects.

set_3d_view_ex(x, y, z, rx, ry, rz, sx, sy, str_val, rotate, flags)

Set 3D orientation parameters with new flags

Parameters:
  • x (float) – X location of view origin
  • y (float) – Y location of view origin
  • z (float) – Z location of view origin
  • rx (float) – Rotation in X
  • ry (float) – Rotation in Y
  • rz (float) – Rotation in Z
  • sx (float) – Scaling in X
  • sy (float) – Scaling in Y
  • str_val (float) – Scaling in Z
  • rotate (int) – IPJ_3D_ROTATE constants
  • flags (int) – IPJ_3D_FLAG constants

New in version 7.0.

License: Geosoft Open License

Note: Sets up translation, scaling and rotation in all three directions for 3D objects.

set_3d_view_from_axes(x, y, z, x1, x2, x3, y1, y2, y3, sx, sy, str_val)

Set 3D orientation parameters

Parameters:
  • x (float) – X location of view origin
  • y (float) – Y location of view origin
  • z (float) – Z location of view origin
  • x1 (float) – X axis X component
  • x2 (float) – X axis Y component
  • x3 (float) – X axis Z component
  • y1 (float) – Y axis X component
  • y2 (float) – Y axis Y component
  • y3 (float) – Y axis Z component
  • sx (float) – Scaling in X
  • sy (float) – Scaling in Y
  • str_val (float) – Scaling in Z

New in version 9.0.

License: Geosoft Open License

Note: Sets up translation, scaling and rotation in all three directions for 3D objects, based on input origin and X and Y axis vectors.

set_crooked_section_view(dist_vv, xvv, yvv, log_z)

Set up the crooked section view.

Parameters:
  • dist_vv (GXVV) – Section X locations (e.g. distance along the curve)
  • xvv (GXVV) – True X
  • yvv (GXVV) – True Y
  • log_z (int) – Use logarithmic Y-axis (usually for data profiles) 0:No, 1:Yes

New in version 7.2.

License: Geosoft Open License

Note: A non-plane section. It is a vertical section which curves along a path in (X, Y).

set_depth_section_view(depth)

Set depth section orientation parameters

Parameters:depth (float) – View Y value for Depth = 0.0.

New in version 7.0.

License: Geosoft Open License

set_esri(esri)

Set coordinate system from an ESRI prj coordinate string

Parameters:esri (str) – ESRI prj format projection string

New in version 5.1.8.

License: Geosoft Open License

Note: If the projection is not supported in Geosoft, the GXIPJ will be unknown.

set_gxf(str1, str2, str3, str4, str5)

Set coordinate system from GXF style strings.

Parameters:
  • str1 (str) – “projection name” or PCS_NAME from ipj_pcs.csv (datum / projection) or EPSG coordinate system code number or “<file.prj>” projection file name or “<file.wrp>” warp file name
  • str2 (str) – “datum name”[, major axis, elipticity, prime meridian] or DATUM from datum.csv or EPSG datum code number
  • str3 (str) – “method name”, parameters (P1 through P8) or “projection name”[,”method name”,”Units”,P1,P2...] or TRANSFORM from transform.csv or EPSG transform method code number
  • str4 (str) – “unit name”, convertion to metres or UNIT_LENGTH from units.csv
  • str5 (str) – “local transform name”[,dX,dY,dZ,rX,rY,rZ,Scale] or DATUM_TRF from datumtrf.csv or AREA_OF_USE from ldatum.csv or EPSG local datum transform code number

New in version 5.0.

License: Geosoft Open License

Note: Simplest Usage:

The coordinate system can be resolved from the “coordinate system name” if the name is specified using an EPSG number or naming convention such as:

“datum / projection” (example: “Arc 1960 / UTM zone 37S”)

Where: “datum” is the EPSG datum name (eg. NAD83). All supported datums are listed in ...usercsvdatum.csv. “projection” is the EPSG coordinate system map projection. datum name (eg. “UTM zone 10N”). All supported coordinate system projections are listed in ...user/csv/transform.csv. All EPSG known combined coordinate systems of the earth are listed in ...user/csv/ipj_pcs.csv.

To define a geographic (longitude, latitude) oordinate system, specify the datum name alone (ie “Arc 1960”). EPSG numbers can also be used, so in the example above the name can be “21037”.

The coordinate system may also be oriented arbitrarily in 3D relative to the base coordinate system by specifying the orientation as a set of 6 comma-separated values between angled brackets after the coordinate system name, e.g:

"datum / projection"<oX,oY,oZ,rX,rY,rZ>
21037<oX,oY,oZ,rX,rY,rZ>

where:

oX,oY,oZ is the location of the local origin on the CS

rX,rY,rZ are rotations in degrees azimuth (clockwise) of
the local axis frame around the X, Y and Z axis respectively. A simple plane rotation will only have a rotation around Z.

For example:

"Arc 1960 / UTM zone 37S"<525000,2500000,0,0,0,15>

defines a local system with origin at (525000,2500000) with a rotation of 15 degrees azimuth.

Orientation parameters not defined will default to align with the base CS, Note that although allowed, it does not make sense to have an orientation on a geographic coordinate system (long,lat).

Complete usage:

A coordinate system can also be fully described by providing an additional four strings that define the datum, map projection, length units and prefered local datum transform. Refer to GXF revision 3 for further detail: http://www.geosoft.com/resources/goto/GXF-Grid-eXchange-File

Note that coordinate system reference tables sre maintained in csv files located in the .../user/csv folder found with the Geosoft installation files, which will usually be located here: C:Program Files (x86)GeosoftOasis montajusercsv

The “datum” string can use a datum name defined in the “datum.csv” file, or the local datum name from datumtrf.csv, or the local datum description from ldatum.csv. For a non-EPSG datum, you can define your own datum parameters in the Datum stringfield as follows:

"*YourDatumName",major_axis,flattening(or eccentricity)[,prime_meridian]

where The * before “YourDatumName” indicates this is a non-EPSG name. major_axis is in metres. flattening less than 0 is interpreted as eccentricity (0 indicates a sphere). prime_meridian is optional, specified in degrees of longitude relative to Greenwich.

The “Projection” can contain a projection system defined in the “transform.csv” file, or the name of a projection type followed by projection parameters. Geographic coordinates systems (long/lat only) must leave “projection” blank.

Projection names not defined in “transform.csv” can be defined in the “projection” string as follows:

method,length_units,P1,P2,...

where:

method
is a method from the table “transform_parameters.csv”.
length_units
is a “Unit_length” from units.csv. P1 through P8 (or fewer) are the projection parameters for the method as defined in “transform_parameters.csv”, and in the order defined. Parameters that are blank in “transform_parameters.csv” are omitted from the list so that each method will have a minimum list of parameters.

Angular parameters must always be degrees, and may be defined a decimal degree fromat, or “DEG.MM.SS.ssss”. Distance parameters (False Northing and False Easting) must be defined in the “length_units” (string 4).

Examples:

Geographic long,lat on datum "Arc 1960":
"4210","","","",""
"Arc 1960","","","",""
"","Arc 1960","","",""

Projected Coordinate System, UTM zone 37S
"21037","","","",""
"","4210","16137","",""
""Arc 1960 / UTM zone 37S"","","","",""
"",""Arc 1960"","UTM zone 37S","",""
"",""Arc 1960"","UTM zone 37S","m",""
"",""Arc 1960"","UTM zone 37S","m,1.0",""
"",""Arc 1960"","UTM zone 37S","m,1.0","");
"",""Arc 1960"","UTM zone 37S","m","Arc 1960 to WGS 84 (1)"

Locally oriented coordinate system (origin at 525000,2500000, rotated 15 deg):
"21037<525000,2500000,0,0,0,15>","","","",""
"<525000,2500000,0,0,0,15>","4210","16137","",""
""Arc 1960 / UTM zone 37S"<525000,2500000,0,0,0,15>","","","",""
set_gxf_safe(str1, str2, str3, str4, str5)

Same as set_gxf, but fails gracefully.

Parameters:
  • str1 (str) – “projection name” or PCS_NAME from ipj_pcs.csv (datum / projection) or EPSG coordinate system code number or “<file.prj>” projection file name or “<file.wrp>” warp file name
  • str2 (str) – “datum name”[, major axis, elipticity, prime meridian] or DATUM from datum.csv or EPSG datum code number
  • str3 (str) – “method name”, parameters (P1 through P8) or “projection name”[,”method name”,”Units”,P1,P2...] or TRANSFORM from transform.csv or EPSG transform method code number
  • str4 (str) – “unit name”, convertion to metres or UNIT_LENGTH from units.csv
  • str5 (str) – “local transform name”[,dX,dY,dZ,rX,rY,rZ,Scale] or DATUM_TRF from datumtrf.csv or AREA_OF_USE from ldatum.csv or EPSG local datum transform code number
Returns:

0 - error in setting GXIPJ, input GXIPJ unchanged. 1 - success: GXIPJ set using input values.

Return type:

int

New in version 7.0.

License: Geosoft Open License

Note: set_gxf will fail and terminate the GX if anything goes wrong (e.g. having a wrong parameter). If this function fails, it simply returns 0 and leaves the GXIPJ unchanged.

set_method_parm(parm, parm_value)

Set projection method parameter

Parameters:

New in version 5.0.

License: Geosoft Open License

Note: If parameter is not valid, nothing happens.

set_mi_coord_sys(coord, units)

Set coordinate system from a MapInfo coordsys command

Parameters:
  • coord (str) – MapInfo Coordinate System
  • units (str) – MapInfo Units

New in version 5.1.4.

License: Geosoft Open License

set_normal_section_view(x, y, z, azimuth, swing)

Set normal section orientation parameters

Parameters:
  • x (float) – X location of view origin
  • y (float) – Y location of view origin
  • z (float) – Z location of view origin
  • azimuth (float) – Section azimuth - degrees CCW from north
  • swing (float) – Section swing -90 < swing < 90.

New in version 7.0.

License: Geosoft Open License

Note: This section is the type where values are projected normal to the section, and the “Y” values in a grid do not necessarily correspond to the elvations for a swung section.

set_plan_view(x, y, z, rot)

Set plan orientation parameters.

Parameters:
  • x (float) – X location of view origin
  • y (float) – Y location of view origin
  • z (float) – Z location of view origin
  • rot (float) – Rotation CCW from normal XY coords

New in version 5.1.6.

License: Geosoft Open License

Note: This sets up the orientation of an GXIPJ for plan view plots, for instance in Wholeplot. These differ from regular plan map views in that the elevation of the view plane is set, and the view may be rotated. In addition, when viewed in a map, a view with this GXIPJ will give a status bar location (X, Y, Z) of the actual location in space, as opposed to just the X, Y of the view plane itself.

set_section_view(x, y, z, azimuth, swing)

Set section orientation parameters

Parameters:
  • x (float) – X location of view origin
  • y (float) – Y location of view origin
  • z (float) – Z location of view origin
  • azimuth (float) – Section azimuth - degrees CCW from north
  • swing (float) – Section swing -90 < swing < 90.

New in version 5.1.6.

License: Geosoft Open License

Note: This sets up the orientation of an GXIPJ for section view plots, for instance in Wholeplot. In addition, when viewed in a map, a view with this GXIPJ will give a status bar location (X, Y, Z) of the actual location in space, as opposed to just the X, Y of the view plane itself. Swung sections are tricky because they are set up for section plots in such a way that the vertical axis remains “true”; points are projected horizontally to the viewing plane, independent of the swing angle. In other words, all locations in 3D space viewed using this projection will plot on the same horizontal line in the map view. This function is NOT suitable for simply creating an orientation for a dipping grid or view.

set_units(scale, str_val)

Set unit parameters

Parameters:
  • scale (float) – Factor to meters, must be >= 0.0
  • str_val (str) – Abbreviation, can be “”

New in version 5.0.

License: Geosoft Open License

set_vcs(str_val)

Set the Vertical Coordinate System in the GXIPJ name string

Parameters:str_val (str) – New name (See Valid inputs above).

New in version 9.2.

License: Geosoft Open License

Note: The vertical coordinate system (vcs) describes the datum used for vertical coordinates. The vcs name, if known, will appear in square brackets as part of the coordinate system name.

Examples:

"WGS 84 [geoid]"
"WGS 84 / UTM zone 12S" - the vcs is not known.
"WGS 84 / UTM zone 12S [NAVD88]"

Valid inputs:

“NAVD88” - Clears existing vcs, if any, and sets the VCS name to “NAVD88”. “” - Clears the vcs
set_wms_coord_sys(coord, min_x, min_y, max_x, max_y)

Set coordinate system from a WMS coordsys string.

Parameters:
  • coord (str) – WMS style coordinate string
  • min_x (float) – Minimum X bounding box
  • min_y (float) – Minimum Y
  • max_x (float) – Maximum X
  • max_y (float) – Maximum Y

New in version 5.1.5.

License: Geosoft Open License

Note: WMS coordinate strings supported:

EPSG:code

where “code” is the EPSG code number “EPSG:4326” is geographic “WGS 84” (see datum.csv) “EPSG:25834” is projected “ETRS89 / UTM zone 34N” (see ipj_pcs.csv)

The bounding box for EPSG systems must be defined in the EPSG coordinate system. If a bounding box is provided, it will not be changed.

AUTO:wm_id,epsg_units,lon,lat (see OGC documentation)

for “AUTO” coordinates, the “epsg_units” is the units of the bounding box. This procedure will transform the supplied bounding box from these units to the units of the projection. Normally, this is from long/lat (9102) to metres (9001).

set_xml(str_val)

Set an GXIPJ from a Geosoft Metadata XML string

Parameters:str_val (str) – XML string to set

New in version 7.0.

License: Geosoft Open License

source_type()

Get GXIPJ source type

Returns:IPJ_TYPE constants
Return type:int

New in version 5.0.

License: Geosoft Open License

support_datum_transform(ipj2)

Can we transform between these two datums?

Parameters:ipj2 (GXIPJ) – GXIPJ 2
Returns:0 - No 1 - Yes, either because both CS are on the same datum, or because a local datum transform is defined for each coordinate system.
Return type:int

New in version 6.0.

License: Geosoft Open License

Note: To transform between different datums requires the use of a local datum transform. The local datum transform can be defined when a coordinate system is created, but the definition is optional. This function will test that the local datum transforms are defined. Note that a coordinate transformation between datums without a local datum transform is still possible, but only the effect of ellipsoid shape will be modelled in the transform.

classmethod unit_name(val, type, name)

Get a unit name given a scale factor

Parameters:
  • val (float) – Factor to meters
  • type (int) – IPJ_UNIT constants
  • name (str_ref) – Name returned, “” if cannot find unit

New in version 5.0.

License: Geosoft Open License

classmethod unit_scale(name, default)

Get a unit scale (m/unit) given a name

Parameters:
  • name (str) – Unit name, abbreviation or full name
  • default (float) – Default to return if name not found
Returns:

Scale factor m/unit

Return type:

float

New in version 5.0.

License: Geosoft Open License

Note: If name cannot be found, returns default.

warp_type()

Obtain the warp type of an GXIPJ.

Returns:IPJ_WARP constants
Return type:int

New in version 7.0.

License: Geosoft Open License

warped()

Does GXIPJ contain a warp?

Return type:bool

New in version 5.0.

License: Geosoft Open License

warps_are_the_same(ipj2)

Are these two warps the same?

Parameters:ipj2 (GXIPJ) – GXIPJ 2
Returns:0 - No 1 - Yes
Return type:int

New in version 7.2.

License: Geosoft Open License

warps_are_the_same_within_a_small_tolerance(ipj2)

Same as warps_are_the_same, but allows for small numerical differences

Parameters:ipj2 (GXIPJ) – GXIPJ 2
Returns:0 - No 1 - Yes
Return type:int

New in version 7.2.

License: Geosoft Open License

IPJ_3D_FLAG constants

3D Flags

IPJ_3D_FLAG_NONE

Standard

gxapi.IPJ_3D_FLAG_NONE = 0
IPJ_3D_FLAG_INVERTANGLES

Invert angle rotation during matrix creation

gxapi.IPJ_3D_FLAG_INVERTANGLES = 1
IPJ_3D_FLAG_INVERTZ

Invert the Z plane to make up down.

gxapi.IPJ_3D_FLAG_INVERTZ = 2
IPJ_3D_FLAG_ORDER_ROTATION

Apply rotations in a specific order, determined by pdParm[7]

gxapi.IPJ_3D_FLAG_ORDER_ROTATION = 4

IPJ_3D_ROTATE constants

3D Rotation Mode

IPJ_3D_ROTATE_DEFAULT

Default

gxapi.IPJ_3D_ROTATE_DEFAULT = 0
IPJ_3D_ROTATE_XYZ

Xyz

gxapi.IPJ_3D_ROTATE_XYZ = 1
IPJ_3D_ROTATE_XZY

Xzy

gxapi.IPJ_3D_ROTATE_XZY = 2
IPJ_3D_ROTATE_YXZ

Yxz

gxapi.IPJ_3D_ROTATE_YXZ = 3
IPJ_3D_ROTATE_YZX

Yzx

gxapi.IPJ_3D_ROTATE_YZX = 4
IPJ_3D_ROTATE_ZXY

Zxy

gxapi.IPJ_3D_ROTATE_ZXY = 5
IPJ_3D_ROTATE_ZYX

Zyx

gxapi.IPJ_3D_ROTATE_ZYX = 6

IPJ_CSP constants

Projection Setting

IPJ_CSP_SCALE

Scale

gxapi.IPJ_CSP_SCALE = 0
IPJ_CSP_FALSEEAST

Falseeast

gxapi.IPJ_CSP_FALSEEAST = 1
IPJ_CSP_FALSENORTH

Falsenorth

gxapi.IPJ_CSP_FALSENORTH = 2
IPJ_CSP_LATORIGIN

Latorigin

gxapi.IPJ_CSP_LATORIGIN = 3
IPJ_CSP_LONORIGIN

Lonorigin

gxapi.IPJ_CSP_LONORIGIN = 4
IPJ_CSP_PARALLEL_1

Parallel 1

gxapi.IPJ_CSP_PARALLEL_1 = 5
IPJ_CSP_PARALLEL_2

Parallel 2

gxapi.IPJ_CSP_PARALLEL_2 = 6
IPJ_CSP_AZIMUTH

Azimuth

gxapi.IPJ_CSP_AZIMUTH = 7
IPJ_CSP_ANGLE

Angle

gxapi.IPJ_CSP_ANGLE = 8
IPJ_CSP_POINTLAT_1

Pointlat 1

gxapi.IPJ_CSP_POINTLAT_1 = 9
IPJ_CSP_POINTLON_1

Pointlon 1

gxapi.IPJ_CSP_POINTLON_1 = 10
IPJ_CSP_POINTLAT_2

Pointlat 2

gxapi.IPJ_CSP_POINTLAT_2 = 11
IPJ_CSP_POINTLON_2

Pointlon 2

gxapi.IPJ_CSP_POINTLON_2 = 12

IPJ_NAME constants

Project Name

IPJ_NAME_PCS

Projected coordinate system name

gxapi.IPJ_NAME_PCS = 0
IPJ_NAME_PROJECTION

Projection name

gxapi.IPJ_NAME_PROJECTION = 1
IPJ_NAME_METHOD

Projection method name

gxapi.IPJ_NAME_METHOD = 2
IPJ_NAME_DATUM

Datum name

gxapi.IPJ_NAME_DATUM = 3
IPJ_NAME_ELLIPSOID

Ellipsoid name

gxapi.IPJ_NAME_ELLIPSOID = 4
IPJ_NAME_LDATUM

Local datum name

gxapi.IPJ_NAME_LDATUM = 5
IPJ_NAME_UNIT_ABBR

Unit abbreviation

gxapi.IPJ_NAME_UNIT_ABBR = 6
IPJ_NAME_UNIT_FULL

Full unit name

gxapi.IPJ_NAME_UNIT_FULL = 7
IPJ_NAME_TYPE

Projection type description

gxapi.IPJ_NAME_TYPE = 8
IPJ_NAME_LLDATUM

Datum transform table name

gxapi.IPJ_NAME_LLDATUM = 9
IPJ_NAME_METHOD_PARMS

Projection method parameters in GXF order

gxapi.IPJ_NAME_METHOD_PARMS = 10
IPJ_NAME_METHOD_LABEL

Projection method parameters labels

gxapi.IPJ_NAME_METHOD_LABEL = 11
IPJ_NAME_DATUM_PARMS

Datum parameters (major axis, flattening, prime meridian)

gxapi.IPJ_NAME_DATUM_PARMS = 12
IPJ_NAME_LDATUM_PARMS

local datum parameters (dX,dY,dZ,rX,rY,rZ,scale) See GXF revision 3 for parameter list order and specifications.

gxapi.IPJ_NAME_LDATUM_PARMS = 13
IPJ_NAME_GEOID

Geoid name if known

gxapi.IPJ_NAME_GEOID = 14
IPJ_NAME_LDATUMDESCRIPTION

Local datum description

gxapi.IPJ_NAME_LDATUMDESCRIPTION = 15
IPJ_NAME_METHOD_PARMS_NATIVE

Projection method parameters in GXF order (Native units for eastings/northings)

gxapi.IPJ_NAME_METHOD_PARMS_NATIVE = 16
IPJ_NAME_ORIENTATION_PARMS

Orientation parameters

gxapi.IPJ_NAME_ORIENTATION_PARMS = 17

IPJ_ORIENT constants

Projection Orientation

IPJ_ORIENT_DEFAULT

no special orientation - plan view. All views in maps created before v5.1.3 will return this value.

gxapi.IPJ_ORIENT_DEFAULT = 0
IPJ_ORIENT_PLAN

A plan view with a reference elevation and optional rotation.

gxapi.IPJ_ORIENT_PLAN = 1
IPJ_ORIENT_SECTION

Has an azimuth and swing. The section view projects all plotted objects HORIZONTALLY onto the viewing plan in order to preserve elevations, even if the section has a swing.

gxapi.IPJ_ORIENT_SECTION = 2
IPJ_ORIENT_SECTION_NORMAL

Same as IPJ_ORIENT_SECTION, but the projection is perpendicular to the section, not horizonatl, so elevatins are not preserved on swung sections.

gxapi.IPJ_ORIENT_SECTION_NORMAL = 5
IPJ_ORIENT_DEPTH_SECTION

This simple section has no azimuth or swing defined; only the depth is of importance, and it is output as the Y parameter, increasing downward. Used (for instance) for strip logs in Wholeplot.

gxapi.IPJ_ORIENT_DEPTH_SECTION = 3
IPJ_ORIENT_3D

A 3D rotation/scaling/translation orientation

gxapi.IPJ_ORIENT_3D = 4
IPJ_ORIENT_3D_MATRIX

A 3D matrix orientation

gxapi.IPJ_ORIENT_3D_MATRIX = 7
IPJ_ORIENT_SECTION_CROOKED

This is a vertical section that follows a curving path, like a river or survey traverse. The horizontal section location is the distance along the path, while the vertical axis gives the elevation.

gxapi.IPJ_ORIENT_SECTION_CROOKED = 6

IPJ_PARM_LST constants

Projection List

IPJ_PARM_LST_COORDINATESYSTEM

Coordinatesystem

gxapi.IPJ_PARM_LST_COORDINATESYSTEM = 0
IPJ_PARM_LST_DATUM

Datum

gxapi.IPJ_PARM_LST_DATUM = 1
IPJ_PARM_LST_PROJECTION

Projection

gxapi.IPJ_PARM_LST_PROJECTION = 2
IPJ_PARM_LST_UNITS

Units

gxapi.IPJ_PARM_LST_UNITS = 3
IPJ_PARM_LST_LOCALDATUMDESCRIPTION

Localdatumdescription

gxapi.IPJ_PARM_LST_LOCALDATUMDESCRIPTION = 4
IPJ_PARM_LST_LOCALDATUMNAME

Localdatumname

gxapi.IPJ_PARM_LST_LOCALDATUMNAME = 5
IPJ_PARM_LST_UNITSDESCRIPTION

Unitsdescription

gxapi.IPJ_PARM_LST_UNITSDESCRIPTION = 6

IPJ_TYPE constants

GXIPJ Types

IPJ_TYPE_PRJ

Read from a PRJ file: string 1 - Source file name string 2 and 3 are not used.

gxapi.IPJ_TYPE_PRJ = 0
IPJ_TYPE_PCS

Projected coordinate system: string 1 - POSC PCS name string 2 - POSC Datum transform name string 3 - not used.

gxapi.IPJ_TYPE_PCS = 1
IPJ_TYPE_GCS

Geographic coordinate system: string 1 - POSC Datum name string 2 - POSC Datum transform name string 3 - not used.

gxapi.IPJ_TYPE_GCS = 2
IPJ_TYPE_ANY

Custom projection string 1 - POSC Datum name string 2 - POSC Datum transform name string 3 - POSC Transform, “” if geographic

gxapi.IPJ_TYPE_ANY = 3
IPJ_TYPE_NONE

Not used for read. This is used for source_type to indicate no projection.

gxapi.IPJ_TYPE_NONE = 4
IPJ_TYPE_WRP

Wrp

gxapi.IPJ_TYPE_WRP = 5
IPJ_TYPE_TEST

tests the projection tables for internal consistency and creates report files in the project directory. string 1 - outout report file name string 2 - ESRI coordinate strings file. This contains one ESRI coordinate string per line. Lines that start with ‘#’ are skipped. string 3 - not currently used

gxapi.IPJ_TYPE_TEST = 6

IPJ_UNIT constants

Projection Unit Type

IPJ_UNIT_ABBREVIATION

Abbreviation

gxapi.IPJ_UNIT_ABBREVIATION = 0
IPJ_UNIT_FULLNAME

Fullname

gxapi.IPJ_UNIT_FULLNAME = 1

IPJ_WARP constants

Warp (Transformation) type

IPJ_WARP_MATRIX

Matrix Warp

gxapi.IPJ_WARP_MATRIX = -1
IPJ_WARP_NONE

No warp

gxapi.IPJ_WARP_NONE = 0
IPJ_WARP_TRANS1

Translate only (needs 1 point)

gxapi.IPJ_WARP_TRANS1 = 1
IPJ_WARP_TRANS2

Translate, rotate, normal scale (needs 2 pts)

gxapi.IPJ_WARP_TRANS2 = 2
IPJ_WARP_TRANS3

Translate, rotate, scale X and Y (needs 3 pts or more, least-square fit)

gxapi.IPJ_WARP_TRANS3 = 3
IPJ_WARP_QUAD

Quadrilateral warp (needs 4 points)

gxapi.IPJ_WARP_QUAD = 4
IPJ_WARP_MULTIPOINT

Multipoint warp (needs at least 3 points)

gxapi.IPJ_WARP_MULTIPOINT = 5
IPJ_WARP_LOG

Convert from linear to log coords in X and/or Y

gxapi.IPJ_WARP_LOG = 6
IPJ_WARP_MULTIPOINT_Y

Multipoint warp in Y only (needs at least 3 points)

gxapi.IPJ_WARP_MULTIPOINT_Y = 7