PROJ C++ API
|
#include <stddef.h>
Go to the source code of this file.
Typedefs | |
typedef char ** | PROJ_STRING_LIST |
Type representing a NULL terminated list of NUL-terminate strings. | |
Enumerations | |
enum | PJ_OBJ_CATEGORY { PJ_OBJ_CATEGORY_ELLIPSOID, PJ_OBJ_CATEGORY_DATUM, PJ_OBJ_CATEGORY_CRS, PJ_OBJ_CATEGORY_COORDINATE_OPERATION } |
Object category. | |
enum | PJ_OBJ_TYPE { PJ_OBJ_TYPE_ELLIPSOID, PJ_OBJ_TYPE_GEODETIC_REFERENCE_FRAME, PJ_OBJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME, PJ_OBJ_TYPE_VERTICAL_REFERENCE_FRAME, PJ_OBJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME, PJ_OBJ_TYPE_DATUM_ENSEMBLE, PJ_OBJ_TYPE_GEODETIC_CRS, PJ_OBJ_TYPE_GEOGRAPHIC_CRS, PJ_OBJ_TYPE_VERTICAL_CRS, PJ_OBJ_TYPE_PROJECTED_CRS, PJ_OBJ_TYPE_COMPOUND_CRS, PJ_OBJ_TYPE_TEMPORAL_CRS, PJ_OBJ_TYPE_BOUND_CRS, PJ_OBJ_TYPE_OTHER_CRS, PJ_OBJ_TYPE_CONVERSION, PJ_OBJ_TYPE_TRANSFORMATION, PJ_OBJ_TYPE_CONCATENATED_OPERATION, PJ_OBJ_TYPE_OTHER_COORDINATE_OPERATION, PJ_OBJ_TYPE_UNKNOWN } |
Object type. | |
enum | PJ_WKT_TYPE { PJ_WKT2_2018, PJ_WKT2_2018_SIMPLIFIED, PJ_WKT2_2015, PJ_WKT2_2015_SIMPLIFIED, PJ_WKT1_GDAL } |
WKT version. More... | |
enum | PJ_PROJ_STRING_TYPE { PJ_PROJ_5, PJ_PROJ_4 } |
PROJ string version. More... | |
enum | PROJ_CRS_EXTENT_USE { PJ_CRS_EXTENT_NONE, PJ_CRS_EXTENT_BOTH, PJ_CRS_EXTENT_INTERSECTION, PJ_CRS_EXTENT_SMALLEST } |
enum | PROJ_SPATIAL_CRITERION { PROJ_SPATIAL_CRITERION_STRICT_CONTAINMENT, PROJ_SPATIAL_CRITERION_PARTIAL_INTERSECTION } |
enum | PROJ_GRID_AVAILABILITY_USE { PROJ_GRID_AVAILABILITY_USED_FOR_SORTING, PROJ_GRID_AVAILABILITY_DISCARD_OPERATION_IF_MISSING_GRID, PROJ_GRID_AVAILABILITY_IGNORED } |
Functions | |
int | proj_context_set_database_path (PJ_CONTEXT *ctx, const char *dbPath, const char *const *auxDbPaths) |
Explicitly point to the main PROJ CRS and coordinate operation definition database ("proj.db"), and potentially auxiliary databases with same structure. More... | |
const char * | proj_context_get_database_path (PJ_CONTEXT *ctx) |
Returns the path to the database. More... | |
PJ_OBJ * | proj_obj_create_from_user_input (PJ_CONTEXT *ctx, const char *text) |
Instanciate an object from a WKT string, PROJ string or object code (like "EPSG:4326", "urn:ogc:def:crs:EPSG::4326", "urn:ogc:def:coordinateOperation:EPSG::1671"). More... | |
PJ_OBJ * | proj_obj_create_from_wkt (PJ_CONTEXT *ctx, const char *wkt) |
Instanciate an object from a WKT string. More... | |
PJ_OBJ * | proj_obj_create_from_proj_string (PJ_CONTEXT *ctx, const char *proj_string) |
Instanciate an object from a PROJ string. More... | |
PJ_OBJ * | proj_obj_create_from_database (PJ_CONTEXT *ctx, const char *auth_name, const char *code, PJ_OBJ_CATEGORY category, int usePROJAlternativeGridNames, const char *const *options) |
Instanciate an object from a database lookup. More... | |
void | proj_obj_unref (PJ_OBJ *obj) |
Drops a reference on an object. More... | |
PJ_OBJ_TYPE | proj_obj_get_type (PJ_OBJ *obj) |
Return the type of an object. More... | |
PROJ_STRING_LIST | proj_get_authorities_from_database (PJ_CONTEXT *ctx) |
Return the list of authorities used in the database. More... | |
PROJ_STRING_LIST | proj_get_codes_from_database (PJ_CONTEXT *ctx, const char *auth_name, PJ_OBJ_TYPE type, int allow_deprecated) |
Returns the set of authority codes of the given object type. More... | |
void | proj_free_string_list (PROJ_STRING_LIST list) |
int | proj_obj_is_crs (PJ_OBJ *obj) |
Return whether an object is a CRS. More... | |
const char * | proj_obj_get_name (PJ_OBJ *obj) |
Get the name of an object. More... | |
const char * | proj_obj_get_id_auth_name (PJ_OBJ *obj, int index) |
Get the authority name / codespace of an identifier of an object. More... | |
const char * | proj_obj_get_id_code (PJ_OBJ *obj, int index) |
Get the code of an identifier of an object. More... | |
const char * | proj_obj_as_wkt (PJ_OBJ *obj, PJ_WKT_TYPE type, const char *const *options) |
Get a WKT representation of an object. More... | |
const char * | proj_obj_as_proj_string (PJ_OBJ *obj, PJ_PROJ_STRING_TYPE type, const char *const *options) |
Get a PROJ string representation of an object. More... | |
PJ_OBJ * | proj_obj_get_source_crs (PJ_OBJ *obj) |
Return the base CRS of a BoundCRS or the source CRS of a CoordinateOperation. More... | |
PJ_OBJ * | proj_obj_get_target_crs (PJ_OBJ *obj) |
Return the hub CRS of a BoundCRS or the target CRS of a CoordinateOperation. More... | |
PJ_OPERATION_FACTORY_CONTEXT * | proj_create_operation_factory_context (PJ_CONTEXT *ctx, const char *authority) |
Instanciate a context for building coordinate operations between two CRS. More... | |
void | proj_operation_factory_context_unref (PJ_OPERATION_FACTORY_CONTEXT *ctxt) |
Drops a reference on an object. More... | |
void | proj_operation_factory_context_set_desired_accuracy (PJ_OPERATION_FACTORY_CONTEXT *ctxt, double accuracy) |
Set the desired accuracy of the resulting coordinate transformations. More... | |
void | proj_operation_factory_context_set_area_of_interest (PJ_OPERATION_FACTORY_CONTEXT *ctxt, double west_lon, double south_lat, double east_lon, double north_lat) |
Set the desired area of interest for the resulting coordinate transformations. More... | |
void | proj_operation_factory_context_set_crs_extent_use (PJ_OPERATION_FACTORY_CONTEXT *ctxt, PROJ_CRS_EXTENT_USE use) |
Set how source and target CRS extent should be used when considering if a transformation can be used (only takes effect if no area of interest is explicitly defined). More... | |
void | proj_operation_factory_context_set_spatial_criterion (PJ_OPERATION_FACTORY_CONTEXT *ctxt, PROJ_SPATIAL_CRITERION criterion) |
Set the spatial criterion to use when comparing the area of validity of coordinate operations with the area of interest / area of validity of source and target CRS. More... | |
void | proj_operation_factory_context_set_grid_availability_use (PJ_OPERATION_FACTORY_CONTEXT *ctxt, PROJ_GRID_AVAILABILITY_USE use) |
Set how grid availability is used. More... | |
void | proj_operation_factory_context_set_use_proj_alternative_grid_names (PJ_OPERATION_FACTORY_CONTEXT *ctxt, int usePROJNames) |
Set whether PROJ alternative grid names should be substituted to the official authority names. More... | |
void | proj_operation_factory_context_set_allow_use_intermediate_crs (PJ_OPERATION_FACTORY_CONTEXT *ctxt, int allow) |
Set whether an intermediate pivot CRS can be used for researching coordinate operations between a source and target CRS. More... | |
void | proj_operation_factory_context_set_allowed_intermediate_crs (PJ_OPERATION_FACTORY_CONTEXT *ctxt, const char *const *list_of_auth_name_codes) |
Restrict the potential pivot CRSs that can be used when trying to build a coordinate operation between two CRS that have no direct operation. More... | |
PJ_OPERATION_RESULT * | proj_obj_create_operations (PJ_OBJ *source_crs, PJ_OBJ *target_crs, PJ_OPERATION_FACTORY_CONTEXT *operationContext) |
Find a list of CoordinateOperation from source_crs to target_crs. More... | |
int | proj_operation_result_get_count (PJ_OPERATION_RESULT *result) |
Return the number of CoordinateOperation in the result set. More... | |
PJ_OBJ * | proj_operation_result_get (PJ_OPERATION_RESULT *result, int index) |
Return a CoordinateOperation in the result set. More... | |
void | proj_operation_result_unref (PJ_OPERATION_RESULT *result) |
Drops a reference on an object. More... | |
PJ_OBJ * | proj_obj_crs_get_geodetic_crs (PJ_OBJ *crs) |
Get the geodeticCRS / geographicCRS from a CRS. More... | |
PJ_OBJ * | proj_obj_crs_get_horizontal_datum (PJ_OBJ *crs) |
Get the horizontal datum from a CRS. More... | |
PJ_OBJ * | proj_obj_crs_get_sub_crs (PJ_OBJ *crs, int index) |
Get a CRS component from a CompoundCRS. More... | |
PJ_OBJ * | proj_obj_crs_create_bound_crs_to_WGS84 (PJ_OBJ *crs) |
Returns potentially a BoundCRS, with a transformation to EPSG:4326, wrapping this CRS. More... | |
PJ_OBJ * | proj_obj_get_ellipsoid (PJ_OBJ *obj) |
Get the ellipsoid from a CRS or a GeodeticReferenceFrame. More... | |
int | proj_obj_ellipsoid_get_parameters (PJ_OBJ *ellipsoid, double *pSemiMajorMetre, double *pSemiMinorMetre, int *pIsSemiMinorComputed, double *pInverseFlattening) |
Return ellipsoid parameters. More... | |
PJ_OBJ * | proj_obj_get_prime_meridian (PJ_OBJ *obj) |
Get the prime meridian of a CRS or a GeodeticReferenceFrame. More... | |
int | proj_obj_prime_meridian_get_parameters (PJ_OBJ *prime_meridian, double *pLongitude, double *pLongitudeUnitConvFactor, const char **pLongitudeUnitName) |
Return prime meridian parameters. More... | |
PJ_OBJ * | proj_obj_crs_get_coordoperation (PJ_OBJ *crs, const char **pMethodName, const char **pMethodAuthorityName, const char **pMethodCode) |
Return the Conversion of a DerivedCRS (such as a ProjectedCRS), or the Transformation from the baseCRS to the hubCRS of a BoundCRS. More... | |
int | proj_coordoperation_is_instanciable (PJ_OBJ *coordoperation) |
Return whether a coordinate operation can be instanciated as a PROJ pipeline, checking in particular that referenced grids are available. More... | |
int | proj_coordoperation_get_param_count (PJ_OBJ *coordoperation) |
Return the number of parameters of a SingleOperation. More... | |
int | proj_coordoperation_get_param_index (PJ_OBJ *coordoperation, const char *name) |
Return the index of a parameter of a SingleOperation. More... | |
int | proj_coordoperation_get_param (PJ_OBJ *coordoperation, int index, const char **pName, const char **pNameAuthorityName, const char **pNameCode, double *pValue, const char **pValueString, double *pValueUnitConvFactor, const char **pValueUnitName) |
Return a parameter of a SingleOperation. More... | |
int | proj_coordoperation_get_grid_used_count (PJ_OBJ *coordoperation) |
Return the number of grids used by a CoordinateOperation. More... | |
int | proj_coordoperation_get_grid_used (PJ_OBJ *coordoperation, int index, const char **pShortName, const char **pFullName, const char **pPackageName, const char **pURL, int *pDirectDownload, int *pOpenLicense, int *pAvailable) |
Return a parameter of a SingleOperation. More... | |
C API new generation
enum PJ_PROJ_STRING_TYPE |
enum PJ_WKT_TYPE |
WKT version.
Enumerator | |
---|---|
PJ_WKT2_2018 | |
PJ_WKT2_2018_SIMPLIFIED |
cf osgeo::proj::io::WKTFormatter::Convention::WKT2_2018_SIMPLIFIED |
PJ_WKT2_2015 | |
PJ_WKT2_2015_SIMPLIFIED |
cf osgeo::proj::io::WKTFormatter::Convention::WKT2_SIMPLIFIED |
PJ_WKT1_GDAL |
enum PROJ_CRS_EXTENT_USE |
Specify how source and target CRS extent should be used to restrict candidate operations (only taken into account if no explicit area of interest is specified.
Describe how grid availability is used.
Spatial criterion to restrict candiate operations.
const char* proj_context_get_database_path | ( | PJ_CONTEXT * | ctx | ) |
Returns the path to the database.
The returned pointer remains valid while ctx is valid, and until proj_context_set_database_path() is called.
ctx | PROJ context, or NULL for default context |
int proj_context_set_database_path | ( | PJ_CONTEXT * | ctx, |
const char * | dbPath, | ||
const char *const * | auxDbPaths | ||
) |
Explicitly point to the main PROJ CRS and coordinate operation definition database ("proj.db"), and potentially auxiliary databases with same structure.
ctx | PROJ context, or NULL for default context |
dbPath | Path to main database, or NULL for default. |
auxDbPaths | NULL-terminated list of auxiliary database filenames, or NULL. |
int proj_coordoperation_get_grid_used | ( | PJ_OBJ * | coordoperation, |
int | index, | ||
const char ** | pShortName, | ||
const char ** | pFullName, | ||
const char ** | pPackageName, | ||
const char ** | pURL, | ||
int * | pDirectDownload, | ||
int * | pOpenLicense, | ||
int * | pAvailable | ||
) |
Return a parameter of a SingleOperation.
coordoperation | Objet of type SingleOperation or derived classes (must not be NULL) |
index | Parameter index. |
pShortName | Pointer to a string value to store the grid short name. or NULL |
pFullName | Pointer to a string value to store the grid full filename. or NULL |
pPackageName | Pointer to a string value to store the package name where the grid might be found. or NULL |
pURL | Pointer to a string value to store the grid URL or the package URL where the grid might be found. or NULL |
pDirectDownload | Pointer to a int (boolean) value to store whether *pURL can be downloaded directly. or NULL |
pOpenLicense | Pointer to a int (boolean) value to store whether the grid is released with an open license. or NULL |
pAvailable | Pointer to a int (boolean) value to store whether the grid is available at runtime. or NULL |
int proj_coordoperation_get_grid_used_count | ( | PJ_OBJ * | coordoperation | ) |
Return the number of grids used by a CoordinateOperation.
coordoperation | Objet of type CoordinateOperation or derived classes (must not be NULL) |
int proj_coordoperation_get_param | ( | PJ_OBJ * | coordoperation, |
int | index, | ||
const char ** | pName, | ||
const char ** | pNameAuthorityName, | ||
const char ** | pNameCode, | ||
double * | pValue, | ||
const char ** | pValueString, | ||
double * | pValueUnitConvFactor, | ||
const char ** | pValueUnitName | ||
) |
Return a parameter of a SingleOperation.
coordoperation | Objet of type SingleOperation or derived classes (must not be NULL) |
index | Parameter index. |
pName | Pointer to a string value to store the parameter name. or NULL |
pNameAuthorityName | Pointer to a string value to store the parameter authority name. or NULL |
pNameCode | Pointer to a string value to store the parameter code. or NULL |
pValue | Pointer to a double value to store the parameter value (if numeric). or NULL |
pValueString | Pointer to a string value to store the parameter value (if of type string). or NULL |
pValueUnitConvFactor | Pointer to a double value to store the parameter unit conversion factor. or NULL |
pValueUnitName | Pointer to a string value to store the parameter unit name. or NULL |
int proj_coordoperation_get_param_count | ( | PJ_OBJ * | coordoperation | ) |
Return the number of parameters of a SingleOperation.
coordoperation | Objet of type SingleOperation or derived classes (must not be NULL) |
int proj_coordoperation_get_param_index | ( | PJ_OBJ * | coordoperation, |
const char * | name | ||
) |
Return the index of a parameter of a SingleOperation.
coordoperation | Objet of type SingleOperation or derived classes (must not be NULL) |
name | Parameter name. Must not be NULL |
int proj_coordoperation_is_instanciable | ( | PJ_OBJ * | coordoperation | ) |
Return whether a coordinate operation can be instanciated as a PROJ pipeline, checking in particular that referenced grids are available.
coordoperation | Objet of type CoordinateOperation or derived classes (must not be NULL) |
PJ_OPERATION_FACTORY_CONTEXT* proj_create_operation_factory_context | ( | PJ_CONTEXT * | ctx, |
const char * | authority | ||
) |
Instanciate a context for building coordinate operations between two CRS.
The returned object must be unreferenced with proj_operation_factory_context_unref() after use.
ctx | Context, or NULL for default context. |
authority | Name of authority to which to restrict the search of canidate operations. Or NULL to allow any authority. |
void proj_free_string_list | ( | PROJ_STRING_LIST | list | ) |
Free a list of NULL terminated strings.
PROJ_STRING_LIST proj_get_authorities_from_database | ( | PJ_CONTEXT * | ctx | ) |
Return the list of authorities used in the database.
The returned list is NULL terminated and must be freed with proj_free_string_list().
ctx | PROJ context, or NULL for default context |
PROJ_STRING_LIST proj_get_codes_from_database | ( | PJ_CONTEXT * | ctx, |
const char * | auth_name, | ||
PJ_OBJ_TYPE | type, | ||
int | allow_deprecated | ||
) |
Returns the set of authority codes of the given object type.
The returned list is NULL terminated and must be freed with proj_free_string_list().
ctx | PROJ context, or NULL for default context. |
auth_name | Authority name (must not be NULL) |
type | Object type. |
allow_deprecated | whether we should return deprecated objects as well. |
const char* proj_obj_as_proj_string | ( | PJ_OBJ * | obj, |
PJ_PROJ_STRING_TYPE | type, | ||
const char *const * | options | ||
) |
Get a PROJ string representation of an object.
The lifetime of the returned string is the same as the input obj parameter.
This function calls osgeo::proj::io::IPROJStringExportable::exportToPROJString().
This function may return NULL if the object is not compatible with an export to the requested type.
obj | Object (must not be NULL) |
type | PROJ String version. |
options | NULL-terminated list of strings with "KEY=VALUE" format. or NULL. The currently recognized option is USE_ETMERC=YES to use +proj=etmerc instead of +proj=tmerc |
const char* proj_obj_as_wkt | ( | PJ_OBJ * | obj, |
PJ_WKT_TYPE | type, | ||
const char *const * | options | ||
) |
Get a WKT representation of an object.
The lifetime of the returned string is the same as the input obj parameter.
This function calls osgeo::proj::io::IWKTExportable::exportToWKT().
This function may return NULL if the object is not compatible with an export to the requested type.
obj | Object (must not be NULL) |
type | WKT version. |
options | should be set to NULL for now |
PJ_OBJ* proj_obj_create_from_database | ( | PJ_CONTEXT * | ctx, |
const char * | auth_name, | ||
const char * | code, | ||
PJ_OBJ_CATEGORY | category, | ||
int | usePROJAlternativeGridNames, | ||
const char *const * | options | ||
) |
Instanciate an object from a database lookup.
The returned object must be unreferenced with proj_obj_unref() after use. It should be used by at most one thread at a time.
ctx | Context, or NULL for default context. |
auth_name | Authority name (must not be NULL) |
code | Object code (must not be NULL) |
category | Object category |
usePROJAlternativeGridNames | Whether PROJ alternative grid names should be substituted to the official grid names. Only used on transformations |
options | should be set to NULL for now |
PJ_OBJ* proj_obj_create_from_proj_string | ( | PJ_CONTEXT * | ctx, |
const char * | proj_string | ||
) |
Instanciate an object from a PROJ string.
This function calls osgeo::proj::io::PROJStringParser::createFromPROJString()
The returned object must be unreferenced with proj_obj_unref() after use. It should be used by at most one thread at a time.
ctx | PROJ context, or NULL for default context |
proj_string | PROJ string (must not be NULL) |
PJ_OBJ* proj_obj_create_from_user_input | ( | PJ_CONTEXT * | ctx, |
const char * | text | ||
) |
Instanciate an object from a WKT string, PROJ string or object code (like "EPSG:4326", "urn:ogc:def:crs:EPSG::4326", "urn:ogc:def:coordinateOperation:EPSG::1671").
This function calls osgeo::proj::io::createFromUserInput()
The returned object must be unreferenced with proj_obj_unref() after use. It should be used by at most one thread at a time.
ctx | PROJ context, or NULL for default context |
text | String (must not be NULL) |
PJ_OBJ* proj_obj_create_from_wkt | ( | PJ_CONTEXT * | ctx, |
const char * | wkt | ||
) |
Instanciate an object from a WKT string.
This function calls osgeo::proj::io::WKTParser::createFromWKT()
The returned object must be unreferenced with proj_obj_unref() after use. It should be used by at most one thread at a time.
ctx | PROJ context, or NULL for default context |
wkt | WKT string (must not be NULL) |
PJ_OPERATION_RESULT* proj_obj_create_operations | ( | PJ_OBJ * | source_crs, |
PJ_OBJ * | target_crs, | ||
PJ_OPERATION_FACTORY_CONTEXT * | operationContext | ||
) |
Find a list of CoordinateOperation from source_crs to target_crs.
The operations are sorted with the most relevant ones first: by descending area (intersection of the transformation area with the area of interest, or intersection of the transformation with the area of use of the CRS), and by increasing accuracy. Operations with unknown accuracy are sorted last, whatever their area.
source_crs | source CRS. Must not be NULL. |
target_crs | source CRS. Must not be NULL. |
operationContext | Search context. Must not be NULL. |
Returns potentially a BoundCRS, with a transformation to EPSG:4326, wrapping this CRS.
The returned object must be unreferenced with proj_obj_unref() after use. It should be used by at most one thread at a time.
This is the same as method osgeo::proj::crs::CRS::createBoundCRSToWGS84IfPossible()
crs | Objet of type CRS (must not be NULL) |
PJ_OBJ* proj_obj_crs_get_coordoperation | ( | PJ_OBJ * | crs, |
const char ** | pMethodName, | ||
const char ** | pMethodAuthorityName, | ||
const char ** | pMethodCode | ||
) |
Return the Conversion of a DerivedCRS (such as a ProjectedCRS), or the Transformation from the baseCRS to the hubCRS of a BoundCRS.
The returned object must be unreferenced with proj_obj_unref() after use. It should be used by at most one thread at a time.
crs | Objet of type DerivedCRS or BoundCRSs (must not be NULL) |
pMethodName | Pointer to a string value to store the method (projection) name. or NULL |
pMethodAuthorityName | Pointer to a string value to store the method authority name. or NULL |
pMethodCode | Pointer to a string value to store the method code. or NULL |
Get the geodeticCRS / geographicCRS from a CRS.
The returned object must be unreferenced with proj_obj_unref() after use. It should be used by at most one thread at a time.
crs | Objet of type CRS (must not be NULL) |
Get the horizontal datum from a CRS.
The returned object must be unreferenced with proj_obj_unref() after use. It should be used by at most one thread at a time.
crs | Objet of type CRS (must not be NULL) |
Get a CRS component from a CompoundCRS.
The returned object must be unreferenced with proj_obj_unref() after use. It should be used by at most one thread at a time.
crs | Objet of type CRS (must not be NULL) |
index | Index of the CRS component (typically 0 = horizontal, 1 = vertical) |
int proj_obj_ellipsoid_get_parameters | ( | PJ_OBJ * | ellipsoid, |
double * | pSemiMajorMetre, | ||
double * | pSemiMinorMetre, | ||
int * | pIsSemiMinorComputed, | ||
double * | pInverseFlattening | ||
) |
Return ellipsoid parameters.
ellipsoid | Object of type Ellipsoid (must not be NULL) |
pSemiMajorMetre | Pointer to a value to store the semi-major axis in metre. or NULL |
pSemiMinorMetre | Pointer to a value to store the semi-minor axis in metre. or NULL |
pIsSemiMinorComputed | Pointer to a boolean value to indicate if the semi-minor value was computed. If FALSE, its value comes from the definition. or NULL |
pInverseFlattening | Pointer to a value to store the inverse flattening. or NULL |
Get the ellipsoid from a CRS or a GeodeticReferenceFrame.
The returned object must be unreferenced with proj_obj_unref() after use. It should be used by at most one thread at a time.
obj | Objet of type CRS or GeodeticReferenceFrame (must not be NULL) |
const char* proj_obj_get_id_auth_name | ( | PJ_OBJ * | obj, |
int | index | ||
) |
Get the authority name / codespace of an identifier of an object.
The lifetime of the returned string is the same as the input obj parameter.
obj | Object (must not be NULL) |
index | Index of the identifier. 0 = first identifier |
const char* proj_obj_get_id_code | ( | PJ_OBJ * | obj, |
int | index | ||
) |
Get the code of an identifier of an object.
The lifetime of the returned string is the same as the input obj parameter.
obj | Object (must not be NULL) |
index | Index of the identifier. 0 = first identifier |
const char* proj_obj_get_name | ( | PJ_OBJ * | obj | ) |
Get the name of an object.
The lifetime of the returned string is the same as the input obj parameter.
obj | Object (must not be NULL) |
Get the prime meridian of a CRS or a GeodeticReferenceFrame.
The returned object must be unreferenced with proj_obj_unref() after use. It should be used by at most one thread at a time.
obj | Objet of type CRS or GeodeticReferenceFrame (must not be NULL) |
Return the base CRS of a BoundCRS or the source CRS of a CoordinateOperation.
The returned object must be unreferenced with proj_obj_unref() after use. It should be used by at most one thread at a time.
obj | Objet of type BoundCRS or CoordinateOperation (must not be NULL) |
Return the hub CRS of a BoundCRS or the target CRS of a CoordinateOperation.
The returned object must be unreferenced with proj_obj_unref() after use. It should be used by at most one thread at a time.
obj | Objet of type BoundCRS or CoordinateOperation (must not be NULL) |
PJ_OBJ_TYPE proj_obj_get_type | ( | PJ_OBJ * | obj | ) |
Return the type of an object.
obj | Object (must not be NULL) |
int proj_obj_is_crs | ( | PJ_OBJ * | obj | ) |
Return whether an object is a CRS.
obj | Object (must not be NULL) |
int proj_obj_prime_meridian_get_parameters | ( | PJ_OBJ * | prime_meridian, |
double * | pLongitude, | ||
double * | pLongitudeUnitConvFactor, | ||
const char ** | pLongitudeUnitName | ||
) |
Return prime meridian parameters.
prime_meridian | Object of type PrimeMeridian (must not be NULL) |
pLongitude | Pointer to a value to store the longitude of the prime meridian, in its native unit. or NULL |
pLongitudeUnitConvFactor | Pointer to a value to store the conversion factor of the prime meridian longitude unit to radian. or NULL |
pLongitudeUnitName | Pointer to a string value to store the unit name. or NULL |
void proj_obj_unref | ( | PJ_OBJ * | obj | ) |
Drops a reference on an object.
This method should be called one and exactly one for each function returning a PJ_OBJ*
obj | Object, or NULL. |
void proj_operation_factory_context_set_allow_use_intermediate_crs | ( | PJ_OPERATION_FACTORY_CONTEXT * | ctxt, |
int | allow | ||
) |
Set whether an intermediate pivot CRS can be used for researching coordinate operations between a source and target CRS.
Concretely if in the database there is an operation from A to C (or C to A), and another one from C to B (or B to C), but no direct operation between A and B, setting this parameter to true, allow chaining both operations.
The current implementation is limited to researching one intermediate step.
By default, all potential C candidates will be used. proj_operation_factory_context_set_allowed_intermediate_crs() can be used to restrict them.
The default is true.
ctxt | Operation factory context. must not be NULL |
allow | whether intermediate CRS may be used. |
void proj_operation_factory_context_set_allowed_intermediate_crs | ( | PJ_OPERATION_FACTORY_CONTEXT * | ctxt, |
const char *const * | list_of_auth_name_codes | ||
) |
Restrict the potential pivot CRSs that can be used when trying to build a coordinate operation between two CRS that have no direct operation.
ctxt | Operation factory context. must not be NULL |
list_of_auth_name_codes | an array of strings NLL terminated, with the format { "auth_name1", "code1", "auth_name2", "code2", ... NULL } |
void proj_operation_factory_context_set_area_of_interest | ( | PJ_OPERATION_FACTORY_CONTEXT * | ctxt, |
double | west_lon, | ||
double | south_lat, | ||
double | east_lon, | ||
double | north_lat | ||
) |
Set the desired area of interest for the resulting coordinate transformations.
For an area of interest crossing the anti-meridian, west_lon will be greater than east_lon.
ctxt | Operation factory context. must not be NULL |
west_lon | West longitude (in degrees). |
south_lat | South latitude (in degrees). |
east_lon | East longitude (in degrees). |
north_lat | North latitude (in degrees). |
void proj_operation_factory_context_set_crs_extent_use | ( | PJ_OPERATION_FACTORY_CONTEXT * | ctxt, |
PROJ_CRS_EXTENT_USE | use | ||
) |
Set how source and target CRS extent should be used when considering if a transformation can be used (only takes effect if no area of interest is explicitly defined).
The default is PJ_CRS_EXTENT_SMALLEST.
ctxt | Operation factory context. must not be NULL |
use | How source and target CRS extent should be used. |
void proj_operation_factory_context_set_desired_accuracy | ( | PJ_OPERATION_FACTORY_CONTEXT * | ctxt, |
double | accuracy | ||
) |
Set the desired accuracy of the resulting coordinate transformations.
ctxt | Operation factory context. must not be NULL |
accuracy | Accuracy in meter (or 0 to disable the filter). |
void proj_operation_factory_context_set_grid_availability_use | ( | PJ_OPERATION_FACTORY_CONTEXT * | ctxt, |
PROJ_GRID_AVAILABILITY_USE | use | ||
) |
Set how grid availability is used.
The default is USE_FOR_SORTING.
ctxt | Operation factory context. must not be NULL |
use | how grid availability is used. |
void proj_operation_factory_context_set_spatial_criterion | ( | PJ_OPERATION_FACTORY_CONTEXT * | ctxt, |
PROJ_SPATIAL_CRITERION | criterion | ||
) |
Set the spatial criterion to use when comparing the area of validity of coordinate operations with the area of interest / area of validity of source and target CRS.
The default is PROJ_SPATIAL_CRITERION_STRICT_CONTAINMENT.
ctxt | Operation factory context. must not be NULL |
criterion | patial criterion to use |
void proj_operation_factory_context_set_use_proj_alternative_grid_names | ( | PJ_OPERATION_FACTORY_CONTEXT * | ctxt, |
int | usePROJNames | ||
) |
Set whether PROJ alternative grid names should be substituted to the official authority names.
The default is true.
ctxt | Operation factory context. must not be NULL |
usePROJNames | whether PROJ alternative grid names should be used |
void proj_operation_factory_context_unref | ( | PJ_OPERATION_FACTORY_CONTEXT * | ctxt | ) |
Drops a reference on an object.
This method should be called one and exactly one for each function returning a PJ_OPERATION_FACTORY_CONTEXT*
ctxt | Object, or NULL. |
PJ_OBJ* proj_operation_result_get | ( | PJ_OPERATION_RESULT * | result, |
int | index | ||
) |
Return a CoordinateOperation in the result set.
The returned object must be unreferenced with proj_obj_unref() after use. It should be used by at most one thread at a time.
result | Objet of type PJ_OPERATION_RESULT (must not be NULL) |
index | Index |
int proj_operation_result_get_count | ( | PJ_OPERATION_RESULT * | result | ) |
Return the number of CoordinateOperation in the result set.
result | Objet of type PJ_OPERATION_RESULT (must not be NULL) |
void proj_operation_result_unref | ( | PJ_OPERATION_RESULT * | result | ) |
Drops a reference on an object.
This method should be called one and exactly one for each function returning a PJ_OPERATION_RESULT*
result | Object, or NULL. |