It is often necessary to represent position in several different spatial reference frames, simultaneously, according to the context in which the position is to be used. Each spatial reference frame corresponds to a particular way of expressing position. Spatial reference frames may be relative to moving objects (Examples: planets and spacecraft), and therefore have values that are a function of time. It is necessary to specify the time to which the spatial position refers, and the time for which the spatial reference frame is defined.
The Spatial Reference Model (SRM) defines the conceptual model and the methodologies that allow the description, and transformation or conversion, of geometric properties within or among spatial reference frames. The Spatial Reference Model (SRM) supports unambiguous specification of the positions, directions, distances, and times associated with spatial information. It also defines algorithms for precise transformation of positions, directions and distances among different spatial reference frames.
A spatial reference frame template is the basis for realizing spatial reference frames that share the same CS, similar ORMs, and the same structure in the binding of CS parameter values. Spatial reference frames may be organized into specified sets so as to form an atlas for a large region of space. SRM specifies a collection of spatial reference frame templates (SRFT), realizations of those templates (Standard SRF), and sets of those realizations (SRFS).
SRM defined the following SRF Templates:
SRM defined the following SRF Sets:
SRM defined the following Standard SRFs:
Examples of ORMs are: World Geodesic System 1984 (WGS 1894), COAMPS, and Heliocentric Arieas Ecliptic.
Examples of coordinates are: Celestiocentric 3D coordinate, Local Space Rectangular 2D coordinate, and Transverse Mercator surface coordinate.
These are conversions that have an algorithm implemented between the source SRF and the target SRF. For instance, the coordinate conversion from a Celestiodetic SRF to a Celestiocentric SRF is a direct conversion. This type of conversion does not involve intermediate SRFs for its computation and thus they are most efficient.
These conversions are chains of direct conversions, converting first from the source SRF to intermediate SRFs, then to the target SRF. Consequently, these conversions typically take more time to be executed. For instance, the coordinate conversion from a Transverse Mercator SRF to a Celestiocentric SRF is an indirect conversion going through an intermediary conversion to Celestiodetic SRF.
Reflexive conversions are the cases where the source and the target SRFs are of the same type. The trivial case of this type of conversion is when the source and the target SRFs have the exact same parameter values. In that case, the identity transformation is applied to the source coordinate. Another example, to convert from a CD SRF to another CD SRF with a different ORM/HSR pair. In that case, a datum shift is performed by converting the coordinate from the source CD SRF to an intermediate CC SRF, apply the datum shift and then to the target CD SRF.
The chart below is provided as a reference to indicate which coordinate conversions are supported in SRM Version 4.0.0. Empty cells indicate conversion not supported in 4.0.0.
AZ | CC | CD | CM | EC | EI | HAEC | HEEC | HEEQ | LCC | LSR_2D | LSR_3 | LTSAS | LTSC | LTSE | M | OM | PD | Polar | PS | SEC | SEQ | SME | SMD | TM | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
AZ | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
CC | . | R | D | . | I | . | D | D | D | I | . | . | I | I | D | I | I | D | . | I | . | . | . | . | I |
CD | . | D | R | . | D | . | I | I | I | D | . | . | I | I | I | D | D | R | . | D | . | . | . | . | D |
CM | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
EC | . | I | D | . | R | . | I | I | I | I | . | . | II | I | I | I | D | I | . | I | . | . | . | . | I |
EI | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
HAEC | . | D | I | . | I | . | R | . | . | I | . | . | I | I | I | I | I | I | . | I | . | . | . | . | I |
HEEC | . | D | I | . | I | . | . | R | . | I | . | . | I | I | I | I | I | I | . | I | . | . | . | . | I |
HEEQ | . | D | I | . | I | . | . | . | R | I | . | . | I | I | I | I | I | I | . | I | . | . | . | . | I |
LCC | . | I | D | . | I | . | I | I | I | R | . | . | I | I | I | I | I | D | . | I | . | . | . | . | I |
LSR_2D | . | . | . | . | . | . | . | . | . | . | R | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
LSR_3D | . | . | . | . | . | . | . | . | . | . | . | R | . | . | . | . | . | . | . | . | . | . | . | . | . |
LTSAS | . | I | I | . | I | . | I | I | I | I | . | . | R | . | D | I | I | I | . | I | . | . | . | . | I |
LTSC | . | I | I | . | I | . | I | I | I | I | . | . | . | R | D | I | I | I | . | I | . | . | . | . | I |
LTSE | . | D | I | . | I | . | I | I | I | I | . | . | D | D | R | I | I | I | . | I | . | . | . | . | I |
M | . | I | D | . | I | . | I | I | I | I | . | . | I | I | I | R | I | D | . | I | . | . | . | . | I |
OM | . | I | D | . | I | . | I | I | I | I | . | . | I | I | I | I | R | D | . | I | . | . | . | . | I |
PD | . | D | R | . | D | . | I | I | I | D | . | . | I | I | I | D | D | R | . | D | . | . | . | . | D |
Polar | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
PS | . | I | D | . | I | . | I | I | I | I | . | . | I | I | I | I | I | D | . | R | . | . | . | . | I |
SEC | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
SEQ | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
SME | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
SMD | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . | . |
TM | . | I | D | . | I | . | I | I | I | I | . | . | I | I | I | I | I | D | . | I | . | . | . | . | R |
The details on how to allocate SRFs, allocate coordinates and convert coordinates are as follows:
There are three ways to allocate SRFs depending whether they are instances of SRF Templates, SRF Sets, or standard SRFs. Once a SRF is allocated, its parameter values cannot be changed:
There are 25 SRF Template types in SRM. These include SRF_Celestiodetic, SRF_Celestiocentric, SRF_LocalSpaceRectangular3D, and Transverse Mercator. Use specific SRM_CreateSRF_XX functions to allocate these types of SRF. For example, to allocate a Celestiodetic SRF using the WGS 1984 ORM with the Identity HSR transformation:
SRM_SRF cd_srf; SRM_Status_Code status; SRM_ORM_Parameters cd_params; cd_params.orm_code = SRM_ORM_WGS_1984; cd_params.hsr_code = SRM_HSR_WGS_1984_IDENTITY; status = SRM_CreateSRF_CD( cd_params, &cd_srf );
There are 7 SRF Sets currently defined in SRM. These include Universal Transverse Mercator (UTM), Geo Tile Reference System (GRTS) Global Coordinate System (GCS), and Universal Polar Stereographic (UPS). Each of these SRF Sets are composed of a well-defined set of members. For example, UTM is composed of 120 members (zones) while GTRS GCS has 59,896 members (cell ids). These SRF Set members can be allocated by invoking the SRM_CreateSRFSetMember function with proper SRM SET Code and member code. For example, to allocate an UTM member zone 12 in North hemisphere using the WGS 1984 ORM with the Identity HSR transformation:
SRM_SRF utm12_srf; SRM_Status_Code status; SRM_ORM_Parameters utm_params; cd_params.orm_code = SRM_ORM_WGS_1984; cd_params.hsr_code = SRM_HSR_WGS_1984_IDENTITY; status = SRM_CreateSRFSetMember( SRM_SRFS_UNIVERSAL_TRANSVERSE_MERCATOR, SRM_SSM_UTM_ZONE_12_NORTHERN_HEMISPHERE, utm_params, &utm12_srf );The SRF template type for the Universal Transverse Mercator SRF is intrinsically Transverse Mercator. In other words, the allocated UTM SRF is an instance of the Transverse Mercator SRF Template, and therefore, supports all the function applicable to that SRF Template. Likewise, for example, a GTRS GCS SRF is intrinsically an instance of the Local Tangent Space Euclidean SRF Template.
There are 15 Standard SRFs currently defined in SRM. These include British National Grid (BNG), Irish Grid, and the Maryland State Plane Coordinate System (SPCS). Instances of these Standard SRFs can be allocated by invoking the SRM_CreateStandardSRF() function using the proper SRF code. For example, to allocate an instance of BNG:
SRM_SRF bng_srf; SRM_Status_Code status; status = SRM_CreateStandardSRF( SRM_SRF_BRITISH_NATIONAL_GRID, &bng_srf );The SRF template type for the British National Grid SRF is intrinsically Transverse Mercator. In other words, the allocated BNG SRF is an instance of the Transverse Mercator SRF Template, and therefore, supports all the functions applicable to that SRF Template. Likewise, for example, a Maryland SPCS SRF is intrinsically an instance of the Lambert Conformal Conic SRF Template.
There are no SRF parameter arguments for the creation of Standard SRFs because these SRFs have all their parameters pre-defined.
Each SRF Template has its specific coordinates defined. The coordinates is only valid when associated with a specific SRF. Depending on the SRF allocated, 2D, 3D or surface coordinates can be associated with it. Use the SRM_CreateCoordinateXX_YY function to allocate the coordinates, where "XX" is related to the SRF template and the YY is either 2D, 3D or Surface coordinate:
For example, to allocate a 3D coordinate for a Celestiodetic SRF:
SRM_Status_Code status; SRM_Coordinate cd_3d_coord; SRM_CD_3D_Coordinate cd_3d_comp; cd_3d_comp.latitude = 0.8987; cd_3d_comp.longitude = 0.5645; cd_3d_comp.ellipsoidal_height = 1000.0; status = SRM_CreateCoordinateCD_3D( cd_srf, cd_3d_comp, &cd_3d_coord );Another example, to allocate a UTM surface coordinate for a UTM SRF:
SRM_Status_Code status; SRM_Coordinate utm_surf_coord; SRM_Map_Projection_Surface_Coordinate utm_surf_comp; utm_surf_comp.easting = 550.0; utm_surf_comp.northing = 320.0; status = SRM_CreateCoordinateMap_Projection_Surface ( utm12_srf, utm_surf_comp, &utm_surf_coord );
Having allocated the source SRF, the source coordinate, the target SRF, and the target coordinate, invoke the SRM_ChangeCoordinateSRF() to calculate the target coordinate and the Valid Region. For example, to convert a Celestiodetic 3D coordinate to a Transverse Mercator SRF:
status = SRM_ChangeCoordinateSRF( cd_srf, cd_3d_coord, utm12_srf, &utm12_3d_coord, &valid_region );
A Direction object can be allocated using the SRM_CreateDirection() function. For example, to allocate a Direction using a Celestiodetic 3D coordinate "cd_ref_location" associated with and a direction vector (1.0, 2.0, 3.0):
SRM_Status_Code status; Direction cd_dir; SRM_Long_Float vector[3] = { 1.0, 2.0, 3.0 }; status = SRM_CreateDirection( cd_srf, cd_ref_location, vector, &cd_dir );The Celectiodetic SRF "cd_srf" must be the same one associated with both the reference location "cd_ref_location" and the direction object "cd_dir".
Having allocated the source and target SRFs and Directions, invoke the SRM_ChangeDirectionSRF() function to calculate the target direction and the Valid Region. For example, to convert the Celestiodetic direction to a Transverse Mercator SRF "tm_srf":
SRM_Status_Code status; status = SRM_ChangeDirectionSRF( cd_srf, cd_dir, tm_srf, &tm_dir, &valid_region);In converting a Direction, both its reference location and the vector are converted to the target SRF. The valid region is associated with the resulting reference location.
An Orientation object can be allocated using the SRM_CreateOrientation() function. For example, to allocate a Direction using a Celestiodetic 3D coordinate "cd_ref_location" associated with and an identity matrix:
SRM_Status_Code status; Orientation cd_ori; SRM_Long_Float ident_mat[3][3] = { {1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0} }; status = SRM_CreateOrientation( cd_srf, cd_ref_location, ident_mat, &cd_ori );The Celestiodetic SRF "cd_srf" must be the same one associated with both the reference location "cd_ref_location" and the direction object "cd_ori".
Having allocated the source and target SRFs and orientations, invoke the SRM_ChangeOrientationSRF() function to calculate the target orientation and the Valid Region. For example, to convert the Celestiodetic orientation to a Transverse Mercator SRF "tm_srf":
SRM_Status_Code status; status = SRM_ChangeOrientationSRF( cd_Srf, cd_ori, tm_srf, &tm_ori, &valid_region);In converting an Orientation, both its reference location and the matrix are converted to the target SRF. The valid region is associated with the resulting reference location.
#includeExecuting the sample code would result the following output:#include #include "srm_level_0.h" int main ( int argc, char* argv[] ) { SRM_SRF cc_srf; SRM_SRF cd_srf; SRM_Coordinate cd_coord; SRM_CD_3D_Coordinate cd_coord_info; SRM_Coordinate cc_coord; SRM_Euclidean_3D_Coordinate cc_coord_info; SRM_ORM_Parameters cc_params; SRM_ORM_Parameters cd_params; SRM_Status_Code status; printf( "Running SRM Sample test program...\n" ); cc_params.orm_code = SRM_ORM_WGS_1984; cc_params.hsr_code = SRM_HSR_WGS_1984_IDENTITY; cd_params.orm_code = SRM_ORM_WGS_1984; cd_params.hsr_code = SRM_HSR_WGS_1984_IDENTITY; if(( status = SRM_CreateSRF_CC( cc_params, &cc_srf )) != SRM_STAT_CODE_SUCCESS ) { fprintf( stderr, "Failed to create CC SRF\n" ); } else if(( status = SRM_CreateSRF_CD( cd_params, &cd_srf )) != SRM_STAT_CODE_SUCCESS ) { fprintf( stderr, "Failed to create CD SRF\n" ); SRM_FreeSRF( cc_srf ); } else { cd_coord_info.longitude = 0.0; cd_coord_info.latitude = 0.785398163397; cd_coord_info.ellipsoidal_height = 0.0; if(( status = SRM_CreateCoordinateCD_3D( cd_srf, &cd_coord_info, &cd_coord )) != SRM_STAT_CODE_SUCCESS ) { fprintf( stderr, "Failed to create CD coordinate\n" ); } else { if(( status = SRM_ChangeCoordinateSRF( cd_srf, cd_coord, cc_srf, &cc_coord, NULL )) != SRM_STAT_CODE_SUCCESS ) { fprintf( stderr, "SRM_ChangeCoordinateSRF failed\n" ); } else { if(( status = SRM_GetCoordinateEuclidean_3D( cc_coord, &cc_coord_info )) != SRM_STAT_CODE_SUCCESS ) { fprintf( stderr, "Failed to get CC coordinate information\n" ); } else { printf( "[ %f, %f, %f ]\n", cc_coord_info.u, cc_coord_info.v, cc_coord_info.w ); } SRM_FreeCoordinate( cc_coord ); } SRM_FreeCoordinate( cd_coord ); } SRM_FreeSRF( cd_srf ); SRM_FreeSRF( cc_srf ); } return 0; }
Running SRM Sample test program... [ 4517590.878846, 0.000000, 4487348.408859 ]
Return to: Top
Copyright © 2004 SEDRIS