Cartographic Projection Funtions

Albers Equal Area Projection (CSalber)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Alber Equal Area Conic Projection.

CSalberF Forward conversion

int CSalberF (Const struct cs_Alber_ *alber, double xy[2], Const double ll[ 2]);

Given a properly initialized cs_Alber_ structure via the alber argument, CSalberF will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSalberF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CSalberI Inverse conversion

int CSalberI (Const struct cs_Alber_ *alber, double ll[2], Const double xy[2]);

Given a properly initialized cs_Alber_ structure via the alber argument, CSalberI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSalberI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system, or cs_CNVRT_INDF if the result is indefinite (e.g. longitude is not defined at the poles).

In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are the first elements in these arrays, the Y coordinate and the latitude are the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSalberK grid scale (K) along parallel

double CSalberK (Const struct cs_Alber_ *alber, Const double ll[2]);

CSalberK returns the grid scale factor, along a parallel, of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array. (The use of the ll array is the same as described above.)

CSalberH grid scale (H) along meridian

double CSalberH(Const struct cs_Alber_ *alber, Const double ll[2]);

CSalberH returns the grid scale factor, along a meridian, of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array.

CSalberC Convergence angle

double CSalberC(Const struct cs_Alber_ *alber, Const double ll[2]);

CSalberC returns the convergence angle in degrees east of north of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array.

CSalberQ definition Quality check

int CSalberQ(Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list[], int list_sz);

CSalberQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Alber Equal Area Projection. CS_cschk examines those definition components that are common to all coordinates system (datum or ellipsoid reference, map scale, and units) and, therefore, CSalberQ only examines those components specific to the Alber Equal Area Projection. CSalberQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSalberQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CSalberL Latitude/longitude check

int CSalberL (Const struct cs_Alber_ *alber, int cnt, Const double pnts[][3]);

CSalberL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the alber argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSalbersL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSalberL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates is outside of the mathematical domain of the coordinate system.

CSalberX Xy coordinate check

int CSalberX (Const struct cs-Alber_ *alber, int cnt, Const double pnts[][3]);

CSalberX determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the alber argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSalbersX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSalberL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSalberS Setup

void CSalberS(struct cs_Csprm_ *csprm);

The CSalberS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the standard parallels, the origin latitude and longitude, and other projection parameters are known, there are many calculations that need only be performed once. CSalberS performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the single argument provided to CSalberS serves as the source for input and the repository for the results as described below

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time. The specific elements of the cs_Csdef_ structure that must be initialized for the Albers projection are:

Element Description
prj_prm1 Latitude, in degrees, of the northern standard parallel. Unlike other conics, it is important to distinguish between the northern and southern standard parallels for the Albers.
prj_prm2 Latitude, in degrees, of the southern standard parallel. This is, rarely, the same as prj_prm1, to obtain a conic with a single point of tangency.
org_lng The longitude, in degrees, of the origin of the projection.
org_lat The latitude, in degrees, of the origin of the projection.
Scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, selected to cause all X coordinates within the coordinate system to be positive values of reasonable size.
y_off The false northing to be applied to all Y coordinates.
Quad An integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Datum definition

The values of equatorial radius and eccentricity are extracted from the datum element of the cs_Csprm_ structure. These are normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required elements are:

Element Description
e_rad The equatorial radius of the earth in meters.
eccent This value represents the eccentricity of the ellipsoid.
to84_via An integer code that specifies the technique that is to be used to convert geographic coordinates based on this datum to WGS84.

cs_Alber_ Structure

The results of the one-time calculations are recorded in the alber element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSalberF, CSalberI, CSalberK, CSalberH, and CSalberC functions require as their first argument.

American Polyconic Projection (CSplycn)

This set of functions represent the Coordinate System Mapping Package's knowledge of the American Polyconic Projection.

CSplycnF forward conversion

int CSplycnF (Const struct cs_Plycn_ *plycn, double xy[2], Const double ll[2]);

Given a properly initialized cs_Plycn_ structure via the plycn argument, CSplycnF will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSplycnF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSplycnI inverse conversion

int CSplycnI (Const struct cs_Plycn_ *plycn, double ll[2], Const double xy[2]);

Given a properly initialized cs_Plycn_ structure via the plycn argument, CSplycnI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSplycnI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system, or cs_CNVRT_INDF if the result is indefinite (e.g. longitude is not defined at the poles).

In both cases above, the ll and xy arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSplycnK grid scale (K) along parallel

double CSplycnK (Const struct cs_Plycn_ *plycn, Const double ll[2]);

CSplycnK returns the value 1.0 which represents the grid scale along a parallel of any coordinate system based on this projection at any location.

CSplycnH grid scale (H) along meridian

double CSplycnH (Const struct cs_Plycn_ *plycn, Const double ll[2]);

CSplycnH returns the grid scale factor, along a meridian, of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array.

CSplycnC convergence angle

double CSplycnC (Const struct cs_Plycn_ *plycn, Const double ll[2]);

CSplycnC returns the convergence angle in degrees east of north of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array. At the current time, definitive formulas for the convergence angle of this projection elude us. The convergence angle is computed using the CS_llazdd function.

CSplycnQ definition quality check

int CSplycnQ(Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list[], int list_sz);

CSplycnQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the American Polyconic Projection. CS_cschk examines those definition components that are common to all coordinates systems (datum or ellipsoid reference, map scale, and units) and, therefore, CSplycnQ only examines those components specific to the American Polyconic Projection. CSplycnQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSplycnQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CSplycnL Latitude/longitude check

int CSplycnL(Const struct cs_Plycn_ *plycn, int cnt, Const double pnts[][3]);

CSplycnL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the plycn argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSplycnsL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSplycnL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CSplycnX Xy coordinate check

int CSplycnX (Const struct cs_Plycn_ *plycn, int cnt, Const double pnts[][3]);

CSplycnX determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the plycn argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSplycnsX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSplycnL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSplycnS setup

void CSplycnS(struct cs_Csprm_ *csprm);

The CSplycnS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the central meridian, the origin latitude, and other projection parameters are known, there are many calculations that need only be performed once. CSplycnS performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the single argument provided to CSplycnS serves as the source for input and the repository for the results as described below.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time. The specific elements of the cs_Csdef_ structure that must be initialized for the American Polyconic projection are:

Element Description
prj_prm1 Longitude, in degrees, of the central meridian.
org_lat The latitude, in degrees, of the origin of the projection.
scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size.
y_off The false northing to be applied to all Y coordinates.
quad An integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Datum

The values of equatorial radius and eccentricity are extracted from the datum element of the cs_Csprm_ structure. These are normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required elements are:

Element Description
e_rad The equatorial radius of the earth in meters.
eccent This value represents the eccentricity of the ellipsoid.
to84_via An integer code that specifies the technique that is to be used to convert geographic coordinates based on this datum to WGS84.

cs_Plycn_ Structure

The results of the one-time calculations are recorded in the plycn element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSplycnF, CSplycnI, CSplycnK, CSplycnH, and CSplycnC functions require as their first argument.

Azimuthal Equal Area Projection (CSazmea)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Lambert Azimuthal Equal Area Projection

CsazmeaF Forward conversion

int CSazmeaF (Const struct cs_Azmea_ *azmea, double xy[2], Const double ll[2])

Given a properly initialized cs_Azmea_ structure via the azmea argument, CSazmeaF will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSazmeaF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CSazmeaI Inverse conversion

int CSazmeaI (Const struct cs_Azmea_ *azmea, double ll[2], Const double xy[2]);

Given a properly initialized cs_Azmea_ structure via the azmea argument, CSazmeaI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSazmeaI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system, or cs_CNVRT_INDF if the result is indefinite (e.g. longitude is not defined at the poles).

In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CsazmeaK grid scale (K) normal

double CSazmeaK (Const struct cs_Azmea_ * azmea, Const double ll[ 2]);

CSazmeaK returns the grid scale factor normal to the radial at the geodetic location specified by the ll argument. In the case of the ellipsoidal form of this projection, analytical formulas for this value have not been located and the result is arrived at using the CS_llazdd function.

CSazmeaH grid scale (H) radial

double CSazmeaH (Const struct cs_Azmea_ * azmea, Const double ll[ 2]);

CSazmeaH returns the grid scale factor along a radial line from the coordinate system origin to the point provided. Since this projection is authalic (i.e. equal area), the value returned is the reciprocal of that returned by CSazmeaK.

CSazmeaC Convergence angle

double CSazmeaC (Const struct cs_Azmea_ * azmea, Const double ll[ 2]);

CSazmeaC returns the convergence angle in degrees east of north of the geodetic location specified by the ll argument. Analytical formulas for this value have not been located and the result is arrived at using the CS_llazdd function.

CSazmeaQ definition Quality check

int CSazmeaQ (Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list[], int list_sz);

CSazmeaQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Azimuthal Equal Area Projection. CS_cschk examines those definition components that are common to all coordinates system (datum or ellipsoid reference, map scale, and units) and, therefore, CSazmeaQ only examines those components specific to the Azimuthal Equal Area Projection. CSazmeaQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSazmeaQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CSazmeaL Latitude/longitude check

int CSazmeaL (Const struct cs_Azmea_ *azmea, int cnt, Const double pnts[][3]);

CSazmeaL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the azmea argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSazmeasL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSazmeaL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CSazmeaX Xy coordinate check

int CSazmeaX (Const struct cs_Azmea_ *azmea, int cnt, Const double pnts[][3]);

CSazmeaX determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the azmea argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSazmeasX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSazmeaL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSazmeaS Setup

void CSazmeaS(struct cs_Csprm_ *csprm);

The CSazmeaS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the origin latitude and longitude, and other projection parameters are known, there are many calculations that need only be performed once. CSazmeaS performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the argument provided to CSazmeaS serves as the source for input and the repository for the results as described below

Coordinate system definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time.

The following parameters must be set:

Parameter Description
prj_prm1 The azimuth, in degrees east of north, of the positive Y-axis of the coordinate system.
org_lng The longitude, in degrees, of the origin of the projection.
org_lat The latitude, in degrees, of the origin of the projection.
scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size. This is the X coordinate of the coordinate system origin.
y_off The false northing to be applied to all Y coordinates. This is the Y coordinate of the coordinate system origin.
quad An integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Datum definition

The values of equatorial radius and eccentricity are extracted from the datum element of the cs_Csprm_ structure. These are normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required elements are:

Element Description
e_rad The equatorial radius of the earth in meters.
eccent This value represents the eccentricity of the ellipsoid.
to84_via An integer code that specifies the technique that is to be used to convert geographic coordinates based on this datum to WGS84.

cs_Azmea_ Structure

The results of the one-time calculations are recorded in the azmea element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSazmeaF, CSazmeaI, CSazmeaK, CSazmeaH, and CSazmeaC functions require as their first argument.

Azmuthal Equidistant Projection (Csazmed)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Azimuthal Equidistant Projection.

CSazmedF Forward conversion

int CSazmedF (Const struct cs_Azmed_ *azmed, double xy[2], Const double ll[2]);

Given a properly initialized cs_Azmed_ structure via the azmed argument, CSazmedF will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSazmedF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CSazmedI Inverse conversion

int CSazmedI (Const struct cs_Azmed_ *azmed, double ll[2], Const double xy[2]);

Given a properly initialized cs_Azmed_ structure via the azmed argument, CSazmedI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSazmedI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system, or cs_CNVRT_INDF if the result is indefinite (e.g. longitude is not defined at the poles).

In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSazmedK grid scale (K) normal

double CSazmedK (Const struct cs_Azmed_ *azmed, Const doubl  ll[2]);

