120 #error proj.h must be included before projects.h 123 #error proj.h must be included before proj_api.h 141 #ifdef PROJ_MSVC_DLL_EXPORT 142 #define PROJ_DLL __declspec(dllexport) 143 #elif defined(PROJ_MSVC_DLL_IMPORT) 144 #define PROJ_DLL __declspec(dllimport) 151 #define PROJ_VERSION_MAJOR 6 152 #define PROJ_VERSION_MINOR 0 153 #define PROJ_VERSION_PATCH 0 155 extern char const pj_release[];
161 typedef union PJ_COORD PJ_COORD;
164 typedef struct PJ_AREA PJ_AREA;
167 double meridional_scale;
168 double parallel_scale;
171 double angular_distortion;
172 double meridian_parallel_angle;
173 double meridian_convergence;
175 double tissot_semimajor;
176 double tissot_semiminor;
178 double dx_dlam, dx_dphi;
179 double dy_dlam, dy_dphi;
181 typedef struct P5_FACTORS PJ_FACTORS;
185 typedef struct PJconsts PJ;
189 typedef struct PJ_INFO PJ_INFO;
192 typedef struct PJ_PROJ_INFO PJ_PROJ_INFO;
195 typedef struct PJ_GRID_INFO PJ_GRID_INFO;
198 typedef struct PJ_INIT_INFO PJ_INIT_INFO;
204 const char *
const *descr;
207 typedef struct PJ_LIST PJ_OPERATIONS;
215 typedef struct PJ_ELLPS PJ_ELLPS;
219 const char *to_meter;
223 typedef struct PJ_UNITS PJ_UNITS;
225 struct PJ_PRIME_MERIDIANS {
229 typedef struct PJ_PRIME_MERIDIANS PJ_PRIME_MERIDIANS;
233 typedef struct {
double x, y, z, t; } PJ_XYZT;
234 typedef struct {
double u, v, w, t; } PJ_UVWT;
235 typedef struct {
double lam, phi, z, t; } PJ_LPZT;
236 typedef struct {
double o, p, k; } PJ_OPK;
237 typedef struct {
double e, n, u; } PJ_ENU;
238 typedef struct {
double s, a1, a2; } PJ_GEOD;
241 typedef struct {
double u, v; } PJ_UV;
242 typedef struct {
double x, y; } PJ_XY;
243 typedef struct {
double lam, phi; } PJ_LP;
245 typedef struct {
double x, y, z; } PJ_XYZ;
246 typedef struct {
double u, v, w; } PJ_UVW;
247 typedef struct {
double lam, phi, z; } PJ_LPZ;
274 const char *searchpath;
277 const char *
const *paths;
281 struct PJ_PROJ_INFO {
283 const char *description;
284 const char *definition;
289 struct PJ_GRID_INFO {
296 double cs_lon, cs_lat;
299 struct PJ_INIT_INFO {
307 typedef enum PJ_LOG_LEVEL {
313 PJ_LOG_DEBUG_MAJOR = 2,
314 PJ_LOG_DEBUG_MINOR = 3
317 typedef void (*PJ_LOG_FUNCTION)(
void *, int,
const char *);
322 typedef struct projCtx_t PJ_CONTEXT;
328 #define PJ_DEFAULT_CTX 0 329 PJ_CONTEXT *proj_context_create (
void);
330 PJ_CONTEXT *proj_context_destroy (PJ_CONTEXT *ctx);
334 PJ *proj_create (PJ_CONTEXT *ctx,
const char *definition);
335 PJ *proj_create_argv (PJ_CONTEXT *ctx,
int argc,
char **argv);
336 PJ *proj_create_crs_to_crs(PJ_CONTEXT *ctx,
const char *srid_from,
const char *srid_to, PJ_AREA *area);
337 PJ *proj_destroy (PJ *P);
351 typedef enum PJ_DIRECTION PJ_DIRECTION;
354 int proj_angular_input (PJ *P,
enum PJ_DIRECTION dir);
355 int proj_angular_output (PJ *P,
enum PJ_DIRECTION dir);
358 PJ_COORD proj_trans (PJ *P, PJ_DIRECTION direction, PJ_COORD coord);
359 int proj_trans_array (PJ *P, PJ_DIRECTION direction,
size_t n, PJ_COORD *coord);
360 size_t proj_trans_generic (
362 PJ_DIRECTION direction,
363 double *x,
size_t sx,
size_t nx,
364 double *y,
size_t sy,
size_t ny,
365 double *z,
size_t sz,
size_t nz,
366 double *t,
size_t st,
size_t nt
371 PJ_COORD proj_coord (
double x,
double y,
double z,
double t);
374 double proj_roundtrip (PJ *P, PJ_DIRECTION direction,
int n, PJ_COORD *coord);
377 double proj_lp_dist (
const PJ *P, PJ_COORD a, PJ_COORD b);
380 double proj_lpz_dist (
const PJ *P, PJ_COORD a, PJ_COORD b);
383 double proj_xy_dist (PJ_COORD a, PJ_COORD b);
386 double proj_xyz_dist (PJ_COORD a, PJ_COORD b);
389 PJ_COORD proj_geod (
const PJ *P, PJ_COORD a, PJ_COORD b);
393 int proj_context_errno (PJ_CONTEXT *ctx);
394 int proj_errno (
const PJ *P);
395 int proj_errno_set (
const PJ *P,
int err);
396 int proj_errno_reset (
const PJ *P);
397 int proj_errno_restore (
const PJ *P,
int err);
398 const char* proj_errno_string (
int err);
400 PJ_LOG_LEVEL proj_log_level (PJ_CONTEXT *ctx, PJ_LOG_LEVEL log_level);
401 void proj_log_func (PJ_CONTEXT *ctx,
void *app_data, PJ_LOG_FUNCTION logf);
404 PJ_FACTORS proj_factors(PJ *P, PJ_COORD lp);
407 PJ_INFO proj_info(
void);
408 PJ_PROJ_INFO proj_pj_info(PJ *P);
409 PJ_GRID_INFO proj_grid_info(
const char *gridname);
410 PJ_INIT_INFO proj_init_info(
const char *initname);
414 const PJ_OPERATIONS *proj_list_operations(
void);
415 const PJ_ELLPS *proj_list_ellps(
void);
416 const PJ_UNITS *proj_list_units(
void);
417 const PJ_UNITS *proj_list_angular_units(
void);
418 const PJ_PRIME_MERIDIANS *proj_list_prime_meridians(
void);
423 double proj_torad (
double angle_in_degrees);
424 double proj_todeg (
double angle_in_radians);
427 PJ_COORD proj_geocentric_latitude (
const PJ *P, PJ_DIRECTION direction, PJ_COORD coord);
429 double proj_dmstor(
const char *is,
char **rs);
430 char* proj_rtodms(
char *s,
double r,
int pos,
int neg);
444 const char *
const *auxDbPaths);
454 const char *proj_string);
459 PJ_OBJ_CATEGORY_ELLIPSOID,
460 PJ_OBJ_CATEGORY_DATUM,
462 PJ_OBJ_CATEGORY_COORDINATE_OPERATION
466 const char *auth_name,
468 PJ_OBJ_CATEGORY category,
469 int usePROJAlternativeGridNames,
470 const char*
const *options);
477 PJ_OBJ_TYPE_ELLIPSOID,
479 PJ_OBJ_TYPE_GEODETIC_REFERENCE_FRAME,
480 PJ_OBJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME,
481 PJ_OBJ_TYPE_VERTICAL_REFERENCE_FRAME,
482 PJ_OBJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME,
483 PJ_OBJ_TYPE_DATUM_ENSEMBLE,
485 PJ_OBJ_TYPE_GEODETIC_CRS,
486 PJ_OBJ_TYPE_GEOGRAPHIC_CRS,
487 PJ_OBJ_TYPE_VERTICAL_CRS,
488 PJ_OBJ_TYPE_PROJECTED_CRS,
489 PJ_OBJ_TYPE_COMPOUND_CRS,
490 PJ_OBJ_TYPE_TEMPORAL_CRS,
491 PJ_OBJ_TYPE_BOUND_CRS,
492 PJ_OBJ_TYPE_OTHER_CRS,
494 PJ_OBJ_TYPE_CONVERSION,
495 PJ_OBJ_TYPE_TRANSFORMATION,
496 PJ_OBJ_TYPE_CONCATENATED_OPERATION,
497 PJ_OBJ_TYPE_OTHER_COORDINATE_OPERATION,
510 const char *auth_name,
512 int allow_deprecated);
544 const char*
const *options);
560 PJ_PROJ_STRING_TYPE type,
561 const char*
const *options);
575 const char *authority);
612 PROJ_CRS_EXTENT_USE use);
627 PROJ_SPATIAL_CRITERION criterion);
646 PROJ_GRID_AVAILABILITY_USE use);
657 const char*
const *list_of_auth_name_codes);
690 double *pSemiMajorMetre,
691 double *pSemiMinorMetre,
692 int *pIsSemiMinorComputed,
693 double *pInverseFlattening);
699 double *pLongitudeUnitConvFactor,
700 const char **pLongitudeUnitName);
703 const char **pMethodName,
704 const char **pMethodAuthorityName,
705 const char **pMethodCode);
717 const char **pNameAuthorityName,
718 const char **pNameCode,
720 const char **pValueString,
721 double *pValueUnitConvFactor,
722 const char **pValueUnitName);
728 const char **pShortName,
729 const char **pFullName,
730 const char **pPackageName,
732 int *pDirectDownload,
int proj_coordoperation_get_grid_used_count(PJ_OBJ *coordoperation)
Return the number of grids used by a CoordinateOperation.
Definition: c_api.cpp:1410
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 baseCR...
Definition: c_api.cpp:1170
const char * proj_obj_get_id_code(PJ_OBJ *obj, int index)
Get the code of an identifier of an object.
Definition: c_api.cpp:525
Opaque object representing an operation factory context.
Definition: c_api.cpp:1506
int proj_coordoperation_get_param_index(PJ_OBJ *coordoperation, const char *name)
Return the index of a parameter of a SingleOperation.
Definition: c_api.cpp:1269
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.
Definition: c_api.cpp:1601
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.
Definition: c_api.cpp:1809
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").
Definition: c_api.cpp:245
int proj_obj_is_crs(PJ_OBJ *obj)
Return whether an object is a CRS.
Definition: c_api.cpp:453
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...
Definition: c_api.cpp:195
PJ_OBJ_TYPE
Object type.
Definition: proj.h:475
PJ_OBJ * proj_obj_get_source_crs(PJ_OBJ *obj)
Return the base CRS of a BoundCRS or the source CRS of a CoordinateOperation.
Definition: c_api.cpp:944
int proj_obj_ellipsoid_get_parameters(PJ_OBJ *ellipsoid, double *pSemiMajorMetre, double *pSemiMinorMetre, int *pIsSemiMinorComputed, double *pInverseFlattening)
Return ellipsoid parameters.
Definition: c_api.cpp:833
PJ_OBJ * proj_obj_create_from_wkt(PJ_CONTEXT *ctx, const char *wkt)
Instanciate an object from a WKT string.
Definition: c_api.cpp:271
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.
Definition: c_api.cpp:1537
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.
Definition: c_api.cpp:1048
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.
Definition: c_api.cpp:620
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.
Definition: c_api.cpp:327
PJ_OBJ * proj_obj_crs_get_horizontal_datum(PJ_OBJ *crs)
Get the horizontal datum from a CRS.
Definition: c_api.cpp:799
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...
Definition: c_api.cpp:1716
PJ_PROJ_STRING_TYPE
PROJ string version.
Definition: proj.h:547
PJ_OBJ_CATEGORY
Object category.
Definition: proj.h:457
const char * proj_obj_get_id_auth_name(PJ_OBJ *obj, int index)
Get the authority name / codespace of an identifier of an object.
Definition: c_api.cpp:494
void proj_operation_factory_context_set_desired_accuracy(PJ_OPERATION_FACTORY_CONTEXT *ctxt, double accuracy)
Set the desired accuracy of the resulting coordinate transformations.
Definition: c_api.cpp:1581
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.
Definition: c_api.cpp:1314
PJ_WKT_TYPE
WKT version.
Definition: proj.h:525
void proj_operation_result_unref(PJ_OPERATION_RESULT *result)
Drops a reference on an object.
Definition: c_api.cpp:1884
PROJ_CRS_EXTENT_USE
Definition: proj.h:594
int proj_operation_result_get_count(PJ_OPERATION_RESULT *result)
Return the number of CoordinateOperation in the result set.
Definition: c_api.cpp:1847
int proj_coordoperation_is_instanciable(PJ_OBJ *coordoperation)
Return whether a coordinate operation can be instanciated as a PROJ pipeline, checking in particular ...
Definition: c_api.cpp:1223
int proj_obj_prime_meridian_get_parameters(PJ_OBJ *prime_meridian, double *pLongitude, double *pLongitudeUnitConvFactor, const char **pLongitudeUnitName)
Return prime meridian parameters.
Definition: c_api.cpp:906
Opaque object representing a set of operation results.
Definition: c_api.cpp:1775
PJ_OBJ * proj_obj_get_prime_meridian(PJ_OBJ *obj)
Get the prime meridian of a CRS or a GeodeticReferenceFrame.
Definition: c_api.cpp:875
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 th...
Definition: c_api.cpp:1658
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...
Definition: c_api.cpp:745
void proj_free_string_list(PROJ_STRING_LIST list)
Definition: c_api.cpp:1142
PROJ_GRID_AVAILABILITY_USE
Definition: proj.h:631
Opaque object representing a Ellipsoid, Datum, CRS or Coordinate Operation. Should be used by at most...
Definition: c_api.cpp:90
PROJ_STRING_LIST proj_get_authorities_from_database(PJ_CONTEXT *ctx)
Return the list of authorities used in the database.
Definition: c_api.cpp:1023
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 sou...
Definition: c_api.cpp:1744
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.
Definition: c_api.cpp:1683
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 ...
Definition: c_api.cpp:1620
PJ_OBJ_TYPE proj_obj_get_type(PJ_OBJ *obj)
Return the type of an object.
Definition: c_api.cpp:383
int proj_coordoperation_get_param_count(PJ_OBJ *coordoperation)
Return the number of parameters of a SingleOperation.
Definition: c_api.cpp:1248
PJ_OBJ * proj_obj_create_from_proj_string(PJ_CONTEXT *ctx, const char *proj_string)
Instanciate an object from a PROJ string.
Definition: c_api.cpp:296
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.
Definition: c_api.cpp:1459
void proj_operation_factory_context_unref(PJ_OPERATION_FACTORY_CONTEXT *ctxt)
Drops a reference on an object.
Definition: c_api.cpp:1571
PJ_OBJ * proj_obj_crs_get_sub_crs(PJ_OBJ *crs, int index)
Get a CRS component from a CompoundCRS.
Definition: c_api.cpp:715
PJ_OBJ * proj_obj_get_target_crs(PJ_OBJ *obj)
Return the hub CRS of a BoundCRS or the target CRS of a CoordinateOperation.
Definition: c_api.cpp:977
const char * proj_obj_get_name(PJ_OBJ *obj)
Get the name of an object.
Definition: c_api.cpp:467
PJ_OBJ * proj_obj_crs_get_geodetic_crs(PJ_OBJ *crs)
Get the geodeticCRS / geographicCRS from a CRS.
Definition: c_api.cpp:693
PROJ_SPATIAL_CRITERION
Definition: proj.h:615
void proj_obj_unref(PJ_OBJ *obj)
Drops a reference on an object.
Definition: c_api.cpp:374
PJ_OBJ * proj_obj_get_ellipsoid(PJ_OBJ *obj)
Get the ellipsoid from a CRS or a GeodeticReferenceFrame.
Definition: c_api.cpp:769
const char * proj_context_get_database_path(PJ_CONTEXT *ctx)
Returns the path to the database.
Definition: c_api.cpp:219
PJ_OBJ * proj_operation_result_get(PJ_OPERATION_RESULT *result, int index)
Return a CoordinateOperation in the result set.
Definition: c_api.cpp:1866
const char * proj_obj_as_wkt(PJ_OBJ *obj, PJ_WKT_TYPE type, const char *const *options)
Get a WKT representation of an object.
Definition: c_api.cpp:556
char ** PROJ_STRING_LIST
Type representing a NULL terminated list of NUL-terminate strings.
Definition: proj.h:505
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 betwee...
Definition: c_api.cpp:1759