]> granicus.if.org Git - postgis/commitdiff
CamelCase-ize ST_DistanceSphere (#2748)
authorSandro Santilli <strk@keybit.net>
Fri, 16 Jan 2015 13:43:35 +0000 (13:43 +0000)
committerSandro Santilli <strk@keybit.net>
Fri, 16 Jan 2015 13:43:35 +0000 (13:43 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13179 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_measure.xml
postgis/postgis.sql.in

index 1c8f868b7d475fed11f4dcec98586bf4fc297861..fa5081a6703d1b04507f111f900e993c972199b7 100644 (file)
@@ -2030,7 +2030,7 @@ FROM (SELECT
          <refsection>
                <title>See Also</title>
 
-               <para><xref linkend="ST_3DDistance"/>, <xref linkend="ST_DWithin"/>, <xref linkend="ST_Distance_Sphere"/>, <xref linkend="ST_Distance_Spheroid"/>, <xref linkend="ST_MaxDistance" />, <xref linkend="ST_Transform" /></para>
+               <para><xref linkend="ST_3DDistance"/>, <xref linkend="ST_DWithin"/>, <xref linkend="ST_DistanceSphere"/>, <xref linkend="ST_Distance_Spheroid"/>, <xref linkend="ST_MaxDistance" />, <xref linkend="ST_Transform" /></para>
          </refsection>
        </refentry>
 
@@ -2173,9 +2173,9 @@ postgis=# SELECT ST_MaxDistance('POINT(0 0)'::geometry, 'LINESTRING ( 2 2, 2 2 )
   </refsection>
 </refentry>
 
-<refentry id="ST_Distance_Sphere">
+<refentry id="ST_DistanceSphere">
          <refnamediv>
-               <refname>ST_Distance_Sphere</refname>
+               <refname>ST_DistanceSphere</refname>
 
                <refpurpose>Returns minimum distance in meters between two lon/lat
                                geometries. Uses a spherical earth and radius of 6370986 meters.
@@ -2186,7 +2186,7 @@ postgis=# SELECT ST_MaxDistance('POINT(0 0)'::geometry, 'LINESTRING ( 2 2, 2 2 )
          <refsynopsisdiv>
                <funcsynopsis>
                  <funcprototype>
-                       <funcdef>float <function>ST_Distance_Sphere</function></funcdef>
+                       <funcdef>float <function>ST_DistanceSphere</function></funcdef>
                        <paramdef><type>geometry </type> <parameter>geomlonlatA</parameter></paramdef>
                        <paramdef><type>geometry </type> <parameter>geomlonlatB</parameter></paramdef>
                  </funcprototype>
@@ -2205,13 +2205,14 @@ postgis=# SELECT ST_MaxDistance('POINT(0 0)'::geometry, 'LINESTRING ( 2 2, 2 2 )
                </note>
                
                <para>Availability: 1.5 - support for other geometry types besides points was introduced. Prior versions only work with points.</para>
+               <para>Changed: 2.2.0 In prior versions this used to be called ST_Distance_Sphere</para>
          </refsection>
 
 
          <refsection>
                <title>Examples</title>
 
-               <programlisting>SELECT round(CAST(ST_Distance_Sphere(ST_Centroid(the_geom), ST_GeomFromText('POINT(-118 38)',4326)) As numeric),2) As dist_meters,
+               <programlisting>SELECT round(CAST(ST_DistanceSphere(ST_Centroid(the_geom), ST_GeomFromText('POINT(-118 38)',4326)) As numeric),2) As dist_meters,
 round(CAST(ST_Distance(ST_Transform(ST_Centroid(the_geom),32611),
                ST_Transform(ST_GeomFromText('POINT(-118 38)', 4326),32611)) As numeric),2) As dist_utm11_meters,
 round(CAST(ST_Distance(ST_Centroid(the_geom), ST_GeomFromText('POINT(-118 38)', 4326)) As numeric),5) As dist_degrees,
@@ -2275,7 +2276,7 @@ FROM
                <programlisting>SELECT round(CAST(
                ST_DistanceSpheroid(ST_Centroid(the_geom), ST_GeomFromText('POINT(-118 38)',4326), 'SPHEROID["WGS 84",6378137,298.257223563]')
                        As numeric),2) As dist_meters_spheroid,
-               round(CAST(ST_Distance_Sphere(ST_Centroid(the_geom), ST_GeomFromText('POINT(-118 38)',4326)) As numeric),2) As dist_meters_sphere,
+               round(CAST(ST_DistanceSphere(ST_Centroid(the_geom), ST_GeomFromText('POINT(-118 38)',4326)) As numeric),2) As dist_meters_sphere,
 round(CAST(ST_Distance(ST_Transform(ST_Centroid(the_geom),32611),
                ST_Transform(ST_GeomFromText('POINT(-118 38)', 4326),32611)) As numeric),2) As dist_utm11_meters
 FROM
@@ -2291,7 +2292,7 @@ FROM
          <refsection>
                <title>See Also</title>
 
-               <para><xref linkend="ST_Distance" />, <xref linkend="ST_Distance_Sphere" /></para>
+               <para><xref linkend="ST_Distance" />, <xref linkend="ST_DistanceSphere" /></para>
          </refsection>
        </refentry>
 
index 6f3cba824d3051a361ac72ce24e929c345e51180..a2482869edb1342edd05905a9aa94beb4a92f7f5 100644 (file)
@@ -4729,9 +4729,8 @@ LANGUAGE 'plpgsql' IMMUTABLE STRICT;
 #include "geography.sql.in"
 
 
-
--- Availability: 1.2.2
-CREATE OR REPLACE FUNCTION ST_distance_sphere(geom1 geometry, geom2 geometry)
+-- Availability: 2.2.0
+CREATE OR REPLACE FUNCTION ST_DistanceSphere(geom1 geometry, geom2 geometry)
        RETURNS FLOAT8
        AS $$
        select st_distance(geography($1),geography($2),false)
@@ -4739,6 +4738,16 @@ CREATE OR REPLACE FUNCTION ST_distance_sphere(geom1 geometry, geom2 geometry)
        LANGUAGE 'sql' IMMUTABLE STRICT
        COST 300;
 
+-- Availability: 1.2.2
+-- Deprecation in 2.2.0
+CREATE OR REPLACE FUNCTION ST_distance_sphere(geom1 geometry, geom2 geometry)
+       RETURNS FLOAT8 AS
+  $$ SELECT _postgis_deprecate('ST_Distance_Sphere', 'ST_DistanceSphere', '2.2.0');
+    SELECT ST_DistanceSphere($1,$2);
+  $$
+       LANGUAGE 'sql' IMMUTABLE STRICT
+       COST 300;
+
 ---------------------------------------------------------------
 -- GEOMETRY_COLUMNS view support functions
 ---------------------------------------------------------------