CSazmedK returns the grid scale factor normal to the radial at the geodetic location specified by the ll argument. In the case of the ellipsoidal form of this projection, analytical formulas for this value have not been located and the result is arrived at using the CS_llazdd function.

CSazmedH grid scale (H) radial

double CSazmedH (Const struct cs_Azmed_ *azmed, Const double ll[2]);

CSazmedH returns the value 1.0; the scale at any point in the direction of a line emanating from the origin and passing through the any point of any coordinate system based on this projection. (This is what makes this projection an Equidistant Projection.)

CSazmedC convergence angle

double CSazmedC (Const struct cs_Azmed_ *azmed, Const double ll[2]);

CSazmedC returns the convergence angle in degrees east of north of the geodetic location specified by the ll argument. Analytical formulas for this value have not been located and the result is arrived at using the CS_llazdd function.

CSazmedQ definition quality check

int CSazmedQ (Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list [], int list_sz);

CSazmedQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Azimuthal Equidistant Projection. CS_cschk examines those definition components that are common to all coordinates systems (datum or ellipsoid reference, map scale, and units) and, therefore, CSazmedQ only examines those components specific to the Azimuthal Equidistant Projection. CSazmedQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSazmedQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CSazmedL Latitude/longitude check

int CSazmedL (Const struct cs_Azmed_ *azmed, int cnt, Const double pnts[][3]);

CSazmedL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the azmed argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSazmedsL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSazmedL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CSazmedX Xy coordinate check

int CSazmedX (Const struct cs_Azmed_ * azmed, int cnt, Const double pnts[][3]);

CSazmedX determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the azmed argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSazmedsX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSazmedL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSazmedS Setup

void CSazmedS(struct cs_Csprm_ *csprm);

The CSazmedS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the origin latitude and longitude, and other projection parameters are known, there are many calculations that need only be performed once. CSazmedS performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the first argument provided to CSazmedS serves as the source for input and the repository for the results as described below.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time. There are two variations to this projection:

The following parameters are common to both variations:

Parameter Description
org_lng The longitude, in degrees, of the origin of the projection.
org_lat The latitude, in degrees, of the origin of the projection.
scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size. This is the X coordinate of the coordinate system origin.
y_off The false northing to be applied to all Y coordinates. This is the Y coordinate of the coordinate system origin.
quad An integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Lambert Azimuthal Equidistant Projection

This is the traditional variation of the Lambert Azimuthal Equidistant projection. Note that it differs slightly from many other implementations in that it accepts a parameter value for the azimuth of the Y axis relative to true north. This provides support for local/company coordinate system. Even better local/company coordinate system support is provided by the Lambert Azimuthal Equidistant, Elevated Ellipsoid variation.

The parameter must be specified in degrees east of north. An azimuth west of north would be specified with a negative value.

The following parameters must be set:

Parameter Description
prj_prm1 The azimuth, in degrees east of north, of the positive Y-axis of the coordinate system.

Lambert Azimuthal Equidistant, Elevated Ellipsoid (cs_PRJCOD_AZEDE)

This variation of the Lambert Azimuthal Equidistant projection accepts an average elevation parameter which is added to the equatiorial radii of the ellipsoid. This better enbales CS-MAP to emulate a local/company coordinate system.

The parameter must be specified in system units. That is, if the coordinate system unit is, say, FEET; the average elevation must also be specified in feet.

The following parameters must be set;

Parameter Description
prj_prm1 The azimuth, in degrees east of north, of the positive Y-axis of the coordinate system.
prj_prm2 The average elevation in the region of the system, expressed in coordinate system units.

Datum Definition

The values of equatorial radius and eccentricity are extracted from the datum element of the cs_Csprm_ structure. These are normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required elements are:

Element Description
e_rad The equatorial radius of the earth in meters.
eccent This value represents the eccentricity of the ellipsoid.
to84_via An integer code that specifies the technique that is to be used to convert geographic coordinates based on this datum to WGS84.

cs_Azmed_ Structure

The results of the one-time calculations are recorded in the azmed element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSazmedF, CSazmedI, CSazmedK, CSazmedH, and CSazmedC functions require as their first argument.

Bonne Projection Projection (CSbonne)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Bonne Projection. Setting the standard parallel equal to the equator produces a Sinusoidal Projection. Setting the standard parallel to either pole produces the Werner Projection.

CSbonneF Forward conversion

int CSbonneF (Const struct cs_Bonne_ *bonne, double xy[2], Const double ll[2]);

Given a properly initialized cs_Bonne_ structure via the bonne argument, CSbonneF will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSbonneF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CSbonneI Inverse conversion

int CSbonneI (Const struct cs_Bonne_ *bonne, double ll[2],Const double xy[2]);

Given a properly initialized cs_Bonne_ structure via the bonne argument, CSbonneI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSbonneI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system, or cs_CNVRT_INDF if the result is indefinite (e.g. longitude is not defined at the poles).

In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSbonneK parallel scale (K)

double CSbonneK (Const struct cs_Bonne_ *bonne, Const double ll[2]);

CSbonneK returns the value 1.0 which is the grid scale factor, along any parallel, of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array.

CSbonneH meridian scale (H)

double CSbonneH (Const struct cs_Bonne_ *bonne, Const double ll[2]);

CSbonneK returns the grid scale, along a meridian, of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array. Analytical formulas for this value have not been located and the result is arrived at using the CS_llazdd function.

CSbonneC Convergence angle

double CSbonneC (Const struct cs_Bonne_ *bonne, Const double ll[2]);

CSbonneC returns the convergence angle of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array. Analytical formulas for this value have not been located and the result is arrived at using the CS_llazdd function.

CSbonneQ definition quality check

int CSbonneQ(Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list[], int list_sz);

CSbonneQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Boone Projection. CS_cschk examines those definition components that are common to all coordinates system (datum or ellipsoid reference, map scale, and units) and, therefore, CSbonneQ only examines those components specific to the Bonne Projection. CSbonneQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSbonneQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CSbonneL Latitude/longitude check

int CSbonneL (Const struct cs_Bonne_ *bonne, int cnt, Const double pnts[][3]);

CSbonneL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the bonne argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSbonnesL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSbonneL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates is outside of the mathematical domain of the coordinate system.

CSbonneX Xy coordinate check

int CSbonneX (Const struct cs_Bonne_ *bonne, int cnt, Const double pnts[][3]);

CSbonneX determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the bonne argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSbonnesX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSbonneL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSbonneS Setup

void CSbonneS (struct cs_Csprm_ *csprm);

The CSbonneS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the standard parallel, the origin longitude, and other projection parameters are known, there are many calculations that need only be performed once. CSbonneS performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the single argument provided to CSbonneS serves as the source for input and the repository for the results as described below.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time. The specific elements of the cs_Csdef_ structure that must be initialized for the Bonne Projection are:

Element Description
org_lng The longitude, in degrees, of the central meridian of the projection.
org_lat The latitude, in degrees, of the standard parallel of the projection.
scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size.
y_off The false northing to be applied to all Y coordinates.
quad an integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Datum Definition

The values of equatorial radius and eccentricity are extracted from the datum element of the cs_Csprm_ structure. These are normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required elements are:

Element Description
e_rad The equatorial radius of the earth in meters.
eccent This value represents the eccentricity of the ellipsoid.
to84_via An integer code that specifies the technique that is to be used to convert geographic coordinates based on this datum to WGS84.

cs_Bonne_ Structure

The results of the one-time calculations are recorded in the bonne element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSbonneF, CSbonneI, CSbonneK, CSbonneH, and CSbonneC functions require as their first argument.

Bipolar Oblique Conformal Conic Projection (CSbpcnc)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Bipolar Oblique Conformal Conic Projection. This projection was developed, by O. M. Miller (of Miller Cylindrical fame), specifically for mapping both the North American and South American continents on the same conformal map. This projection is supported for the sphere only. The equatorial radius of the referenced ellipsoid is used as the radius of the sphere.

CSbpcncF Forward conversion

int CSbpcncF (Const struct cs_Bpcnc_ *bpcnc, double xy[2], Const double ll[2]);

Given a properly initialized cs_Bpcnc_ structure via the bpcnc argument, CSbpcncF will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSbpcncF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CSbpcncI Inverse conversion

int CSbpcncI (Const struct cs_Bpcnc_ *bpcnc, double ll[2], Const double xy[2]);

Given a properly initialized cs_Bpcnc_ structure via the bpcnc argument, CSbpcncI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSbpcncI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system, or cs_CNVRT_INDF if the result is indefinite (e.g. longitude is not defined at the poles).

In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSbpcncK parallel scale (K)

double CSbpcncK ( Const struct cs_Bpcnc_ *bpcnc, Const double ll[2]);

CSbpcncK returns the grid scale factor, as measured along a parallel, of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array. Since this is a conformal projection, there is no H function as the scale along a meridian equals the scale along a parallel.

CSbpcncC Convergence angle

double CSbpcncC ( Const struct cs_Bpcnc_ *bpcnc, Const double ll[2]);

CSbpcncC returns the convergence angle of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array. At the current time, formulas that analytically define the convergence angle for this projection elude us. Thus, the convergence angle is determined empirically through the use of the CS_llazdd function.

CSbpcncQ definition quality check

int CSbpcncQ(Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list[], int list_sz);

CSbpcncQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Bi-Polar Conformal Conic Projection. CS_cschk examines those definition components that are common to all coordinates system (datum or ellipsoid reference, map scale, and units) and, therefore, CSbpcncQ only examines those components specific to the Bi-Polar Conformal Conic Projection. CSbpcncQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSbpcncQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CSbpcncL Latitude/longitude check

int CSbpcncL (Const struct cs_Bpcnc_ *bpcnc, int cnt, Const double pnts[][3]);

CSbpcncL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the bpcnc argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSbpcncsL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSbpcncL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CSbpcncX Xy coordinate check

int CSbpcncX ( Const struct cs_Bpcnc_ *bpcnc, int cnt , Const double pnts[][3]);

CSbpcncX determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the bpcnc argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSbpcncsX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSbpcncL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSbpcncS Setup

void CSbpcncS(struct cs_Csprm_ *csprm);

The CSbpcncS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the poles, the standard parallels, and other projection parameters are known, there are many calculations that need only be performed once. CSbpcncS performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the single argument provided to CSbpcncS serves as the source for input and the repository for the results as described below.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time. As far as we know, this projection is usually used only for the specific coordinate system for which it was invented. However, to remain consistent with the rest of CS-MAP, the following parameters can be specified. These parameters specify the location of the two poles upon which the projection is based. The first is always specified by latitude and longitude. The latitude of the second pole must always be specified. However, the longitude of the second pole can be specified either directly (prj_prm3) or as an angular distance from the first pole (prj_prm5). If prj_prm5 is greater than zero, the second method is used. In the listing of parameters given below, the values used for the specific map for which this projection was developed are given. The specific elements of the cs_Csdef_ structure that must be initialized for the Bipolar Oblique Conformal Projection are:

Element Description
prj_prm1 Longitude, in degrees, of the first pole (usually the southwest). [- 110.0]
prj_prm2 Latitude, in degrees, of the first pole. [-20.0]
prj_prm3 Longitude, in degrees, of the second pole (usually the northeast). [-19.99333333333]
prj_prm4 Latitude, in degrees, of the second pole. [+45.0]
prj_prm5 If greater than zero, this value is considered to be the angular distance, in degrees, from the first pole to the second pole and the longitude of the second pole is computed as such. If this value is less than or equal to zero, the value provided in prj_prm3 is considered the longitude of the second pole. [+104.0]
prj_prm6 Angular distance, in degrees, from either pole to the first of two standard parallels. [+31.0]
prj_prm7 Angular distance, in degrees, from either pole to the second of two standard parallels. [+73.0]
scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied. [1.0]
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size. [0.0]
y_off The false northing to be applied to all Y coordinates. [0.0]
quad an integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Datum Definition

