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:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

This function is equivalent to geosoft.gx.GXVV.project().
convert_vv3((GXVV)arg1, (GXVV)arg2, (GXVV)arg3) → None:
Convert VVx/VVy/VVz projections
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

This function is equivalent to geosoft.gx.GXVV.project_3d().
convert_xy((float_ref)arg1, (float_ref)arg2) → None:
Convert X, Y from input projection to output projection.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

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:
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 normal geosoft.gx.GXPJ.convert_xy() assumes a value of Z=0 internally and calls
geosoft.gx.GXPJ.convert_xyz().
convert_xyz((float_ref)arg1, (float_ref)arg2, (float_ref)arg3) → None:
Convert X,Y,Z from input projection to output projection.
Parameters:
Returns:

Nothing

Return type:

None

New in version 6.3.0.

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:

geosoft.gx.GXPJ

New in version 5.0.0.

static create_ipj((GXContext)ctx, (GXIPJ)arg1, (GXIPJ)arg2) → GXPJ:
This method creates a projection object from IPJs.
Parameters:
Returns:

PJ Object

Return type:

geosoft.gx.GXPJ

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.
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:

geosoft.gx.GXPJ

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.
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:
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.
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:
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.
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:
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.
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:
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.
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:
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.

PJ_RECT constants

Conversion direction
gx.PJ_RECT_XY2LL = 0
gx.PJ_RECT_LL2XY = 1