Home Explore Blog CI



postgresql

2nd chunk of `doc/src/sgml/earthdistance.sgml`
2ace21f9b666d4ebaa7f0e2652b73aebe16593a04de242d90000000100000c20
 points and to easily specify a
   bounding box usable for index searches.
  </para>

  <para>
   The provided functions are shown
   in <xref linkend="earthdistance-cube-functions"/>.
  </para>

  <table id="earthdistance-cube-functions">
   <title>Cube-Based Earthdistance Functions</title>
    <tgroup cols="1">
     <thead>
      <row>
       <entry role="func_table_entry"><para role="func_signature">
        Function
       </para>
       <para>
        Description
       </para></entry>
      </row>
     </thead>

     <tbody>
      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm><primary>earth</primary></indexterm>
        <function>earth</function> ()
        <returnvalue>float8</returnvalue>
       </para>
       <para>
        Returns the assumed radius of the Earth.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm><primary>sec_to_gc</primary></indexterm>
        <function>sec_to_gc</function> ( <type>float8</type> )
        <returnvalue>float8</returnvalue>
       </para>
       <para>
        Converts the normal straight line
        (secant) distance between two points on the surface of the Earth
        to the great circle distance between them.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm><primary>gc_to_sec</primary></indexterm>
        <function>gc_to_sec</function> ( <type>float8</type> )
        <returnvalue>float8</returnvalue>
       </para>
       <para>
        Converts the great circle distance between two points on the
        surface of the Earth to the normal straight line (secant) distance
        between them.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm><primary>ll_to_earth</primary></indexterm>
        <function>ll_to_earth</function> ( <type>float8</type>, <type>float8</type> )
        <returnvalue>earth</returnvalue>
       </para>
       <para>
        Returns the location of a point on the surface of the Earth given
        its latitude (argument 1) and longitude (argument 2) in degrees.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm><primary>latitude</primary></indexterm>
        <function>latitude</function> ( <type>earth</type> )
        <returnvalue>float8</returnvalue>
       </para>
       <para>
        Returns the latitude in degrees of a point on the surface of the
        Earth.
       </para></entry>
      </row>

      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm><primary>longitude</primary></indexterm>
        <function>longitude</function> ( <type>earth</type> )
        <returnvalue>float8</returnvalue>
       </para>
       <para>
        Returns the longitude in degrees of a point on the surface of the
        Earth.
       </para></entry>
      </row>

      <row>

Title: Cube-Based Earthdistance Functions
Summary
The `earthdistance` module provides functions for calculating great circle distances using a cube-based approach. These functions include: `earth()` which returns the Earth's radius, `sec_to_gc()` which converts secant distance to great circle distance, `gc_to_sec()` which converts great circle distance to secant distance, `ll_to_earth()` which converts latitude and longitude to an earth point, `latitude()` which returns the latitude of an earth point, and `longitude()` which returns the longitude of an earth point. These functions allow for converting between different representations of geographic locations and distances on Earth.