The value of equatorial radius is extracted from the datum element of the cs_Csprm_ structure and used as the radius of the sphere. This is normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required element is:

Element Description
e_rad The radius of the earth, as a sphere, in meters

cs_Bpcnc_ Structure

The results of the one-time calculations are recorded in the bpcnc element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSbpcncF, CSbpcncI, CSbpcncK, CSbpcncH, CSbpcncC, and CSbpcncB functions require as their first argument.

Cassini Projection (CScsini)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Cassini Projection

CScsiniF Forward

int CScsiniF (Const struct cs_Csini_ *csini, double xy[2], Const double ll[2]);

Given a properly initialized cs_Csini_ structure via the csini argument, CScsiniI will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CScsiniF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CScsiniI Inverse

int CScsiniI (Const struct cs_Csini_ *csini, double ll[2], Const double xy[2]);

Given a properly initialized cs_Csini_ structure via the csini argument, CScsiniI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CScsiniI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system, or cs_CNVRT_INDF if the result is indefinite (e.g. longitude is not defined at the poles). In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are the first elements in these arrays, the Y coordinate and the latitude are the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CScsiniK parallel scale (K)

double CScsiniK (Const struct cs_Csini_ *csini, Const double ll[2]);

CScsiniK returns the grid scale factor along a line normal to the central meridian of the coordinate system at the geographic location defined by the latitude and longitude provided in the ll array. It is a specific feature of this projection that this scale factor is unity.

CScsiniH meridian scale (H)

double CScsiniH (Const struct cs_Csini_ *csini, Const double ll[2]);

CScsiniH returns the grid scale factor along a line parallel to the central meridian of the coordinate system at the geographic location defined by the latitude and longitude provided in the ll array.

CScsiniC Convergence angle

double CScsiniC (Const struct cs_Csini_ *csini, Const double ll[2]);

CScsiniC returns the convergence angle, in degrees east of north, of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array. As analytical formulas for this quantity have not yet been located, the result is arrived at empirically using CS_aslldd.

CScsiniQ definition Quality check

int CScsiniQ(Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list[], int list_sz);

CScsiniQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Cassini Projection. CS_cschk examines those definition components that are common to all coordinates system (datum or ellipsoid reference, map scale, and units) and, therefore, CScsiniQ only examines those components specific to the Cassini Projection. CScsiniQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CScsiniQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CScsiniL Latitude/longitude check

int CScsiniL (Const struct cs_Csini_ *csini, int cnt, Const double pnts[][3]);

CScsiniL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the csini argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CScsinisL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CScsiniL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CScsiniX Xy coordinate check

int CScsiniX (Const struct cs_Csini_ *csini, int cnt, Const double pnts[][3]);

CScsiniX determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the csini argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CScsinisX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CScsiniL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CScsiniS Setup

void CScsiniS (struct cs_Csprm_ *csprm);

The CScsiniS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the central meridian, the origin latitude, and other projection parameters are known, there are many calculations that need only be performed once. CScsiniS performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the single argument provided to CScsiniS serves as the source for input and the repository for the results as described below.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time. The specific elements of the cs_Csdef_ structure that must be initialized for the Cassini projection are:

Element Description
prj_prm1 Longitude, in degrees, of the central meridian.
org_lat The latitude, in degrees, of the origin of the projection.
Scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units, and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size.
y_off The false northing to be applied to all Y coordinates.
Quad an integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Datum Definition

The values of equatorial radius and eccentricity are extracted from the datum element of the cs_Csprm_ structure. These are normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required elements are:

Element Description
e_rad The equatorial radius of the earth in meters.
eccent This value represents the eccentricity of the ellipsoid.
to84_via An integer code that specifies the technique that is to be used to convert geographic coordinates based on this datum to WGS84.

cs_Csini_ Structure

The results of the one-time calculations are recorded in the csini element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CScsiniF, CScsiniI, CScsiniK, CScsiniH, and CScsiniC functions require as their first argument.

Danish System 34 (CSsys34)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Danish System 34 Projection. This projection is supported in ellipsoid form only; and most ordinary parameters are hard coded and selected via the 'region' (prj_prm1) parameter.

CSsys34C Convergence angle

double CSsys34C ( Const struct cs_Sys34_ *sys34, Const double ll[2]);

CSsys34C returns the convergence angle in degrees east of north of the geodetic location specified by the ll argument. Analytical formulas for this value have not been located and the result is arrived at through the use of the CS_azlld function.

CSsys34F Forward conversion

int CSsys34F (Const struct cs_Sys34_ *sys34, double xy[2], Const double ll[2]);

Given a properly initialized cs_Sys34_ structure via the sys34 argument, CSsys34F will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSsys34F normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CSsys34I Inverse conversion

int CSsys34I (Const struct cs_Sys34_ *sys34, double ll[2], Const double xy[2]);

Given a properly initialized cs_Sys34_ structure via the sys34 argument, CSsys34I will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSsys34I normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system, or cs_CNVRT_INDF if the result is indefinite (e.g. longitude is not defined at the poles). In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSsys34K parallel scale (K)

double CSsys34K (Const struct cs_Sys34_ *sys34, Const double ll[2]);

CSsys34K returns the grid scale factor along a parallel of any coordinate system based on this projection at any location. Analytical formulas for this value have not been located and the result is arrived at empirically the use of the CS_llazdd function.

CSsys34H meridian scale (H)

double CSsys34H (Const struct cs_Sys34_ * ys34, Const double ll[2]);

CSsys34H returns the grid scale factor along a meridian at the geodetic location specified by the ll argument. Analytical formulas for this value have not been located and the result is arrived at empirically the use of the CS_llazdd function.

CSsys34L Latitude/longitude check

int CSsys34L (Const struct cs_Sys34_ *sys34, int cnt, Const double pnts[][3]);

CSsys34L determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the sys34 argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSsys34sL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSsys34L returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CSsys34Q definition quality check

int CSsys34Q (Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list [], int list_sz);

CSsys34Q determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Danish System 34 Projection. CS_cschk examines those definition components that are common to all coordinates system (datum or ellipsoid reference, map scale, and units) and, therefore, CSsys34Q only examines those components specific to the Danish System 34 Projection. CSsys34Q returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSsys34Q may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CSsys34X Xy coordinate check

int CSsys34X (Const struct cs_Sys34_ *sys34, int cnt , Const double pnts[][3]);

CSsys34X determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the sys34 argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSsys34sX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSsys34L returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSsys34S Setup (general)

void CSsys34S (struct cs_Csprm_ *csprm);

The CSsys34S function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the zone and other projection parameters are known, there are many calculations that need only be performed once. CSsys34S performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the argument provided to CSsys34S serves as the source for input and the repository for the results as described below.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time.

The following parameters must be set:

Parameter Description
prj_prm1 Indicates which of the three regions is to apply 1.0 ==> jylland; 2.0 ==> sjælland, 3.0 ==> bornholm.
quad An integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Datum Definition

The values of equatorial radius and eccentricity are extracted from the datum element of the cs_Csprm_ structure. These are normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required elements are:

Element Description
e_rad The equatorial radius of the earth in meters.
eccent This value represents the eccentricity of the ellipsoid.
to84_via An integer code that specifies the technique that is to be used to convert geographic coordinates based on this datum to WGS84.

cs_Sys34_ Structure

The results of the one-time calculations are recorded in the sys34 element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSsys344F, CSsys344I, CSsys344K, CSsys344H, and CSsys34C functions require as their first argument.

Equidistant Conic Projection (CSedcnc)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Equidistant Conic Projection, also known as the Simple Conic Projection.

CSedcncF Forward conversion

int CSedcncF (Const struct cs_Edcnc_ *edcnc, double xy[2], Const double ll[2]);

Given a properly initialized cs_Edcnc_ structure via the edcnc argument, CSedcncF will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSedcncF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CSedcncI Inverse conversion

int CSedcncI (Const struct cs_Edcnc_ *edcnc, double ll[2], Const double xy[2]);

Given a properly initialized cs_Edcnc_ structure via the edcnc argument, CSedcncI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSedcncI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system, or cs_CNVRT_INDF if the result is indefinite (e.g. longitude is not defined at the poles). In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSedcncK parallel scale (K)

double CSedcncK (Const struct cs_Edcnc_ *edcnc, Const double ll[2]);

CSedcncK returns the grid scale factor, along a parallel, of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array.

CSedcncH meridian scale (H)

double CSedcncH (Const struct cs_Edcnc_ *edcnc, Const double ll[2]);

CSedcncH returns the value of 1.0 that represents the grid scale, along a meridian, of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array. That is, all distances measured along a meridian of this projection are true to scale, the essence of this projection.

CSedcncC Convergence angle

double CSedcncC (Const struct cs_Edcnc_ *edcnc, Const double ll[2]);

CSedcncC returns the convergence angle of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array.

CSedcncQ definition Quality check

int CSedcncQ (Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list[], int list_sz);

CSedcncQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Equidistant Conic Projection. CS_cschk examines those definition components that are common to all coordinates system (datum or ellipsoid reference, map scale, and units) and, therefore, CSedcncQ only examines those components specific to the Equidistant Conic Projection. CSedcncQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSedcncQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CSedcncL Latitude/longitude check

int CSedcncL (Const struct cs_Edcnc_ *edcnc, int cnt, Const double pnts[][3]);

CSedcncL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the edcnc argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSedcncsL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSedcncL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CSedcncX Xy coordinate check

int CSedcncX (Const struct cs_Edcnc_ *edcnc, int cnt, Const double pnts[][3]);

CSedcncX determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the edcnc argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSedcncsX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSedcncL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSedcncS Setup

void CSedcncS (struct cs_Csprm_ *csprm);

The CSedcncS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the standard parallels, the origin latitude and longitude, and other projection parameters are known, there are many calculations that need only be performed once. CSedcncS performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the single argument provided to CSedcncS serves as the source for input and the repository for the results as described below.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time. The specific elements of the cs_Csdef_ structure that must be initialized for the Equidistant Conic projection are:

Element Description
prj_prm1 Latitude, in degrees, of the first standard parallel, usually the northernmost (it makes no difference).
prj_prm2 Latitude, in degrees, of the second standard parallel, usually the southernmost. This is, rarely, the same as prj_prm1, to obtain a conic with a single point of tangency (i.e. a single standard parallel).
org_lng The longitude, in degrees, of the origin of the projection.
org_lat The latitude, in degrees, of the origin of the projection.
scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size.
y_off The false northing to be applied to all Y coordinates.
quad An integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Datum Definition

The values of equatorial radius and eccentricity are extracted from the datum element of the cs_Csprm_ structure. These are normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required elements are:

Element Description
e_rad The equatorial radius of the earth in meters.
eccent This value represents the eccentricity of the ellipsoid.
to84_via An integer code that specifies the technique that is to be used to convert geographic coordinates based on this datum to WGS84.

cs_Edcnc_ Structure

The results of the one-time calculations are recorded in the edcnc element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSedcncF, CSedcncI, CSedcncK, CSedcncH, and CSedcncC functions require as their first argument.

