GXPJ class¶
- class GXPJ(handle=0)[source]¶
GXPJ class.
The
GXPJ
object is created from twoGXIPJ
objects, and is used for converting data in an OASIS database or map object from one map coordinate (projection) system to another.- clip_ply(min_x, min_y, max_x, max_y, max_dev, pply)[source]¶
Create a clip polygon from a projected area.
- Parameters:
New in version 5.0.
License: Geosoft Open License
Note: A rectangular area from (MinX, MinY) to (MaxX, MaxY) is projected throught the
GXPJ
. 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(vv_x, vv_y)[source]¶
Convert VVx/VVy from input projection to output projection.
New in version 5.0.
License: Geosoft Open License
Note: This function is equivalent to
GXVV.project
.
- convert_vv3(vv_x, vv_y, vv_z)[source]¶
Convert VVx/VVy/VVz projections
New in version 5.0.
License: Geosoft Open License
Note: This function is equivalent to
GXVV.project_3d
.
- convert_xy(x, y)[source]¶
Convert X, Y from input projection to output projection.
New in version 5.0.
License: Geosoft Open License
- convert_xy_from_xyz(x, y, z)[source]¶
Convert X, Y from input projection to output projection, taking Z into account
- Parameters:
New in version 7.3.
License: Geosoft Open License
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
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 normalconvert_xy
assumes a value of Z=0 internally and callsconvert_xyz
.
- convert_xyz(x, y, z)[source]¶
Convert X,Y,Z from input projection to output projection.
- Parameters:
New in version 6.3.
License: Geosoft Open License
- classmethod create(input, output)[source]¶
This method creates a projection object.
- Parameters:
input (str) – Input PRJ file name, “” for geodetic
output (str) – Ouput PRJ file name, “” for geodetic
- Returns:
GXPJ
Object- Return type:
New in version 5.0.
License: Geosoft Open License
- classmethod create_ipj(ip_jin, ip_jout)[source]¶
This method creates a projection object from IPJs.
- Parameters:
- Returns:
GXPJ
Object- Return type:
New in version 5.0.
License: Geosoft Open License
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 (
GXIPJ
)0.
- classmethod create_rectified(lon, lat, x, y, rot, scl, dir)[source]¶
Create a rectified
GXPJ
from lon,lat,rotation- Parameters:
lon (float) – Longitude at (X,Y) origin
lat (float) – Latitude at (X,Y) origin
x (float) – (X,Y) origin
rot (float) – Coordinate Y relative to geographic N (deg azm)
scl (float) – Scale to convert X,Y to m.
dir (int) – PJ_RECT constants
- Returns:
GXPJ
Object- Return type:
New in version 5.0.
License: Geosoft Open License
Note: Given an X,Y coordinate system, the lat/lon origin and angle of the coordinate system, this will create a
GXPJ
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()[source]¶
Get elevation correction method
- Returns:
- Return type:
int
New in version 5.1.
License: Geosoft Open License
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()[source]¶
Is the input projection a lat/long.
- Returns:
1 - Yes 0 - No
- Return type:
int
New in version 5.0.
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
- is_output_ll()[source]¶
Is the output projection a lat/long.
- Returns:
1 - Yes 0 - No
- Return type:
int
New in version 5.0.
License: Geosoft Open License
- project_bounding_rectangle(min_x, min_y, max_x, max_y)[source]¶
Project a bounding rectangle.
- Parameters:
New in version 5.1.4.
License: Geosoft Open License
Note: A rectangular area from (dMinX, dMinY) to (dMaxX, dMaxY) is projected throught the
GXPJ
. 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(min_x, min_y, max_x, max_y, err)[source]¶
Project a bounding rectangle with error tolerance.
- Parameters:
New in version 6.0.1.
License: Geosoft Open License
Note: This is the same as
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(min_x, min_y, max_x, max_y, res)[source]¶
Project a bounding rectangle with resolution.
- Parameters:
New in version 5.1.8.
License: Geosoft Open License
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(min_x, min_y, max_x, max_y, res, err)[source]¶
Project a bounding rectangle with resolution and error tolerance.
- Parameters:
New in version 6.0.1.
License: Geosoft Open License
Note: This is the same as
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_bounding_volume(min_x, min_y, min_z, max_x, max_y, max_z)[source]¶
Project a bounding volume.
- Parameters:
New in version 9.4.
License: Geosoft Open License
- project_limited_bounding_rectangle(min_xl, min_yl, max_xl, max_yl, min_x, min_y, max_x, max_y)[source]¶
Project a bounding rectangle with limits.
- Parameters:
New in version 6.0.
License: Geosoft Open License
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.
See also
- setup_ldt()[source]¶
Setup the
GXPJ
with LDT check.New in version 6.2.
License: Geosoft Open License
Note: By default, a
GXPJ
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
PJ_RECT constants¶
Conversion direction