GXPJ class¶
-
class
geosoft.gx.
GXPJ
¶ The PJ object is created from two IPJ objects, and is used for converting data in an OASIS database or map object from one map coordinate (projection) system to another.
-
clip_ply
((float)arg1, (float)arg2, (float)arg3, (float)arg4, (float)arg5, (GXPLY)arg6) → None:¶ Create a clip polygon from a projected area.
Parameters: - arg1 (float) – Min X (or Longitude...)
- arg2 (float) – Min Y (or Latitude...)
- arg3 (float) – Max X
- arg4 (float) – Max Y
- arg5 (float) – Max deviation in degrees
- arg6 (
geosoft.gx.GXPLY
) – PLY to be filled
Returns: Nothing
Return type: None
New in version 5.0.0.
Note:
A rectangular area from (MinX, MinY) to (MaxX, MaxY) is projected throught the PJ. The resulting (non-rectangular) area is then digitized along its edges, then thinned to remove near-collinear points. The thinning is done to any point whose neighbors subtend an angle greater than (180 degrees - maximum deviation). (i.e. if max. dev = 0, only co-linear points would be removed).
-
convert_vv
((GXVV)arg1, (GXVV)arg2) → None:¶ Convert VVx/VVy from input projection to output projection.
Parameters: - arg1 (
geosoft.gx.GXVV
) – VVx - arg2 (
geosoft.gx.GXVV
) – VVy
Returns: Nothing
Return type: None
New in version 5.0.0.
Note:
This function is equivalent to
geosoft.gx.GXVV.project()
.- arg1 (
-
convert_vv3
((GXVV)arg1, (GXVV)arg2, (GXVV)arg3) → None:¶ Convert VVx/VVy/VVz projections
Parameters: - arg1 (
geosoft.gx.GXVV
) – VVx - arg2 (
geosoft.gx.GXVV
) – VVy - arg3 (
geosoft.gx.GXVV
) – VVz
Returns: Nothing
Return type: None
New in version 5.0.0.
Note:
This function is equivalent to
geosoft.gx.GXVV.project_3d()
.- arg1 (
-
convert_xy
((float_ref)arg1, (float_ref)arg2) → None:¶ Convert X, Y from input projection to output projection.
Parameters: - arg1 (
geosoft.gx.float_ref
) – X (or Longitude) - arg2 (
geosoft.gx.float_ref
) – Y (or Latitude)
Returns: Nothing
Return type: None
New in version 5.0.0.
- arg1 (
-
convert_xy_from_xyz
((float_ref)arg1, (float_ref)arg2, (float)arg3) → None:¶ Convert X, Y from input projection to output projection, taking Z into account
Parameters: - arg1 (
geosoft.gx.float_ref
) – X (or Longitude) - arg2 (
geosoft.gx.float_ref
) – Y (or Latitude) - arg3 (float) – Z (or Depth - unchanged)
Returns: Nothing
Return type: None
New in version 7.3.0.
Note:
This function is used (for instance) when projecting voxel model locations where the user expects that the vertical position will not change. The regular
geosoft.gx.GXPJ.convert_xyz()
may result in shifts of hundreds, even a thousand meters in case where you are going from the geoid to an ellipsoid. The value of Z can have an important effect on the accuracy of the results, as the normalgeosoft.gx.GXPJ.convert_xy()
assumes a value of Z=0 internally and callsgeosoft.gx.GXPJ.convert_xyz()
.- arg1 (
-
convert_xyz
((float_ref)arg1, (float_ref)arg2, (float_ref)arg3) → None:¶ Convert X,Y,Z from input projection to output projection.
Parameters: - arg1 (
geosoft.gx.float_ref
) – X (or Longitude) - arg2 (
geosoft.gx.float_ref
) – Y (or Latitude) - arg3 (
geosoft.gx.float_ref
) – Z (or Depth)
Returns: Nothing
Return type: None
New in version 6.3.0.
- arg1 (
-
static
create
((GXContext)ctx, (str)arg1, (str)arg2) → GXPJ:¶ This method creates a projection object.
Parameters: - ctx (
geosoft.gx.GXContext
) – The GX execution context - arg1 (str) – Input PRJ file name, “” for geodetic
- arg2 (str) – Ouput PRJ file name, “” for geodetic
Returns: PJ Object
Return type: New in version 5.0.0.
- ctx (
-
static
create_ipj
((GXContext)ctx, (GXIPJ)arg1, (GXIPJ)arg2) → GXPJ:¶ This method creates a projection object from IPJs.
Parameters: - ctx (
geosoft.gx.GXContext
) – The GX execution context - arg1 (
geosoft.gx.GXIPJ
) – Input Projection, (IPJ)0 for long/lat - arg2 (
geosoft.gx.GXIPJ
) – Output Projection, (IPJ)0 for long/lat
Returns: PJ Object
Return type: New in version 5.0.0.
Note:
If converting to/from long/lat in the natural coordinate system of the source/target, only the long/lat system can be passed as (IPJ)0.
- ctx (
-
static
create_rectified
((GXContext)ctx, (float)arg1, (float)arg2, (float)arg3, (float)arg4, (float)arg5, (float)arg6, (int)arg7) → GXPJ:¶ Create a rectified PJ from lon,lat,rotation
Parameters: - ctx (
geosoft.gx.GXContext
) – The GX execution context - arg1 (float) – longitude at (X,Y) origin
- arg2 (float) – latitude at (X,Y) origin
- arg3 (float) – (X,Y) origin
- arg4 (float) –
- arg5 (float) – coordinate Y relative to geographic N (deg azm)
- arg6 (float) – scale to convert X,Y to m.
- arg7 (int) – PJ_RECT constants
Returns: PJ Object
Return type: New in version 5.0.0.
Note:
Given an X,Y coordinate system, the lat/lon origin and angle of the coordinate system, this will create a PJ to convert between X,Y coordinates and Lon,Lat. The Lon/Lat is determined using a Transverse Mercator projection with central meridian through the center of the coordinates on a WGS 84 datum.
- ctx (
-
elevation
() → int:¶ Get elevation correction method
Returns: PJ_ELEVATION constants Return type: int New in version 5.1.0.
Note:
To determine the model in use, refer to the datum_trf column in the usercsvdatumtrf.csv file. The datum and geoid model are named in the sqare brackets following the transform name as follows: name [datum_model:geoid] The datum_model is the name of the datum transformation model which will be in a file with extension .ll2 in the etc directory. The geoid is the name of the geoid model which will be in a grid file with extension .grd in the etc directory. If the geoid model is missing, this method will return PJ_ELEVATION_NONE and elevation coordinates will not be changed.
-
is_input_ll
() → int:¶ Is the input projection a lat/long.
Returns: 1 - Yes 0 - No Return type: int New in version 5.0.0.
-
is_null
() → bool¶ Check if the instance of
geosoft.gx.GXPJ is null (undefined)
Returns: True if this is a null instance of geosoft.gx.GXPJ
, False otherwise.Return type: bool`
-
is_output_ll
() → int:¶ Is the output projection a lat/long.
Returns: 1 - Yes 0 - No Return type: int New in version 5.0.0.
-
static
null
() → GXPJ¶ A null (undefined) instance of
geosoft.gx.GXPJ
Returns: A null geosoft.gx.GXPJ
Return type: geosoft.gx.GXPJ
-
project_bounding_rectangle
((float_ref)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4) → None:¶ Project a bounding rectangle.
Parameters: - arg1 (
geosoft.gx.float_ref
) – Bounding Region Min X - arg2 (
geosoft.gx.float_ref
) – Bounding Region Min Y - arg3 (
geosoft.gx.float_ref
) – Bounding Region Max X - arg4 (
geosoft.gx.float_ref
) – Bounding Region Max Y
Returns: Nothing
Return type: None
New in version 5.1.4.
Note:
A rectangular area from (dMinX, dMinY) to (dMaxX, dMaxY) is projected throught the PJ. The resulting region area is then digitized along its edges and a new bounding rectangle is computed. If there is a lot of curve through the projection the resulting bounding region may be slightly smaller than the true region.
- arg1 (
-
project_bounding_rectangle2
((float_ref)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4, (float)arg5) → None:¶ Project a bounding rectangle with error tolerance.
Parameters: - arg1 (
geosoft.gx.float_ref
) – Bounding Region Min X - arg2 (
geosoft.gx.float_ref
) – Bounding Region Min Y - arg3 (
geosoft.gx.float_ref
) – Bounding Region Max X - arg4 (
geosoft.gx.float_ref
) – Bounding Region Max Y - arg5 (float) – maximum allowable projection error if <= 0.0, will use 0.005% of smallest dimension
Returns: Nothing
Return type: None
New in version 6.0.1.
Note:
This is the same as
geosoft.gx.GXPJ.project_bounding_rectangle()
except that the bounding rectangle will be limited to an area within which the projection can be performed to an accuracy better than the specified error tolerance.- arg1 (
-
project_bounding_rectangle_res
((float_ref)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4, (float_ref)arg5) → None:¶ Project a bounding rectangle with resolution.
Parameters: - arg1 (
geosoft.gx.float_ref
) – Bounding Region Min X - arg2 (
geosoft.gx.float_ref
) – Bounding Region Min Y - arg3 (
geosoft.gx.float_ref
) – Bounding Region Max X - arg4 (
geosoft.gx.float_ref
) – Bounding Region Max Y - arg5 (
geosoft.gx.float_ref
) – Resolution
Returns: Nothing
Return type: None
New in version 5.1.8.
Note:
This function behaves just like ProjBoundingRectangle_PJ except that it also computes an approximate resolution at the reprojected coordinate system from a given original resolution.
- arg1 (
-
project_bounding_rectangle_res2
((float_ref)arg1, (float_ref)arg2, (float_ref)arg3, (float_ref)arg4, (float_ref)arg5, (float)arg6) → None:¶ Project a bounding rectangle with resolution and error tolerance.
Parameters: - arg1 (
geosoft.gx.float_ref
) – Bounding Region Min X - arg2 (
geosoft.gx.float_ref
) – Bounding Region Min Y - arg3 (
geosoft.gx.float_ref
) – Bounding Region Max X - arg4 (
geosoft.gx.float_ref
) – Bounding Region Max Y - arg5 (
geosoft.gx.float_ref
) – Resolution - arg6 (float) – maximum allowable projection error if <= 0.0, will use 0.005% of smallest dimension
Returns: Nothing
Return type: None
New in version 6.0.1.
Note:
This is the same as
geosoft.gx.GXPJ.project_bounding_rectangle_res()
except that the bounding rectangle will be limited to an area within which the projection can be performed to an accuracy better than the specified error tolerance.- arg1 (
-
project_limited_bounding_rectangle
((float)arg1, (float)arg2, (float)arg3, (float)arg4, (float_ref)arg5, (float_ref)arg6, (float_ref)arg7, (float_ref)arg8) → None:¶ Project a bounding rectangle with limits.
Parameters: - arg1 (float) – Output limited bounding region Min X
- arg2 (float) – Min Y
- arg3 (float) – Max X
- arg4 (float) – Max Y
- arg5 (
geosoft.gx.float_ref
) – Bounding Region Min X - arg6 (
geosoft.gx.float_ref
) – Min Y - arg7 (
geosoft.gx.float_ref
) – Max X - arg8 (
geosoft.gx.float_ref
) – Max Y
Returns: Nothing
Return type: None
New in version 6.0.0.
Note:
The bounding rectangle will be limited to no larger than the area specified in the output projection. This is useful when projecting from limits that are unreasonable in the target projection.
-
setup_ldt
() → None:¶ Setup the PJ with LDT check.
Returns: Nothing Return type: None New in version 6.2.0.
Note:
By default, a PJ on the same datum will not apply a LDT, is intended for transformations between datums. However, in some instances you might want to convert between LDTs on the same datum, such as when you have two sets of coordinates that you KNOW came from WGS84 and were placed on this datum using differnt LDT's. If you want to combine such coordinate systems, one or the other should be converted to the other's LDT. Note that a more logical way to do this would be to convert both sets back to their original WGS84 coordinates and combine in WGS84.
-
PJ_ELEVATION constants¶
elevation correction method
-
gx.
PJ_ELEVATION_NONE
= 0¶
elevation transform not supported.
-
gx.
PJ_ELEVATION_GEOCENTRIC
= 1¶
elevation transformation uses earth-centre shift
and is not accurate.
-
gx.
PJ_ELEVATION_GEOID
= 2¶
elevation transformation uses a geoid model
and is as accurate as the geoid data.