Equidistant Cylindrical Projection (CSedcyl)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Equidistant Cylindrical Projection. This projection is supported in spherical form only. The equatorial radius of the supplied ellipsoid is used as the radius of the sphere. This projection is also known as the Equirectangular or Rectangular projection. When the reference latitude of this projection is set to zero (i.e. the equator) the result is equivalent to what is known as the Plate Carrée or Simple Cylindrical projection. When the reference latitude is set to 45? (north or south), a Gall Isographic projection results.

CSedcylF Forward conversion

int CSedcylF (Const struct cs_Edcyl_ *edcyl,double xy[2], Const double ll[2]);

Given a properly initialized cs_Edcyl_ structure via the edcyl argument, CSedcylF will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSedcylF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CSedcylI Inverse conversion

int CSedcylI (Const struct cs_Edcyl_ *edcyl, double ll[2], Const double xy[2]);

Given a properly initialized cs_Edcyl_ structure via the edcyl argument, CSedcylI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSedcylI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system.

In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSedcylK parallel scale (K)

double CSedcylK (Const struct cs_Edcyl_ *edcyl, Const double ll[2]);

CSedcylK returns the grid scale factor along a parallel at the geodetic location specified by the ll argument.

CSedcylH meridional scale (H)

double CSedcylH (Const struct cs_Edcyl_ *edcyl, Const double ll[2]);

CSedcylH returns the grid scale factor along a meridian at the geodetic location specified by the ll argument.

CSedcylC Convergence angle

double CSedcylC (Const struct cs_Edcyl_ *edcyl, Const double ll[2]);

CSedcylC returns the convergence angle in degrees east of north of the geodetic location specified by the ll argument. Analytical formulas for this value have not been located and the result is arrived at using the CS_azsphr function.

CSedcylQ definition Quality check

int CSedcylQ(Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list[], int list_sz);

CSedcylQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Equidistant Cylindrical Projection. CS_cschk examines those definition components that are common to all coordinates system (datum or ellipsoid reference, map scale, and units) and, therefore, CSedcylQ only examines those components specific to the Equidistant Cylindrical Projection. CSedcylQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSedcylQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CSedcylL Latitude/longitude check

int CSedcylL (Const struct cs_Edcyl_ *edcyl, int cnt, Const double pnts[][3]);

CSedcylL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the edcyl argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSedcylsL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSedcylL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CSedcylX Xy coordinate check

int CSedcylX (Const struct cs_Edcyl_ *edcyl, int cnt, Const double pnts[][3]);

CSedcylX determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the edcyl argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSedcylsX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSedcylL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSedcylS Setup

void CSedcylS(struct cs_Csprm_ *csprm);

The CSedcylS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the reference parallel, origin longitude, and other projection parameters are known, there are many calculations which need only be performed once. CSedcylS performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the argument provided to CSedcylS serves as the source for input and the repository for the results as described below.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time. The following parameters are used:

Parameter Description
prj_prm1 The latitude, in degrees, of the reference parallel.
org_lng The longitude, in degrees, of the origin of the projection.
org_lat The latitude, in degrees, of the origin of the projection.
scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size. This is the X coordinate of the coordinate system origin.
y_off The false northing to be applied to all Y coordinates. This is the Y coordinate of the coordinate system origin.
quad An integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Datum Definition

The value of equatorial radius is extracted from the datum element of the cs_Csprm_ structure and used as the radius of the sphere. This is normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required element is:

Element Description
e_rad The radius of the earth, as a sphere, in meters.

cs_Edcyl_ Structure

The results of the one-time calculations are recorded in the edcyl element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSedcylF, CSedcylI, CSedcylK, CsedcylH, and CSedcylC functions require as their first argument.

Eckert IV Projection (CSekrt4)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Eckert IV Projection. This projection is supported in spherical form only. The equatorial radius of the supplied ellipsoid is used as the radius of the sphere.

CSekrt4F Forward conversion

int CSekrt4F (Const struct cs_Ekrt4_ *ekrt4, double xy[2], Const double ll[2]);

Given a properly initialized cs_Ekrt4_ structure via the ekrt4 argument, CSekrt4F will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSekrt4F normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CSekrt4I Inverse conversion

int CSekrt4I (Const struct cs_Ekrt4_ *ekrt4, double ll[2], Const double xy[2]);

Given a properly initialized cs_Ekrt4_ structure via the ekrt4 argument, CSekrt4I will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSekrt4I normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system, or cs_CNVRT_INDF if the result is indefinite (e.g. longitude is not defined at the poles).

In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSekrt4K parallel scale (K)

double CSekrt4K (Const struct cs_Ekrt4_ *ekrt4, Const double ll[2]);

CSekrt4K returns the grid scale factor along a parallel of any coordinate system based on this projection at any location. Analytical formulas for this value have not been located and the result is arrived at empirically the use of spherical trigonometry.

CSekrt4H meridian scale (H)

double CSekrt4H (Const struct cs_Ekrt4_ *ekrt4, Const double ll[2]);

CSekrt4H returns the grid scale factor along a meridian at the geodetic location specified by the ll argument. Analytical formulas for this value have not been located and the result is arrived at empirically the use of spherical trigonometry.

CSekrt4C Convergence angle

double CSekrt4C (Const struct cs_Ekrt4_ *ekrt4, Const double ll[2]);

CSekrt4C returns the convergence angle in degrees east of north of the geodetic location specified by the ll argument. Analytical formulas for this value have not been located and the result is arrived at through the use of the CS_azsphr function.

CSekrt4Q definition quality check

int CSekrt4Q (Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list [], int list_sz);

CSekrt4Q determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Eckert IV Projection. CS_cschk examines those definition components that are common to all coordinates system (datum or ellipsoid reference, map scale, and units) and, therefore, CSekrt4Q only examines those components specific to the Eckert IV Projection. CSekrt4Q returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSekrt4Q may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CSekrt4L Latitude/longitude check

int CSekrt4L (Const struct cs_Ekrt4_ *ekrt4, int cnt, Const double pnts[][3]);

CSekrt4L determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the ekrt4 argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSekrt4sL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSekrt4L returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CSekrt4X Xy coordinate check

int CSekrt4X ( Const struct cs_Ekrt4_ *ekrt4, int cnt, Const double pnts[][3]);

CSekrt4X determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the ekrt4 argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSekrt4sX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSekrt4L returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSekrt4S Setup (general)

void CSekrt4S( struct cs_Csprm_ *csprm);

The CSekrt4S function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the central meridian and other projection parameters are known, there are many calculations that need only be performed once. CSekrt4S performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the argument provided to CSekrt4S serves as the source for input and the repository for the results as described below.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time. The following parameters are used:

Parameter Description
org_lng The longitude, in degrees, of the origin of the projection (central meridian).
scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size. This is the X coordinate of the coordinate system origin.
y_off The false northing to be applied to all Y coordinates. This is the Y coordinate of the coordinate system origin.
quad An integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Datum Definition

The value of equatorial radius is extracted from the datum element of the cs_Csprm_ structure and used as the radius of the sphere. This is normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required element is:

Element Description
e_rad The radius of the earth, as a sphere, in meters.

cs_Ekrt4 Structure

The results of the one-time calculations are recorded in the ekrt4 element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSekrt4F, CSekrt4I, CSekrt4K, CSekrt4H, and CSekrt4C functions require as their first argument.

Eckert VI Projection (CSekrt6)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Eckert VI Projection. This projection is supported in spherical form only. The equatorial radius of the supplied ellipsoid is used as the radius of the sphere.

CSekrt6F forward conversion

int CSekrt6F ( Const struct cs_Ekrt6_ *ekrt6, double xy[2], Const double ll[2]);

Given a properly initialized cs_Ekrt6_ structure via the ekrt6 argument, CSekrt6F will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSekrt6F normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CSekrt6I Inverse conversion

int CSekrt6I ( Const struct cs_Ekrt6_ *ekrt6, double ll[2], Const double xy[2]);

Given a properly initialized cs_Ekrt6_ structure via the ekrt6 argument, CSekrt6I will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSekrt6I normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system, or cs_CNVRT_INDF if the result is indefinite (e.g. longitude is not defined at the poles).

In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSekrt6K parallel scale (K)

double CSekrt6K ( Const struct cs_Ekrt6_ *ekrt6, Const double ll[2]);

CSekrt6K returns the grid scale factor along a parallel of any coordinate system based on this projection at any location. Analytical formulas for this value have not been located and the result is arrived at empirically the use of spherical trigonometry.

CSekrt6H meridian scale (H)

double CSekrt6H ( Const struct cs_Ekrt6_ *ekrt6, Const double ll[2]);

CSekrt6H returns the grid scale factor along a meridian at the geodetic location specified by the ll argument. Analytical formulas for this value have not been located and the result is arrived at empirically the use of spherical trigonometry.

CSekrt6C Convergence angle

double CSekrt6C ( Const struct cs_Ekrt6_ *ekrt6, Const double ll [2]);

CSekrt6C returns the convergence angle in degrees east of north of the geodetic location specified by the ll argument. Analytical formulas for this value have not been located and the result is arrived at through the use of the CS_azsphr function.

CSekrt6Q definition quality check

int Csekrt6Q( Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list [], int list_sz);

CSekrt6Q determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Eckert VI Projection. CS_cschk examines those definition components that are common to all coordinates system (datum or ellipsoid reference, map scale, and units) and, therefore, CSekrt6Q only examines those components specific to the Eckert VI Projection. CSekrt6Q returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSekrt6Q may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CSekrt6L Latitude/longitude check

int Csekrt6L (Const struct cs_Ekrt6_ *ekrt4, int cnt, Const double pnts[][3]);

CSekrt6L determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the ekrt6 argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSekrt6sL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSekrt6L returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CSekrt6X Xy coordinate check

int Csekrt6X (Const struct cs_Ekrt6_ *ekrt4, int cnt, Const double pnts[][3]);

CSekrt6X determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the ekrt6 argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSekrt6sX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSekrt6L returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSekrt6S Setup (general)

void CSekrt6S(struct cs_Csprm_ *csprm);

The CSekrt6S function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the central meridian and other projection parameters are known, there are many calculations which need only be performed once. CSekrt6S performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the argument provided to CSekrt6S serves as the source for input and the repository for the results as described below.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time. The following parameters are used:

Parameter Description
org_lng The longitude, in degrees, of the origin of the projection (central meridian).
scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size. This is the X coordinate of the coordinate system origin.
y_off The false northing to be applied to all Y coordinates. This is the Y coordinate of the coordinate system origin.
quad An integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Datum definition

The value of equatorial radius is extracted from the datum element of the cs_Csprm_ structure and used as the radius of the sphere. This is normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required element is:

Element Description
e_rad The radius of the earth, as a sphere, in meters.

cs_Ekrt6_ structure

The results of the one-time calculations are recorded in the ekrt6 element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSekrt6F, CSekrt6I, CSekrt6K, CSekrt6H, and CSekrt6C functions require as their first argument.

Gnomonic Projection (CSgnomc)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Gnomonic Projection. This projection is supported in spherical form only. The equatorial radius of the supplied ellipsoid is used as the radius of the sphere.

The Gnomonic projection cannot process locations that are 90 degrees or more away from the projection origin. Coordinates that exceed this limit are adjusted to fall on the great circle that defines this limit.

CsgnomcF Forward conversion

int CSgnomcF ( Const struct cs_Gnomc_ *gnomc, double xy[2], Const double ll[2]);

Given a properly initialized cs_Gnomc_ structure via the gnomc argument, CSgnomcF will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSgnomcF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CsgnomcI inverse conversion

int CSgnomcI (Const struct cs_Gnomc_ *gnomc, double ll[2], Const double xy[2]);

