loading

How to Use IAU Identifiers in PROJ

Scenario: Use OGC identifier in PROJ

To use IAU identifiers in PROJ, you can use the following Python code:

                  
                    >>> from pyproj import CRS
                    >>> CRS('urn:ogc:def:crs:IAU:2015:19900')
                    <Geographic 2D CRS: IAU_2015:19900>
                    Name: Mercury (2015) - Sphere / Ocentric

                    Axis Info [ellipsoidal]:
                    - Lat[north]: Geodetic latitude (degree)
                    - Lon[east]: Geodetic longitude (degree)

                    Area of Use:
                    - undefined

                    Datum: Mercury (2015)
                    - Sphere
                    - Ellipsoid: Mercury (2015) - Sphere - Prime Meridian: Reference Meridian
                  
                

This code creates a Coordinate Reference System (CRS) object using the `pyproj` library and the specified IAU identifier.

Scenario: Querying for Mercury Identifiers and Creating an OGC Identifier

Follow these steps to search for Mercury identifiers and create an OGC identifier:

Step 1: Search for Mercury Identifiers

Make a query to search for identifiers related to Mercury:

                  GET https://voparis-vespa-crs.obspm.fr/ws/search?search_term_kw=mercury&limit=50&offset=0
                

The response will be a JSON array of WKT models. For example:

                  
                    [
                        {
                            "created_at":"2024-07-09T14:18:23.888614Z",
                            "id":"IAU:2015:19900",
                            "version":2015,
                            "code":19900,
                            "solar_body":"Mercury",
                            "datum_name":"Mercury (2015) - Sphere",
                            "ellipsoid_name":"Mercury (2015) - Sphere",
                            "projection_name":"No projection",
                            "wkt":"GEOGCRS[\"Mercury (2015) - Sphere \", DATUM[\"Mercury (2015) - Sphere\", ELLIPSOID[\"Mercury (2015) - Sphere\", 2440530, 0,LENGTHUNIT[\"metre\", 1, ID[\"EPSG\", 9001]]],ANCHOR[\"Hun Kal : 20 W\"]], PRIMEM[\"Reference Meridian\", 0, ANGLEUNIT[\"degree\", 0.0174532925199433, ID[\"EPSG\", 9122]]],CS[ellipsoidal, 2], AXIS[\"geodetic latitude (Lat)\", north, ORDER[1], ANGLEUNIT[\"degree\", 0.0174532925199433]], AXIS[\"geodetic longitude (Lon)\", east, ORDER[2], ANGLEUNIT[\"degree\", 0.0174532925199433]],ID[\"IAU\", 19900, 2015],REMARK[\"Use semi-major radius as sphere radius for interoperability. Source of IAU Coordinate systems: doi:10.1007/s10569-017-9805-5\"]]"
                        },
                        ...
                    ]
                  
                

Step 2: Extract the Identifier Details

From the response, extract the details of the WKT identifier from WKT string. For instance:

  • Namespace: IAU
  • ID: 19900
  • Version: 2015

Step 3: Create the OGC Identifier

Using the retrieved details, create the OGC identifier in Python:

                  
                    >>> id = "19900"
                    >>> version = "2015"
                    >>> namespace = "IAU"
                    >>> ogc_identifier = f"urn:ogc:def:crs:{namespace}:{version}:{id}"
                    >>> print(ogc_identifier)
                    urn:ogc:def:crs:IAU:2015:19900
                  
                

Then, you can use this OGC identifier with PROJ:

                  
                    >>> from pyproj import CRS
                    >>> CRS('urn:ogc:def:crs:IAU:2015:19900')
                    <Geographic 2D CRS: IAU_2015:19900>
                    Name: Mercury (2015) - Sphere / Ocentric

                    Axis Info [ellipsoidal]:
                    - Lat[north]: Geodetic latitude (degree)
                    - Lon[east]: Geodetic longitude (degree)

                    Area of Use:
                    - undefined

                    Datum: Mercury (2015)
                    - Sphere
                    - Ellipsoid: Mercury (2015) - Sphere - Prime Meridian: Reference Meridian