GXIPJ class¶
- class GXIPJ(handle=0)[source]¶
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 aGXPJ
object, which allows for the conversion of positions from one projection to the other. See also theGXLL2
class, which creates Datum correction lookups.See also
GXPJ
Converts coordinates between projectionsGXLL2
Creates Datum correction lookups.- add_as_favourite_coordinate_system()[source]¶
Add as favourite coordinate system to Settings.
New in version 9.10.
License: Geosoft Open License
- add_exagg_warp(x_exag, y_exag, z_exag, x_orig, y_orig, z_orig)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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 pointGXVV
’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()[source]¶
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()[source]¶
Clear any orientation and/or warp from an
GXIPJ
.New in version 5.1.6.
License: Geosoft Open License
- clear_warp()[source]¶
Clear warp parameters (if any) from an
GXIPJ
.New in version 5.0.
License: Geosoft Open License
- compare_datums(ipj2)[source]¶
Compare the datums of two coordinate systems?
- Parameters:
- 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.
- compare_datums_to_specified_tolerance_with_feedback(ipj2, sig_digits, str_val)[source]¶
Compare the datums of two coordinate systems, but allows for a specified accuracy and returns the reason if they are different
- Parameters:
- 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 9.10.
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)[source]¶
Convert X,Y and Z VVs using the orientation warp from an
GXIPJ
.- Parameters:
New in version 6.4.
License: Geosoft Open License
- convert_warp(x, y, z, f_forward)[source]¶
Converts a point X, Y, Z to the new
GXIPJ
plane.- Parameters:
- 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)[source]¶
Converts a set of X & Y VVs to the new
GXIPJ
plane. The Z is assumed to be 0- Parameters:
- Returns:
0 if ok - 1 otherwise
- Return type:
int
New in version 6.3.
License: Geosoft Open License
- coordinate_systems_are_the_same(ipj2)[source]¶
Are these two coordinate systems the same?
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_to_specified_tolerance_with_feedback(ipj2, sig_digits, sig_digits_EN, str_val)[source]¶
Same as
coordinate_systems_are_the_same
, but allows for a specified accuracy and returns the reason if they are different- Parameters:
- Returns:
0 - No 1 - Yes
- Return type:
int
New in version 9.10.
License: Geosoft Open License
- coordinate_systems_are_the_same_within_a_small_tolerance(ipj2)[source]¶
Same as
coordinate_systems_are_the_same
, but allows for small numerical differencesNew in version 7.2.
License: Geosoft Open License
- copy(ip_jd)[source]¶
Copy IPJs
New in version 5.0.
License: Geosoft Open License
- copy_orientation(ip_jd)[source]¶
Copy any orientation and/or warp from one
GXIPJ
to another.New in version 9.10.
License: Geosoft Open License
- copy_projection(ip_jd)[source]¶
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()[source]¶
This method creates a projection object.
New in version 5.0.
License: Geosoft Open License
- classmethod create_s(bf)[source]¶
Create
GXIPJ
from serialized source.New in version 5.0.
License: Geosoft Open License
- classmethod create_xml(file)[source]¶
Create an
GXIPJ
from serialized Geosoft MetaData XML fileNew 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)[source]¶
Gets the coefficients of a 3D matrix orientation.
- Parameters:
v00 (float_ref) – Row 0 Element 0
v01 (float_ref) – Row 0 Element 1
v02 (float_ref) – Row 0 Element 2
v03 (float_ref) – Row 0 Element 3
v10 (float_ref) – Row 1 Element 0
v11 (float_ref) – Row 1 Element 1
v12 (float_ref) – Row 1 Element 2
v13 (float_ref) – Row 1 Element 3
v20 (float_ref) – Row 2 Element 0
v21 (float_ref) – Row 2 Element 1
v22 (float_ref) – Row 2 Element 2
v23 (float_ref) – Row 2 Element 3
v30 (float_ref) – Row 3 Element 0
v31 (float_ref) – Row 3 Element 1
v32 (float_ref) – Row 3 Element 2
v33 (float_ref) – Row 3 Element 3
New in version 8.5.
License: Geosoft Open License
- get_3d_view(x, y, z, rx, ry, rz, sx, sy, str_val)[source]¶
Get 3D orientation parameters
- Parameters:
x (float_ref) – X location of view origin
y (float_ref) – Y location of view origin
z (float_ref) – Z location of view origin
rx (float_ref) – Rotation in X
ry (float_ref) – Rotation in Y
rz (float_ref) – Rotation in Z
sx (float_ref) – Scaling in X
sy (float_ref) – Scaling in Y
str_val (float_ref) – Scaling in Z
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)[source]¶
Get 3D orientation parameters with new flags
- Parameters:
x (float_ref) – X location of view origin
y (float_ref) – Y location of view origin
z (float_ref) – Z location of view origin
rx (float_ref) – Rotation in X
ry (float_ref) – Rotation in Y
rz (float_ref) – Rotation in Z
sx (float_ref) – Scaling in X
sy (float_ref) – Scaling in Y
str_val (float_ref) – Scaling in Z
rotate (int_ref) – IPJ_3D_ROTATE constants
flags (int_ref) – IPJ_3D_FLAG constants
New in version 7.0.
License: Geosoft Open License
Note: The view must have a 3D orientation
- get_authority_id(authority)[source]¶
Get Authority ID (e.g. EPSG, ESRI) for coordinate system or
iDUMMY
if unknown.- Parameters:
authority (str_ref) – Authority ID (e.g. EPSG and ESRI)
- Returns:
- Return type:
int
New in version 9.10.
License: Geosoft Open License
- get_crooked_section_view_v_vs(dist_vv, xvv, yvv, log_z)[source]¶
Get the crooked section path.
- Parameters:
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)[source]¶
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_epsgid_for_datum()[source]¶
Get EPSG ID for datum of coordinate system or
iDUMMY
if unknown.- Returns:
- Return type:
int
New in version 9.10.
License: Geosoft Open License
- get_esri(esri)[source]¶
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.
- classmethod get_favourite_coordinate_system(index)[source]¶
Get a favourite coordinate system from Settings.
- Parameters:
index (int) – Index of item.
- Return type:
New in version 9.10.
License: Geosoft Open License
- get_from_binary_as_string(str_val)[source]¶
Get
GXIPJ
from binary-as-string- Parameters:
str_val (str_ref) – Binary as string returned
New in version 9.4.
License: Geosoft Open License
- get_gxf(str1, str2, str3, str4, str5)[source]¶
Store coordinate system in GXF style strings.
- Parameters:
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)[source]¶
Get a list of parameters.
- Parameters:
parm (int) – IPJ_PARM_LST constants
datum (str) – Datum filter, “” for no filter
lst (GXLST) – List returned
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)[source]¶
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)[source]¶
Store coordinate system in MapInfo coordsys pair
- Parameters:
New in version 7.0.
License: Geosoft Open License
- get_name(type, str_val)[source]¶
Get an
GXIPJ
name- Parameters:
type (int) – IPJ_NAME constants
str_val (str_ref) – Name returned
New in version 5.0.
License: Geosoft Open License
- get_north_azimuth(x, y)[source]¶
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 isGS_R8DM
;
- classmethod get_number_of_favourite_coordinate_systems()[source]¶
Get number of favourite coordinate systems in Settings.
- Return type:
int
New in version 9.10.
License: Geosoft Open License
- get_orientation()[source]¶
Get
GXIPJ
orientation in space.- Returns:
- 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)[source]¶
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 toIPJ_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)[source]¶
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)[source]¶
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)[source]¶
Get the equation of a plane with reprojection.
- Parameters:
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 theGXIPJ
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 inputGXIPJ
.
- get_units(scale, str_val)[source]¶
Get unit parameters
New in version 5.0.
License: Geosoft Open License
- get_xml(str_val)[source]¶
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()[source]¶
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()[source]¶
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 horizontallyIPJ_ORIENT_SECTION_NORMAL
- LikeIPJ_ORIENT_SECTION
, but Z projects perpendicular to the secton plane.IPJ_ORIENT_SECTION_CROOKED
- Crooked sectionsIPJ_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()[source]¶
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()[source]¶
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()[source]¶
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()[source]¶
Check if this is a null (undefined) instance
- Returns:
True if this is a null (undefined) instance, False otherwise.
- Return type:
bool
- make_geographic()[source]¶
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)[source]¶
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()[source]¶
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)[source]¶
Determine a data resolution in a new coordinate system
- Parameters:
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.
- orientations_are_the_same(ipj2)[source]¶
Are these two orientations the same?
New in version 7.2.
License: Geosoft Open License
- orientations_are_the_same_to_specified_tolerance_with_feedback(ipj2, sig_digits, str_val)[source]¶
Same as
orientations_are_the_same
, but allows for small numerical differences- Parameters:
- Returns:
0 - No 1 - Yes
- Return type:
int
New in version 9.10.
License: Geosoft Open License
- orientations_are_the_same_within_a_small_tolerance(ipj2)[source]¶
Same as
orientations_are_the_same
, but allows for small numerical differencesNew in version 7.2.
License: Geosoft Open License
- projection_type_is_fully_supported()[source]¶
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 typeIPJ_TYPE_PCS
. This function does not test the validity of datums or local datum transforms.
- read(type, str1, str2, str3)[source]¶
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
- classmethod remove_favourite_coordinate_system(index)[source]¶
Remove favourite coordinate system from Settings.
- Parameters:
index (int) – Index of item.
New in version 9.10.
License: Geosoft Open License
- reproject_section_grid(output_ipj, x0, y0, dx, dy, rot)[source]¶
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 initialGXIPJ
, 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)[source]¶
-
New in version 5.0.
License: Geosoft Open License
- serial_fgdcxml(file)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
Set up the crooked section view.
- Parameters:
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)[source]¶
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)[source]¶
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_from_binary_as_string(str_val)[source]¶
Set
GXIPJ
from binary-as-string- Parameters:
str_val (str) – Binary as string
New in version 9.4.
License: Geosoft Open License
- set_gxf(str1, str2, str3, str4, str5)[source]¶
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)[source]¶
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
, inputGXIPJ
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 theGXIPJ
unchanged.
- set_method_parm(parm, parm_value)[source]¶
Set projection method parameter
- Parameters:
parm (int) – IPJ_CSP constants
parm_value (float) – Parameter value
New in version 5.0.
License: Geosoft Open License
Note: If parameter is not valid, nothing happens.
- set_mi_coord_sys(coord, units)[source]¶
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)[source]¶
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)[source]¶
Set plan orientation parameters.
- Parameters:
x (float) – X location of view rotation point
y (float) – Y location of view rotation point
z (float) – Z location of view plane in 3D
rot (float) – Rotation CCW from normal XY coords about the rotation point
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 drill hole section map (top plan view). 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 thisGXIPJ
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. When a rotation azimuth angle (CW) is specified, the input (X, Y) location is the point about which the coordinate system is rotated. For instance, you can rotate a grid about its corner (XC, YC) by giving it a Plan View orientation (XC, YC, ZElevation, Rot). If there is no rotation, the input X, Y locations are irrelevent, but they will show up in the output string for the orientation, so it makes sense to default them to (0, 0).
- set_section_view(x, y, z, azimuth, swing)[source]¶
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 thisGXIPJ
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)[source]¶
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)[source]¶
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)[source]¶
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)[source]¶
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()[source]¶
Get
GXIPJ
source type- Returns:
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- support_datum_transform(ipj2)[source]¶
Can we transform between these two datums?
- Parameters:
- 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)[source]¶
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)[source]¶
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()[source]¶
Obtain the warp type of an
GXIPJ
.- Returns:
- Return type:
int
New in version 7.0.
License: Geosoft Open License
- warped()[source]¶
Does
GXIPJ
contain a warp?- Return type:
bool
New in version 5.0.
License: Geosoft Open License
- warps_are_the_same(ipj2)[source]¶
Are these two warps the same?
New in version 7.2.
License: Geosoft Open License
- warps_are_the_same_to_specified_tolerance_with_feedback(ipj2, sig_digits, str_val)[source]¶
Same as
warps_are_the_same
, but allows for a specified accuracy and returns the reason if they are different- Parameters:
- Returns:
0 - No 1 - Yes
- Return type:
int
New in version 9.10.
License: Geosoft Open License
- warps_are_the_same_within_a_small_tolerance(ipj2)[source]¶
Same as
warps_are_the_same
, but allows for small numerical differencesNew in version 7.2.
License: Geosoft Open License
IPJ_3D_FLAG constants¶
3D Flags
IPJ_3D_ROTATE constants¶
3D Rotation Mode
IPJ_CSP constants¶
Projection Setting
IPJ_NAME constants¶
Project Name
- 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_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_PARM_LST constants¶
Projection List
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 forsource_type
to indicate no projection.- gxapi.IPJ_TYPE_NONE = 4¶
- 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_WARP constants¶
Warp (Transformation) type