Given a properly initialized cs_Gnomc_ structure via the gnomc argument, CSgnomcI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSgnomcI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system, or cs_CNVRT_INDF if the result is indefinite (e.g. longitude is not defined at the poles).

In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CsgnomcK grid scale (K) normal to radial

double CSgnomcK (Const struct cs_Gnomc_ *gnomc, Const double ll[2]);

CSgnomcK returns the grid scale factor normal to the radial at the geodetic location specified by the ll argument.

CsgnomcH grid scale (H) along radial

double CSgnomcH (Const struct cs_Gnomc_ *gnomc, Const double ll[2]);

CSgnomcH returns the grid scale factor along a radial from the coordinate system origin to (and at) the geodetic location specified by the ll argument.

CsgnomcC Convergence angle

double CSgnomcC (Const struct cs_Gnomc_ * gnomc, Const double ll[2]);

CSgnomcC returns the convergence angle in degrees east of north of the geodetic location specified by the ll argument. Analytical formulas for this value have not been located and the result is arrived at through the use of the CS_azsphr function.

CsgnomcL Latitude/longitude check

int CSgnomcL (Const struct cs_Gnomc_ * gnomc, int cnt, Const double pnts[][3]);

CSgnomcL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the gnomc argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSgnomcsL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSgnomcL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CSgnomcQ definition quality check

int CSgnomcQ (Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list[], int list_sz);

CSgnomcQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Gnomonic Projection. CS_cschk examines those definition components that are common to all coordinates systems (datum or ellipsoid reference, map scale, and units) and, therefore, CSgnomcQ only examines those components specific to the Gnomonic Projection. CSgnomcQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSgnomcQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CsgnomcX Xy coordinate check`

int CSgnomcX (Const struct cs_Gnomc_ * gnomc, int cnt, Const double pnts[][3]);

CSgnomcX determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the gnomc argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSgnomcsX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSgnomcL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSgnomcS Setup

void CSgnomcS(struct cs_Csprm_ *csprm);

The CSgnomcS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the origin latitude and longitude and other projection parameters are known, there are many calculations that need only be performed once. CSgnomcS performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the argument provided to CSgnomcS serves as the source for input and the repository for the results as described below.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time. The following parameters are used:

Parameter Description
org_lng The longitude, in degrees, of the origin of the projection.
org_lat The latitude, in degrees, of the origin of the projection.
scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size. This is the X coordinate of the coordinate system origin.
y_off The false northing to be applied to all Y coordinates. This is the Y coordinate of the coordinate system origin.
quad An integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Datum Definition

The value of equatorial radius is extracted from the datum element of the cs_Csprm_ structure and used as the radius of the sphere. This is normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required element is:

Element Description
e_rad The radius of the earth, as a sphere, in meters.

cs_Gnomc_ Structure

The results of the one-time calculations are recorded in the gnomc element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSgnomcF, CSgnomcI, CSgnomcK, CSgnomcH, and CSgnomcC functions require as their first argument.

Goode Homolosine Projection (CShmlsn)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Goode Homolosine Projection. This projection is supported in spherical form only. The equatorial radius of the supplied ellipsoid is used as the radius of the sphere.

CShmlsnF forward conversion

int CShmlsnF (Const struct cs_Hmlsn_ *hmlsn, double xy[2], Const double ll[2]);

Given a properly initialized cs_Hmlsn_ structure via the hmlsn argument, CShmlsnF will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CShmlsnF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CShmlsnI Inverse conversion

int CShmlsnI (Const struct cs_Hmlsn_ *hmlsn, double ll[2], Const double xy[2]);

Given a properly initialized cs_Hmlsn_ structure via the hmlsn argument, CShmlsnI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CShmlsnI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system, or cs_CNVRT_INDF if the result is indefinite (e.g. longitude is not defined at the poles).

In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CShmlsnK parallel scale (K)

double CShmlsnK (Const struct cs_Hmlsn_ *hmlsn, Const double ll[2]);

CShmlsnK returns the grid scale factor along a parallel of any coordinate system based on this projection at any location. Analytical formulas for this value have not been located and the result is arrived at empirically the use of spherical trigonometry.

CShmlsnH meridian scale (H)

double CShmlsnH (Const struct cs_Hmlsn_ *hmlsn, Const double ll[2]);

CShmlsnH returns the grid scale factor along a meridian at the geodetic location specified by the ll argument. Analytical formulas for this value have not been located and the result is arrived at empirically the use of spherical trigonometry.

CShmlsnC Convergence angle

double CShmlsnC (Const struct cs_Hmlsn_ *hmlsn, Const double ll[2]);

CShmlsnC returns the convergence angle in degrees east of north of the geodetic location specified by the ll argument. Analytical formulas for this value have not been located and the result is arrived at through the use of the CS_azsphr function.

CShmlsnQ definition quality check

int CShmlsnQ (Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list [], int list_sz);

CShmlsnQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Goode Homolosine Projection. CS_cschk examines those definition components that are common to all coordinates systems (datum or ellipsoid reference, map scale, and units) and, therefore, CShmlsnQ only examines those components specific to the Goode Homolosine Projection. CShmlsnQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CShmlsnQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CShmlsnL Latitude/longitude check

int CShmlsnL (Const struct cs_Hmlsn_ *hmlsn, int cnt, Const double pnts[][3]);

CShmlsnL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the hmlsn argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CShmlsnsL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CShmlsnL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates is outside of the mathematical domain of the coordinate system.

CShmlsnX Xy coordinate check

int CShmlsnX (Const struct cs_Hmlsn_ *hmlsn, int cnt, Const double pnts[][3]);

CShmlsnX determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the hmlsn argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CShmlsnsX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CShmlsnL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CShmlsnS Setup (general)

void CShmlsnS (struct cs_Csprm_ *csprm);

The CShmlsnS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the origin longitude and other projection parameters are known, there are many calculations which need only be performed once. CShmlsnS performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the argument provided to CShmlsnS serves as the source for input and the repository for the results as described below.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time. The following parameters are used:

Parameter Description
org_lng The longitude, in degrees, of the origin of the projection (central meridian).
prj_prm1-24 The interrupted form of the Goode Homolosine Projection is fully supported. cs_Csdef _ elements prj_prm1 thru prj_prm24 can be used to specify the extents of the different zones. See CS_zones for information on how to encode zones.
scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size. This is the X coordinate of the coordinate system origin.
y_off The false northing to be applied to all Y coordinates. This is the Y coordinate of the coordinate system origin.
quad An integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Datum Definition

The value of equatorial radius is extracted from the datum element of the cs_Csprm_ structure and used as the radius of the sphere. This is normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required element is:

Element Description
e_rad The radius of the earth, as a sphere, in meters.

cs_Hmlsn_ Structure

The results of the one-time calculations are recorded in the hmlsn element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CShmlsnF, CShmlsnI, CShmlsnK, CShmlsnH, and CShmlsnC functions require as their first argument.

Hotine Oblique Mercator Projection (CSoblqm)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Hotine Oblique Mercator Projection. Since this projection is conformal, the K and H scale factors are the same and there is no H function. Six variations of this projection are supported.

CSoblqmF Forward conversion

int CSoblqmF (Const struct cs_Oblqm_ *oblqm, double xy 2], Const double ll[2]);

Given a properly initialized cs_Oblqm_ structure via the oblqm argument, CSoblqmF will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSoblqmF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CSoblqmI Inverse conversion

int CSoblqmI (Const struct cs_Oblqm_ *oblqm, double ll[2], Const double xy[2]);

Given a properly initialized cs_Oblqm_ structure via the oblqm argument, CSoblqmI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSoblqmI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system, or cs_CNVRT_INDF if the result is indefinite (e.g. longitude is not defined at the poles). In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are the first elements in these arrays, the Y coordinate and the latitude are the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSoblqmK scale (K)

double CSoblqmK (Const struct cs_Oblqm_ *oblqm, Const double ll[2]);

CSoblqmK returns the grid scale factor, along a parallel, of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array. This is calculated using CS_llazdd as we have been unable to locate definitive formulas for the grid scale factor for this projection.

CSoblqmC Convergence angle

double CSoblqmC (Const struct cs_Oblqm_ *oblqm, Const double ll[2]);

CSoblqmC returns the convergence angle is degrees east of north of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array. This is calculated using CS_llazdd as we have been unable to locate definitive formulas for the convergence angle for this projection.

CSoblqmQ definition quality check

int CSoblqmQ(Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list [], int list_sz);

CSoblqmQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Oblique Mercator (Hotine) Projection. CS_cschk examines those definition components that are common to all coordinates systems (datum or ellipsoid reference, map scale, and units) and, therefore, CSoblqmQ only examines those components specific to the Oblique Mercator (Hotine) Projection. CSoblqmQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSoblqmQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CSoblqmL Latitude/longitude check

int CSoblqmL (Const struct cs_Oblqm_ *oblqm, int cnt, Const double pnts[][3]);

CSoblqmL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the oblqm argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSoblqmsL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSoblqmL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CSoblqmX Xy coordinate check

int CSoblqmX (Const struct cs_Oblqm_ *oblqm, int cnt, Const double pnts[][3]);

CSoblqmX determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the oblqm argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSoblqmsX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSoblqmL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSoblqmS Setup

void CSoblqmS(struct cs_Csprm_ *csprm);

The CSoblqmS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the central great circle, the origin latitude, and other projection parameters are known, there are many calculations that need only be performed once. CSoblqmS performs these calculations and saves the results in the cs_Csprm_ structure provided by the csprm argument. Thus, this one argument provides CSoblqmS its input data and the repository for the results as described below.

CSoblqmS examines the prj_code element of the cs_Csprm_ structure to determine which of the six variations of this projection is to be setup. In most cases, the variations require different usage of the parameters in the cs_Csdef_ structure as defined below.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csldef function; but can be provided by the application at run time. The specific elements of the cs_Csdef_ structure that must be initialized for the Oblique Mercator projection are dependent upon the variation being implemented.

The following parameters apply to all six variations of the projection:

Parameter Description
scl_red The scale reduction that is to be applied.
Scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size.
y_off The false northing to be applied to all Y coordinates.
Quad An integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Single Point, Unrectified Hotine Oblique Mercator (cs_PRJCOD_HOM1UV)

This variation produces unrectified cartesian coordinates whose origin is the intersection of the central geodesic and the equator of the "aposphere". Rarely, if ever used; retained primarily for historical purposes.

Parameter Description
prj_prm1 Longitude, in degrees, of the central point of the projection.
prj_prm2 Latitude, in degrees, of the central point of the projection.
prj_prm3 The azimuth of the central great circle, in degrees east of north.

Two Point, Unrectified Hotine Oblique Mercator (cs_PRJCOD_HOM2UV)

This variation produces unrectified cartesian coordinates whose origin is the intersection of the central geodesic and the equator of the "aposphere." Rarely, if ever used; retained primarily for historical purposes.

Parameter Description
prj_prm1 Longitude, in degrees, of the first point on the central geodesic.
prj_prm2 Latitude, in degrees, of the first point on the central geodesic.
prj_prm3 Longitude, in degrees, of the second point on the central geodesic.
prj_prm4 Latitude, in degrees, of the second point on the central geodesic.
org_lat The latitude, in degrees, of the center of the coordinate system being defined. That is, the point on the central geodesic that has this latitude is the natural origin of the projection.

Alaska Variation, Hotine Oblique Mercator (cs_PRJCOD_HOM1XY)

This variation produces rectified cartesian coordinates whose origin is the intersection of the central geodesic and the equator of the "aposphere". The rectification technique is specific to Zone 1 of the Alaska State Plane Coordinate System. It is possible that this variation should also be used for the Great Lakes Survey, but this has not been verified as of this writing.

Parameter Description
prj_prm1 Longitude, in degrees, of the central point of the projection.
prj_prm2 Latitude, in degrees, of the central point of the projection.
prj_prm3 The azimuth of the central great circle, in degrees east of north.

Two Point, Rectified Hotine Oblique Mercator (cs_PRJCOD_HOM2XY)

This variation produces rectified cartesian coordinates whose origin is the intersection of the central geodesic and the equator of the "aposphere". Rarely, if ever used; retained primarily for historical purposes. To remain consistent with prior releases of CS-MAP, this variation uses the same rectification technique as the Alaska variation described immediately above.

Parameter Description
prj_prm1 Longitude, in degrees, of the first point on the central geodesic.
prj_prm2 Latitude, in degrees, of the first point on the central geodesic.
prj_prm3 Longitude, in degrees, of the second point on the central geodesic.
prj_prm4 Latitude, in degrees, of the second point on the central geodesic.
org_lat The latitude, in degrees, of the center of the coordinate system being defined. That is, the point on the central geodesic that has this latitude is the natural origin of the projection.

Rectified Skew Orthomorphic (cs_PRJCOD_RSKEW)

This variation produces rectified cartesian coordinates whose origin is the intersection of the central geodesic and the equator of the "aposphere". The rectification technique is that commonly used in places other than Alaska.

Parameter Description
prj_prm1 Longitude, in degrees, of the central point of the projection.
prj_prm2 Latitude, in degrees, of the central point of the projection.
prj_prm3 The azimuth of the central great circle, in degrees east of north.

Rectified Skew Orthomorphic Centered (cs_PRJCOD_RSKEWC)

This variation produces rectified cartesian coordinates, the origin of which is at the single defining point. The rectification technique is that commonly used in places other than Alaska.

Parameter Description
prj_prm1 Longitude, in degrees, of the central point of the projection.
prj_prm2 Latitude, in degrees, of the central point of the projection.
prj_prm3 The azimuth of the central great circle, in degrees east of north.

Datum Definition

The values of equatorial radius and eccentricity are extracted from the datum element of the cs_Csprm_ structure. These are normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required elements are:

Element Description
e_rad The equatorial radius of the earth in meters.
eccent This value represents the eccentricity of the ellipsoid.
to84_via An integer code that specifies the technique that is to be used to convert geographic coordinates based on this datum to WGS84.

cs_Oblqm_ Structure

The results of the one-time calculations are recorded in the oblqm element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSoblqmF, CSoblqmI, CSoblqmK, and CSoblqmC functions require as their first argument.

Krovak Oblique Conformal Conic

This set of functions represent the Coordinate System Mapping Package's knowledge of the Krovak Oblique Conformal Conic Projection. This projection is used in what used to be Czechoslovokia, and is now the Czech Republic and the Slovak Republic. Since this projection is conformal, the K and H scale factors are the same and there is no H function. Two variations of this projection are supported.

The first variation is the traditional projection as used since the 1920's. The second includes the affine transformation devised for use with the 1995 adjustment.

Please note that traditional Krovak X coordinates increase to the west. When such coordinates are used in the traditional CAD environment, the resulting images are mirrored and are (for most folks anyway) useless. Therefore, this implementation is such that what would normally be positive X coordinates are actually negative coordinates, and the magnitude of the values will be correct. In this way, the absolute value of the coordinate will be what is expected to see, but the coordinates will actually increase to the east, thus making AutoCAD, MicroStation, and other CAD type systems happy campers.

CSkrovkF Forward Conversion

int CSkrovkF (Const struct cs_Krovk_ *krovk, double xy[2], Const double ll[2]);

Given a properly initialized cs_Krovk_ structure via the krovk argument, CSkrovkF will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSkrovkF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

The xy and ll arrays may be the same array. The X coordinate and the longitude are the first elements in these arrays, the Y coordinate and the latitude are the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSkrovkI Inverse conversion

int CSkrovkI (Const struct cs_Krovk_ *krovk, double ll[2], Const double xy[2]);

Given a properly initialized cs_Krovk_ structure via the krovk argument, CSkrovkI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSkrovkI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system.

The xy and ll arrays may be the same array. The X coordinate and the longitude are the first elements in these arrays, the Y coordinate and the latitude are the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSkrovkK scale (K)

double CSkrovkK (Const struct cs_Krovk_ *krovk, Const double ll[2]);

CSkrovkK returns the grid scale factor of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array. The value cs_SclInf (defined to be 9,999.00 is CSdata.c) is returned if the ll provided is the oblique pole.

CSkrovkC Convergence angle

double CSkrovkC (Const struct cs_Krovk_ *krovk, Const double ll[2]);

CSkrovkC returns the convergence angle in degrees east of north of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array.

CSkrovkQ definition quality check

int CSkrovkQ (Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list [], int list_sz);

CSkrovkQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Krovak Oblique Conformal Conic Projection. CS_cschk examines those definition components that are common to all coordinates systems (datum or ellipsoid reference, map scale, and units) and, therefore, CSkrovakQ only examines those components specific to the Krovak Oblique Conformal Conic Projection. CSkrovkQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSkrovkQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

Bugs

In the original implementation of this projection, all parameters were hard coded and no checking was necessary. For release 10, this projection was rewritten to accept user defined parameters, but this quality check function was never updated. Therefore, at the current time, there is no parameter checking performed for this projection.

CSkrovkL Latitude/longitude check

int CSoblqmL (Const struct cs_Oblqm_ *oblqm, int cnt, Const double pnts[][3]);

CSoblqmL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the oblqm argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSoblqmsL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSoblqmL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CSkrovkX Xy coordinate check

int CSoblqmX (Const struct cs_Oblqm_ *oblqm,int cnt,Const double pnts [ ] [ 3] ) ;

At the current time, CSoblqmX returns cs_CNVRT_OK without performing any checks. The arguments are currently ignored. Again, this is due to the unusual legacy of this projection, and the fact that normal coordinates used in the Czech Repulic increase to the west rather than the east.

CSkrovkS Setup

void CSkrovkS (struct cs_Csprm_ *csprm);

The CSkrovkS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the origin longitude, origin latitude, oblique pole location, and other projection parameters are known, there are many calculations that need only be performed once. CSkrovkS performs these calculations and saves the results in the cs_Csprm_ structure provided by the csprm argument. Thus, this one argument provides CSkrovkS its input data and the repository for the results as described below.

CSkrovkS examines the prj_code element of the cs_Csprm_ structure to determine which of the two variations of this projection is to be setup. The projection code, therefore, simply determines if the 1995 adjustment transformation is applied to the resulting cartesian coordinates. The parameters for the affine tranformation are (currently) hard coded.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csldef function; but can be provided by the application at run time. The specific elements of the cs_Csdef_ structure that must be initialized for the Krovak Oblique Conformal Conic Projection are dependent upon the variation being implemented.

The following parameters apply to both variations of the projection:

Parameter Description
org_lng Longitude, in degrees, of the origin of the projection. As is commonly used in the Czech Repoublic, this is usually the prime meridian of Ferro.
org_lat Latitude, in degrees, of the origin of the projection.
prj_prm1 Longitude, in degrees, of the location of the pole of the oblique cone.
prj_prm2 Latitude, in degrees, of the location of the pole of the oblique cone.
prj_prm3 Latitude, in degrees on the oblique gaussian surface, of the single standard parallel of the conic projection surface.
scl_red The scale reduction that is to be applied.
Scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size.
y_off The false northing to be applied to all Y coordinates.
Quad An integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Krovak Oblique Conformal Conic, Czechoslovokia (cs_PRJCOD_)

This variation produces the traditional (i.e. unadjusted) Krovak coordinates used in Czechoslovakia since the 1920's. There are no special parameter requirements. Specifying this variation simply turns off the application of the 1995 adjustment.

Krovak Oblique Conformal Conic/95 Adjustment

This variation causes an affine transformation to be applied to the traditional coordinates, thus producing coordinates appropriate for the 1995 adjustment. There are no special parameter requirements (at this time). Specifying this variation simply turns on the affine transformation, the coefficients of which are hard coded.

Datum Definition

The values of equatorial radius and eccentricity are extracted from the datum element of the cs_Csprm_ structure. These are normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required elements are:

Element Description
e_rad The equatorial radius of the earth in meters.
eccent This value represents the eccentricity of the ellipsoid.
to84_via An integer code that specifies the technique that is to be used to convert geographic coordinates based on this datum to WGS84.

cs_Krovk_ Structure

The results of the one-time calculations are recorded in the oblqm* element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSkrovkF, CSkrovkI, CSkrovkK, and CSkrovkC functions require as their first argument.

Lambert Conformal Conic Projection (CSlmbrt)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Lambert Conformal Conic Projection. Since this projection is a conformal projection, the K and H scale factors are the same and there is no H function. Five variations of this projection are supported.

CSlmbrtF Forward conversion

int CSlmbrtF (Const struct cs_Lmbrt_ *lmbrt, double xy[2], Const double ll[2]);

Given a properly initialized cs_Lmbrt_ structure via the lmbrt argument, CSlmbrtF will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSlmbrtF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CSlmbrtI Inverse conversion

int CSlmbrtI (Const struct cs_Lmbrt_ *lmbrt, double ll[2], Const double xy[2]);

Given a properly initialized cs_Lmbrt_ structure via the lmbrt argument, CSlmbrtI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSlmbrtI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system, or cs_CNVRT_INDF if the result is indefinite (e.g. longitude is not defined at the poles).

In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSlmbrtK scale (K)

double CSlmbrtK (Const struct cs_Lmbrt_ *lmbrt, Const double ll[2]);
````

`CSlmbrtK` returns the grid scale factor, along a parallel, of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the **ll** array.

### CSlmbrtC convergence angle

```c
double CSlmbrtC (Const struct cs_Lmbrt_ *lmbrt, Const double ll[2]);

CSlmbrtC returns the convergence angle of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array.

CSlmbrtQ definition quality check

int CSlmbrtQ (Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list[], int list_sz);

CSlmbrtQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Lambert Conformal Conic Projection. CS_cschk examines those definition components that are common to all coordinates systems (datum or ellipsoid reference, map scale, and units) and, therefore, CSlmbrtQ only examines those components specific to the Lambert Conformal Conic Projection. CSlmbrtQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSlmbrtQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CSlmbrtL Latitude/longitude check

int CSlmbrtL (Const struct cs_Lmbrt_ *lmbrt, int cnt, Const double pnts[][3]);

CSlmbrtL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the lmbrt argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSlmbrtsL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSlmbrtL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CSlmbrtX Xy coordinate check

int CSlmbrtX (Const struct cs_Lmbrt_ *lmbrt, int cnt, Const double pnts[][3]);

CSlmbrtX determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the lmbrt argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSlmbrtsX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSlmbrtL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSlmbrtS setup

void CSlmbrtS (struct cs_Csprm_*csprm);

The CSlmbrtS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the standard parallels, the origin latitude and longitude, and other projection parameters are known, there are many calculations that need only be performed once. CSlmbrtS performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the single argument provided to CSlmbrtS serves as the source for input and the repository for the results as described below.

Coordinate system definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time.

Five variations of this projection are supported. CSlmbrtS determines which variation is to be setup by examining the prj_code element of the cs_Csprm_ structure. The actual use of parameters in the cs_Csdef_ structure (an element of the cs_Csprm_ structure) is dependent on the variation being setup.

The following elements of the cs_Csdef_ structure apply to all five variations:

Element Description
Scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size.
y_off The false northing to be applied to all Y coordinates.
quad An integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Parameter use specific to the five variations is:

Two Standard Parallels (cs_PRJCOD_LMBRT)

This is the traditional version of this projection. The degree of scale reduction to reduce and distribute scale distortion is specified by two standard parallels:

Element Description
prj_prm1 Latitude, in degrees, of the first standard parallel, usually the northernmost. For this projection, there is no distinction between the northern and southern standard parallels (i.e. they can be switched with no affect).
prj_prm2 Latitude, in degrees, of the second standard parallel, usually the southernmost. This is, rarely, the same as prj_prm1, to obtain a conic with a single point of tangency.
org_lng The longitude, in degrees, of the origin of the projection.
org_lat The latitude, in degrees, of the origin of the projection.

Single Standard Parallel (cs_PRJCOD_LM1SP)

This variation is commonly used outside of North America. It is, mathematically, virtually identical to what CS-MAP has long referred to as the Lambert Tangential. The degree of scale reduction to reduce and distribute scale distortion is specified by the scale reduction factor:

Element Description
org_lng The longitude, in degrees, of the origin of the projection.
org_lat The latitude, in degrees, of the origin of the projection.
scl_red The scale of the projection at the origin defined by org_lng and org_lat.

Belgian Variation (cs_PRJCOD_LMBLGN)

This is a minor variation to the traditional Two Standard Parallel version of the projection. This variation will produce the results required by some Belgian coordinate systems:

Parameter Description
prj_prm1 Latitude, in degrees, of the first standard parallel, usually the northernmost. For this projection, there is no distinction between the northern and southern standard parallels (i.e. they can be switched with no affect).
prj_prm2 Latitude, in degrees, of the second standard parallel, usually the southernmost. This is, rarely, the same as prj_prm1, to obtain a conic with a single point of tangency.
org_lng The longitude, in degrees, of the origin of the projection.
org_lat The latitude, in degrees, of the origin of the projection.

Wisconsin Variation (cs_PRJCOD_WCCSL)

This is a minor variation to the traditional Two Standard Parallel version of the projection. This variation supports the Wisconsin County Coordinate System group of coordinate systems. This variation uses a parallel ellipsoid technique to adjust horizontal coordinates for average elevation of the region being mapped:

Parameter Description
prj_prm1 Latitude, in degrees, of the first standard parallel, usually the northernmost. For this projection, there is no distinction between the northern and southern standard parallels (i.e. they can be switched with no affect).
prj_prm2 Latitude, in degrees, of the second standard parallel, usually the southernmost. This is, rarely, the same as prj_prm1, to obtain a conic with a single point of tangency.
prj_prm3 Average geoid separation, in meters, of the region being mapped.
prj_prm4 Average elevation above the geoid (i.e. orthometric height), in system units, of the region being mapped.
org_lng The longitude, in degrees, of the origin of the projection.
org_lat The latitude, in degrees, of the origin of the projection.

Minnesota Variation (cs_PRJCOD_MNDOTL)

This is a minor variation to the traditional Two Standard Parallel version of the projection. This variation supports the county coordinate systems developed by the Minnesota Department of Transportation. This variation uses a parallel ellipsoid technique (different from that used in Wisconsin, of course) to adjust horizontal coordinates for average elevation of the region being mapped:

Parameter Description
prj_prm1 Latitude, in degrees, of the first standard parallel, usually the northernmost. For this projection, there is no distinction between the northern and southern standard parallels (i.e. they can be switched with no affect).
prj_prm2 Latitude, in degrees, of the second standard parallel, usually the southernmost. This is, rarely, the same as prj_prm1, to obtain a conic with a single point of tangency.
prj_prm3 Average height above the ellipsoid, **in system units
org_lng The longitude, in degrees, of the origin of the projection.
org_lat The latitude, in degrees, of the origin of the projection.

Datum Definition

The values of equatorial radius and eccentricity are extracted from the datum element of the cs_Csprm_ structure. These are normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required elements are:

Element Description
e_rad The equatorial radius of the earth in meters.
eccent This value represents the eccentricity of the ellipsoid.
to84_via An integer code that specifies the technique that is to be used to convert geographic coordinates based on this datum to WGS84.

cs_Lmbrt_ Structure

The results of the one-time calculations are recorded in the lmbrt element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSlmbrtF, CSlmbrtI, CSlmbrtK, and CSlmbrtC functions require as their first argument.

Lambert Tangential Projection (CSlmtan)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Lambert Tangential Projection as used by the National Geographic Institute of France. Please note that the current implementation of this projection does not support the spherical form of the projection. With the addition of the single standard parallel variation of the Lambert Conformal Conic, these functions are now redundant; and will be removed in a future release.

CSlmtanF Forward conversion

int CSlmtanF (Const struct cs_Lmtan_ *lmtan, double xy[2], Const double ll[2]);

Given a properly initialized cs_Lmtan_ structure via the lmtan argument, CSlmtanF will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSlmtanF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CSlmtanI Inverse conversion

int CSlmtanI (Const struct cs_Lmtan_ *lmtan, double ll[2], Const double xy[2]);

Given a properly initialized cs_Lmtan_ structure via the lmtan argument, CSlmtanI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSlmtanI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system, or cs_CNVRT_INDF if the result is indefinite (e.g. longitude is not defined at the poles).

In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSlmtanK parallel scale (K)

double CSlmtanK (Const struct cs_Lmtan_ *lmtan, Const double ll[2]);

CSlmtanK returns the grid scale factor, along a parallel, of the coordinate system at the geodetic location given by the ll argument. Formulas for this calculation have not been located, therefore the result is obtained using the CS_llazdd function.

CSlmtanH meridian scale (H)

double CSlmtanH (Const struct cs_Lmtan_ *lmtan, Const double ll[2]);

CSlmtanH returns the grid scale factor, along a meridian, of the coordinate system at the geodetic location given by the ll argument. Formulas for this calculation have not been located, therefore the result is obtained from the use of the CS_llazdd function.

CSlmtanC Convergence angle

double CSlmtanC (Const struct cs_Lmtan_ *lmtan, Const double ll[2]);

CSlmtanC returns the convergence angle in degrees east of north of the coordinate system at the geodetic location given by the ll argument. Formulas for this calculation have not been located, therefore the result is obtained using the CS_llazdd function.

CSlmtanL Latitude/longitude check

int CSlmtanL (Const struct cs_Lmtan_ *lmtan, int cnt, Const double pnts [][3]);

CSlmtanL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the lmtan argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSlmtansL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSlmtanL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CSlmtanQ definition quality check

int CSlmtanQ(Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list[], int list_sz);

CSlmtanQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Lambert Tangential Projection. CS_cschk examines those definition components that are common to all coordinates systems (datum or ellipsoid reference, map scale, and units) and, therefore, CSlmtanQ only examines those components specific to the Lambert Tangential Projection. CSlmtanQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSlmtanQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CSlmtanX Xy coordinate check

int CSlmtanX (Const struct cs_Lmtan_ *lmtan, int cnt, Const double pnts [][3]);

CSlmtanX determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the lmtan argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSlmtansX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSlmtanL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSlmtanS setup

void CSlmtanS (struct cs_Csprm_ *csprm);

The CSlmtanS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the origin latitude and longitude, the scale reduction factor, and other projection parameters are known, there are many calculations that need only be performed once. CSlmtanS performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the single argument provided to CSlmtanS serves as the source for input and the repository for the results as described below.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time. The specific elements of the cs_Csdef_ structure that must be initialized for the Lambert Tangential projection are:

Element Description
org_lng The longitude, in degrees, of the origin of the projection relative to Greenwich.
org_lat The latitude, in degrees, of the origin of the projection relative to the equator.
scl_red The scale reduction factor that is to be applied to the projection.
scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size. This value is the X coordinate of the coordinate system origin.
y_off The false northing to be applied to all Y coordinates. This value is the Y coordinate of the coordinate system origin.
quad An integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Datum Definition

The values of equatorial radius and eccentricity are extracted from the datum element of the cs_Csprm_ structure. These are normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required elements are:

Element Description
e_rad The equatorial radius of the earth in meters.
eccent This value represents the eccentricity of the ellipsoid.
to84_via An integer code that specifies the technique that is to be used to convert geographic coordinates based on this datum to WGS84.

cs_Lmtan_ Structure

The results of the one-time calculations are recorded in the lmtan element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSlmtanF, CSlmtanI, CSlmtanK, CSlmtanH, and CSlmtanC functions require as their first argument.

Mercator Projection (CSmrcat)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Mercator Projection. Since this projection is conformal, the K and H grid scales are the same and there is no H function.

CSmrcatF Forward conversion

int CSmrcatF (Const struct cs_Mrcat_ *mrcat, double xy[2], Const double ll[2]);

Given a properly initialized cs_Mrcat_ structure via the mrcat argument, CSmrcatF will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSmrcatF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CSmrcatI Inverse conversion

int CSmrcatI (Const struct cs_Mrcat_ *mrcat, double ll[2], Const double xy[2]);

Given a properly initialized cs_Mrcat_ structure via the mrcat argument, CSmrcatI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSmrcatI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system.

In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSmrcatK scale (K) along a parallel

double CSmrcatK (Const struct cs_Mrcat_ *mrcat, Const double ll[2]);

CSmrcatK returns the grid scale factor, along a parallel, of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array.

CSmrcatC Convergence angle

double CSmrcatC (Const struct cs_Mrcat_ *mrcat, Const double ll[2]);

CSmrcatC returns the value 0.0 which represents the convergence in degrees east of north of nay coordinate system based on this projection at any latitude and longitude.

CSmrcatQ definition Quality check

int CSmrcatQ (Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list[], int list_sz);

CSmrcatQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Mercator Projection. CS_cschk examines those definition components that are common to all coordinates systems (datum or ellipsoid reference, map scale, and units) and, therefore, CSmrcatQ only examines those components specific to the Mercator Projection. CSmrcatQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSmrcatQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CSmrcatL Latitude/longitude check

int CSmrcatL (Const struct cs_Mrcat_ *mrcat, int cnt, Const double pnts[][3]);

CSmrcatL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the mrcat argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSmrcatsL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSmrcatL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CSmrcatX Xy coordinate check

int CSmrcatX (Const struct cs_Mrcat_ *mrcat, int cnt, Const double pnts[][3]);

CSmrcatX determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the mrcat argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSmrcatsX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSmrcatL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSmrcatS setup

void CSmrcatS (struct cs_Csprm_*csprm);

The CSmrcatS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the standard parallel, the origin longitude, and other projection parameters are known, there are many calculations that need only be performed once. CSmrcatS performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the single argument provided to CSmrcatS serves as the source for input and the repository for the results as described below.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time. The specific elements of the cs_Csdef_ structure which must be initialized for the Mercator Projection are:

Element Description
prj_prm1 Longitude, in degrees, of the central meridian of the coordinate system (or map).
prj_prm2 Latitude, in degrees, of the standard parallel, usually zero indicating the equator. Using a non-zero value has an affect similar to that of the scale reduction factor of other cylindrical projections.
scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size.
y_off The false northing to be applied to all Y coordinates.
quad An integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Datum Definition

The values of equatorial radius and eccentricity are extracted from the datum element of the cs_Csprm_ structure. These are normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required elements are:

Element Description
e_rad The equatorial radius of the earth in meters.
eccent This value represents the eccentricity of the ellipsoid.
to84_via An integer code that specifies the technique that is to be used to convert geographic coordinates based on this datum to WGS84.

cs_Mrcat_ Structure

The results of the one-time calculations are recorded in the mrcat element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSmrcatF, CSmrcatI, CSmrcatK, and CSmrcatC functions require as their first argument.

Miller Projection (CSmillr)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Miller Projection. This projection is only used in the spherical form. Thus, all functions assume a sphere with a radius equal to the equatorial radius of the ellipsoid provided.

CSmillrF Forward conversion

int CSmillrF (Const struct cs_Millr_ *millr, double xy[2], Const double ll[2]);

Given a properly initialized cs_Millr_ structure via the millr argument, CSmillrF will convert the latitude and longitude provided in the ll array to X and Y coordinates, returning the result in the xy array. CSmillrF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CSmillrI Inverse conversion

int CSmillrI (Const struct cs_Millr_ *millr, double ll[2], Const double xy[2]);

Given a properly initialized cs_Millr_ structure via the millr argument, CSmillrI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSmillrI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system.

In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSmillrK scale (K) along a parallel

double CSmillrK (Const struct cs_Millr_ *millr, Const double ll[2]);

CSmillrK returns the grid scale factor, along a parallel, of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array.

CSmillrH scale (H) along a meridian

double CSmillrH (Const struct cs_Millr_ *millr, Const double ll[2]);

CSmillrH returns the grid scale factor, along a meridian, of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array.

CSmillrC Convergence angle

double CSmillrC (Const struct cs_Millr_ *millr, Const double ll[2]);

CSmillrC returns the value 0.0 which represents the convergence angle in degrees east of north of any coordinate system based on this projection at any latitude and longitude.

CSmillrL Latitude/longitude check

int CSmillrL (Const struct cs_Millr_ *millr, int cnt, Const double pnts[][3]);

CSmillrL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the millr argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSmillrsL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSmillrL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CSmillrQ definition Quality check

int CSmillrQ (Const struct cs_Csdef_ *csdef, unsigned short prj_code, int *err_list[], int list_sz);

CSmillrQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Miller Cylindrical Projection. CS_cschk examines those definition components that are common to all coordinates systems (datum or ellipsoid reference, map scale, and units) and, therefore, CSmillrQ only examines those components specific to the Miller Cylindrical Projection. CSmillrQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSmillrQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CSmillrX Xy coordinate check

int CSmillrX (Const struct cs_Millr_ *millr, int cnt, Const double pnts[][3]);

CSmillrX determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the millr argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSmillrsX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSmillrL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSmillrS setup

void CSmillrS (struct cs_Csprm_*csprm);

The CSmillrS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the origin longitude and other projection parameters are known, there are many calculations that need only be performed once. CSmillrS performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the single argument provided to CSmillrS serves as the source for input and the repository for the results as described below.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time. The specific elements of the cs_Csdef_ structure that must be initialized for the Miller Projection are:

Element Description
prj_prm1 Longitude, in degrees, of the central meridian of the coordinate system (or map).
scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size.
y_off The false northing to be applied to all Y coordinates.
quad an integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Datum Definition

The value of equatorial radius is extracted from the datum element of the cs_Csprm_ structure and used as the radius of the sphere. This is normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required element is:

Element Description
e_rad The radius of the earth, as a sphere, in meters.

cs_Millr_ Structure

The results of the one-time calculations are recorded in the millr element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSmillrF, CSmillrI, CSmillrK, CSmillrH, and CSmillrC functions require as their first argument.

Modified Polyconic Projection (CSmodpc)

This set of functions represent the Coordinate System Mapping Package's knowledge of the Modified Polyconic Projection. That is, the projection developed by Lallemand of France and adopted by the International Map Committee (IMC) in London as the basis for the 1:1,000,000 scale International Map of the World (IMW) series in 1909.

CSmodpcF Forward conversion

int CSmodpcF (Const struct cs_Modpc_ *modpc, double xy[2], Const double ll[2]);

Given a properly initialized cs_Modpc_ structure via the modpc argument, CSmodpcF will convert the latitude and longitude provided in the a array to X and Y coordinates, returning the result in the xy array. CSmodpcF normally returns cs_CNVRT_NRML. If ll is not within the domain of the coordinate system, xy is set to a "rational" result and cs_CNVRT_RNG is returned.

CSmodpcI Inverse conversion

int CSmodpcI (Const struct cs_Modpc_ *modpc, double ll[2], Const double xy[2]);

Given a properly initialized cs_Modpc_ structure via the modpc argument, CSmodpcI will convert the X and Y coordinates given in the xy array to latitude and longitude and return the result in the ll array. CSmodpcI normally returns cs_CNVRT_NRML. It will return cs_CNVRT_RNG if the xy value is not within the domain of the coordinate system, or cs_CNVRT_INDF if the result is indefinite (e.g. longitude is not defined at the poles).

In both cases above, the xy and ll arrays may be the same array. The X coordinate and the longitude are carried in the first element in these arrays, the Y coordinate and the latitude in the second element. The latitude and longitude values are in degrees where negative values are used to represent west longitude and south latitude.

CSmodpcK grid scale (K), along parallel

double CSmodpcK ( Const struct cs_Modpc_ *modpc, Const double ll[2]);

CSmodpcK returns the grid scale factor, as measured along a parallel, of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array. (The use of the ll array is the same as described above.) At the current time, formulas that analytically produce the grid scale factor for this projection elude us. Thus, the grid scale factor is determined using the CS_llazdd function.

CSmodpcH grid scale (H), along meridian

double CSmodpcH ( Const struct cs_Modpc_ *modpc, Const double ll[2]);

CSmodpcH returns the grid scale factor, as measured along a meridian, of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array. At the current time, formulas that analytically produce the grid scale factor for this projection elude us. Thus, the grid scale factor is determined using the CS_llazdd function.

CSmodpcC Convergence angle

double CSmodpcC (Const struct cs_Modpc_ *modpc, Const double ll[2]);

CSmodpcC returns the convergence angle of the coordinate system at the specific geodetic location defined by the latitude and longitude provided in the ll array. At the current time, formulas that analytically produce the convergence angle for this projection elude us. Thus, the grid scale factor is determined using the CS_llazdd function.

CSmodpcB Basic calculations

double CSmodpcB (Const struct cs_Modpc_ *modpc, Const double ll[2], double xy[2], double *their_yc);

Inverse calculations for this projection are performed using an iterative algorithm calling the forward function. CSmodpcB converts geographic coordinates to cartesian coordinates in a form that can be used by both CSmodpcF and CSmodpcI; thus eliminating duplicate code in these modules. The their_yc argument provides for the return to the calling function of an additional intermediary result that is required for the inverse calculation.

CSmodpcQ definition Quality check

int CSmodpcQ ( Const struct cs_Csdef_ *csdef , unsigned short prj_code, int *err_list [], int list_sz);

CSmodpcQ determines if the coordinate system definition provided by the csdef argument is consistent with the requirements of the Modified Polyconic Projection. CS_cschk examines those definition components that are common to all coordinates systems (datum or ellipsoid reference, map scale, and units) and, therefore, CSmodpcQ only examines those components specific to the Modified Polyconic Projection. CSmodpcQ returns in err_list an integer code value for each error condition detected, being careful not to exceed the size of err_list as indicated by the list_sz argument. The number of errors detected, regardless of the size of err_list, is always returned. Refer to CSerpt for a description of the various error codes and their meaning. CSmodpcQ may be called with the NULL pointer and/or a zero for the err_list and list_sz arguments respectively.

CSmodpcL Latitude/longitude check

int CSmodpcL ( Const struct cs_Modpc_ *modpc, int cnt, Const double pnts[][3]);

CSmodpcL determines if the geographic coordinates, great circles, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the modpc argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a great circle (cnt == 2), or a closed region (cnt > 3). CSmodpcsL's return value will apply to all coordinates, coordinates on the great circles, and all coordinates within the regions thus defined. CSmodpcL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject geographic coordinates are outside of the mathematical domain of the coordinate system.

CSmodpcX Xy coordinate check

int CSmodpcX (Const struct cs_Modpc_ *modpc, int cnt, Const double pnts[][3]);

CSmodpcX determines if the cartesian coordinates, lines, and/or regions defined by the coordinate list provided by the pnts and cnt arguments are within the mathematical domain of the coordinate system provided by the modpc argument. The pnts and cnt arguments can define a single coordinate (cnt == 1), a line (cnt == 2), or a closed region (cnt > 3). CSmodpcsX's return value will apply to all coordinates, coordinates on the lines, and all coordinates within the regions thus defined. CSmodpcL returns cs_CNVRT_OK if all subject coordinates are within the mathematical domain of the coordinate system. cs_CNVRT_DOMN is returned if one or more of the subject coordinates is outside of the mathematical domain of the coordinate system.

CSmodpcS Setup

void CSmodpcS (struct cs_Csprm_ *csprm);

The CSmodpcS function performs all calculations that need only be performed once, given the definition of a specific coordinate system. That is, once the standard meridians, the standard parallels, and other projection parameters are known, there are many calculations that need only be performed once. CSmodpcS performs these calculations and saves the results in the cs_Csprm_ structure provided by its argument, csprm. Thus, the single argument provided to CSmodpcS serves as the source for input and the repository for the results as described below.

Coordinate System Definition

The definition of the coordinate system is extracted from the csdef element of the cs_Csprm_ structure. Usually, this is obtained from the Coordinate System Dictionary by the CS_csdef function; but can be provided by the application at run time. The specific elements of the cs_Csdef_ structure that must be initialized for the Modified Polyconic projection are:

Element Description
prj_prm1 Longitude, in degrees, of the central meridian.
prj_prm2 Longitude, in degrees, of the Eastern meridian. The Western meridian is assumed to be west of the Central Meridian by the same amount that the Eastern Meridian is east of the Central Meridian. The Eastern meridian must be east of the central meridian, and not more than 15 degrees of longitude from the central meridian.
prj_prm3 Latitude, in degrees, of the Northern Standard Parallel.
prj_prm4 Latitude, in degrees, of the Southern Standard Parallel.
scale The scale of the coordinate system. This one factor must include the conversion from meters to coordinate system units and the mapping scale that is to be applied.
x_off The false easting to be applied to all X coordinates, usually selected to cause all X coordinates within the coordinate system to be positive values of reasonable size.
y_off The false northing to be applied to all Y coordinates.
quad An integer that indicates the cartesian quadrant of the coordinate system, 1 thru 4. A negative value indicates that the axes are to be swapped after the coordinates have been placed in the indicated quadrant.

Neither standard parallel may be a pole, nor can the two standard parallels be the same as is supported in other projections. In addition, the Northern Standard Parallel must be the northernmost of the two standard parallels. Finally, the two standard parallels must be within 15 degrees of each other. Note that the projection was designed for maps whose extents are 6 degrees of longitude and 4 degrees of latitude.

Datum Definition

The values of equatorial radius and eccentricity are extracted from the datum element of the cs_Csprm_ structure. These are normally obtained from the Ellipsoid Dictionary by the CS_dtloc function, but may be supplied by the application at run time. Specifically, the required elements are:

Element Description
e_rad The equatorial radius of the earth in meters.
eccent This value represents the eccentricity of the ellipsoid.
to84_via An integer code that specifies the technique that is to be used to convert geographic coordinates based on this datum to WGS84.

cs_Modpc_ Structure

The results of the one-time calculations are recorded in the modpc element of the prj_prms union of the cs_Csprm_ structure. It is a pointer to this initialized structure that the CSmodpcF, CSmodpcI, CSmodpcK, CSmodpcH, CSmodpcC, and CSmodpcB functions require as their first argument.

BUGS

As is true with all other projections in CS-MAP, values submitted for conversion are not checked for validity before conversion for performance reasons. In every other case, this does not appear to be a problem. However, experience has show that values which are more than 50% outside the area covered by the projection parameters can produce errors which get reported through matherr. Checking of input values does need to be added to the functions of this projection.