]> granicus.if.org Git - postgis/commitdiff
CamelCase-ize ST_LengtSpheroid, ST_DistanceSpheroid (#2748)
authorSandro Santilli <strk@keybit.net>
Sun, 4 Jan 2015 17:08:14 +0000 (17:08 +0000)
committerSandro Santilli <strk@keybit.net>
Sun, 4 Jan 2015 17:08:14 +0000 (17:08 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13173 b70326c6-7e19-0410-871a-916f4a2858ee

NEWS
doc/reference_measure.xml
postgis/postgis.sql.in
regress/measures.sql
regress/measures_expected
regress/tickets.sql
regress/tickets_expected

diff --git a/NEWS b/NEWS
index c1e49979242f2fbe5a97df74695951dccc343981..7e6701af94766594c4d38921f466071eb0bfbd0b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -13,7 +13,9 @@ PostGIS 2.2.0
 
   - #2748, ST_Shift_Longitude renamed to ST_ShiftLongitude,
            ST_Find_Extent renamed to ST_FindExtent,
-           ST_Combine_BBox renamed to ST_CombineBbox
+           ST_Combine_BBox renamed to ST_CombineBbox,
+           ST_Length_Spheroid renamed to ST_LengthSpheroid,
+           ST_Distance_Spheroid renamed to ST_DistanceSpheroid
   - #2769, ST_Mem_Size renamed to ST_MemSize
   - #2565, ST_SummaryStats(tablename, rastercolumn, ...)
   - #2567, ST_Count(tablename, rastercolumn, ...)
index 6a8ad395304e269555d9df8c37467e48013d14d5..1c8f868b7d475fed11f4dcec98586bf4fc297861 100644 (file)
@@ -2179,7 +2179,7 @@ postgis=# SELECT ST_MaxDistance('POINT(0 0)'::geometry, 'LINESTRING ( 2 2, 2 2 )
 
                <refpurpose>Returns minimum distance in meters between two lon/lat
                                geometries. Uses a spherical earth and radius of 6370986 meters.
-                               Faster than ST_Distance_Spheroid <xref linkend="ST_Distance_Spheroid" />, but less
+                               Faster than ST_DistanceSpheroid <xref linkend="ST_Distance_Spheroid" />, but less
                                accurate. PostGIS versions prior to 1.5 only implemented for points.</refpurpose>
          </refnamediv>
 
@@ -2236,7 +2236,7 @@ FROM
 
        <refentry id="ST_Distance_Spheroid">
          <refnamediv>
-               <refname>ST_Distance_Spheroid</refname>
+               <refname>ST_DistanceSpheroid</refname>
 
                <refpurpose>Returns the minimum distance between two lon/lat geometries given a
                        particular spheroid.
@@ -2246,7 +2246,7 @@ FROM
          <refsynopsisdiv>
                <funcsynopsis>
                  <funcprototype>
-                       <funcdef>float <function>ST_Distance_Spheroid</function></funcdef>
+                       <funcdef>float <function>ST_DistanceSpheroid</function></funcdef>
                        <paramdef><type>geometry </type> <parameter>geomlonlatA</parameter></paramdef>
                        <paramdef><type>geometry </type> <parameter>geomlonlatB</parameter></paramdef>
                        <paramdef><type>spheroid </type> <parameter>measurement_spheroid</parameter></paramdef>
@@ -2265,6 +2265,7 @@ FROM
                </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_Spheroid</para>
          </refsection>
 
 
@@ -2272,7 +2273,7 @@ FROM
                <title>Examples</title>
 
                <programlisting>SELECT round(CAST(
-               ST_Distance_Spheroid(ST_Centroid(the_geom), ST_GeomFromText('POINT(-118 38)',4326), 'SPHEROID["WGS 84",6378137,298.257223563]')
+               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_Distance(ST_Transform(ST_Centroid(the_geom),32611),
@@ -2845,7 +2846,7 @@ ST_3DLength
 
        <refentry id="ST_Length_Spheroid">
          <refnamediv>
-               <refname>ST_Length_Spheroid</refname>
+               <refname>ST_LengthSpheroid</refname>
 
                <refpurpose>Calculates the 2D or 3D length of a linestring/multilinestring on an ellipsoid. This
                        is useful if the coordinates of the geometry are in
@@ -2855,7 +2856,7 @@ ST_3DLength
          <refsynopsisdiv>
                <funcsynopsis>
                  <funcprototype>
-                       <funcdef>float <function>ST_Length_Spheroid</function></funcdef>
+                       <funcdef>float <function>ST_LengthSpheroid</function></funcdef>
                        <paramdef><type>geometry </type> <parameter>a_linestring</parameter></paramdef>
                        <paramdef><type>spheroid </type> <parameter>a_spheroid</parameter></paramdef>
                  </funcprototype>
@@ -2878,6 +2879,8 @@ ST_3DLength
                <literallayout>SPHEROID["GRS_1980",6378137,298.257222101]</literallayout>
                <note><para>Will return 0 for anything that is not a MULTILINESTRING or LINESTRING</para></note>
 
+               <para>Availability: 1.2.2</para>
+               <para>Changed: 2.2.0 In prior versions this used to be called ST_Length_Spheroid</para>
                <para>&Z_support;</para>
          </refsection>
 
@@ -2885,13 +2888,13 @@ ST_3DLength
          <refsection>
                <title>Examples</title>
 
-               <programlisting>SELECT ST_Length_Spheroid( geometry_column,
+               <programlisting>SELECT ST_LengthSpheroid( geometry_column,
                          'SPHEROID["GRS_1980",6378137,298.257222101]' )
                          FROM geometry_table;
 
-SELECT ST_Length_Spheroid( the_geom, sph_m ) As tot_len,
-ST_Length_Spheroid(ST_GeometryN(the_geom,1), sph_m) As len_line1,
-ST_Length_Spheroid(ST_GeometryN(the_geom,2), sph_m) As len_line2
+SELECT ST_LengthSpheroid( the_geom, sph_m ) As tot_len,
+ST_LengthSpheroid(ST_GeometryN(the_geom,1), sph_m) As len_line1,
+ST_LengthSpheroid(ST_GeometryN(the_geom,2), sph_m) As len_line2
                          FROM (SELECT ST_GeomFromText('MULTILINESTRING((-118.584 38.374,-118.583 38.5),
        (-71.05957 42.3589 , -71.061 43))') As the_geom,
 CAST('SPHEROID["GRS_1980",6378137,298.257222101]' As spheroid) As sph_m)  as foo;
@@ -2900,9 +2903,9 @@ CAST('SPHEROID["GRS_1980",6378137,298.257222101]' As spheroid) As sph_m)  as foo
  85204.5207562955 | 13986.8725229309 | 71217.6482333646
 
  --3D
-SELECT ST_Length_Spheroid( the_geom, sph_m ) As tot_len,
-ST_Length_Spheroid(ST_GeometryN(the_geom,1), sph_m) As len_line1,
-ST_Length_Spheroid(ST_GeometryN(the_geom,2), sph_m) As len_line2
+SELECT ST_LengthSpheroid( the_geom, sph_m ) As tot_len,
+ST_LengthSpheroid(ST_GeometryN(the_geom,1), sph_m) As len_line1,
+ST_LengthSpheroid(ST_GeometryN(the_geom,2), sph_m) As len_line2
                          FROM (SELECT ST_GeomFromEWKT('MULTILINESTRING((-118.584 38.374 20,-118.583 38.5 30),
        (-71.05957 42.3589 75, -71.061 43 90))') As the_geom,
 CAST('SPHEROID["GRS_1980",6378137,298.257222101]' As spheroid) As sph_m)  as foo;
index 23c6f20611dd06b2398434ae455c2daa4dabd587..2c35bc06cfa2f96c7333595f0b5e1e368777245c 100644 (file)
@@ -1140,6 +1140,7 @@ CREATE OR REPLACE FUNCTION ST_Length(geometry)
 
 -- this is a fake (for back-compatibility)
 -- uses 3d if 3d is available, 2d otherwise
+-- TODO: deprecate ?
 -- Availability: 2.0.0
 CREATE OR REPLACE FUNCTION ST_3DLength_spheroid(geometry, spheroid)
        RETURNS FLOAT8
@@ -1147,13 +1148,22 @@ CREATE OR REPLACE FUNCTION ST_3DLength_spheroid(geometry, spheroid)
        LANGUAGE 'c' IMMUTABLE STRICT
        COST 100;
 
--- Availability: 1.2.2
-CREATE OR REPLACE FUNCTION ST_length_spheroid(geometry, spheroid)
+-- Availability in 2.2.0
+CREATE OR REPLACE FUNCTION ST_LengthSpheroid(geometry, spheroid)
        RETURNS FLOAT8
        AS 'MODULE_PATHNAME','LWGEOM_length_ellipsoid_linestring'
        LANGUAGE 'c' IMMUTABLE STRICT
        COST 100;
 
+-- Availability: 1.2.2
+-- Deprecation in 2.2.0
+CREATE OR REPLACE FUNCTION ST_length_spheroid(geometry, spheroid)
+       RETURNS FLOAT8 AS
+  $$ SELECT _postgis_deprecate('ST_Length_Spheroid', 'ST_LengthSpheroid', '2.2.0');
+    SELECT ST_LengthSpheroid($1,$2);
+  $$
+       LANGUAGE 'sql' IMMUTABLE STRICT;
+
 -- Availability: 1.2.2
 CREATE OR REPLACE FUNCTION ST_length2d_spheroid(geometry, spheroid)
        RETURNS FLOAT8
@@ -1192,13 +1202,22 @@ CREATE OR REPLACE FUNCTION ST_Area(geometry)
        AS 'MODULE_PATHNAME','area'
        LANGUAGE 'c' IMMUTABLE STRICT;
 
--- Availability: 1.2.2
-CREATE OR REPLACE FUNCTION ST_distance_spheroid(geom1 geometry, geom2 geometry,spheroid)
+-- Availability: 2.0.0
+CREATE OR REPLACE FUNCTION ST_DistanceSpheroid(geom1 geometry, geom2 geometry,spheroid)
        RETURNS FLOAT8
        AS 'MODULE_PATHNAME','LWGEOM_distance_ellipsoid'
        LANGUAGE 'c' IMMUTABLE STRICT
        COST 100;
 
+-- Availability: 1.2.2
+-- Deprecation in 2.2.0
+CREATE OR REPLACE FUNCTION ST_distance_spheroid(geom1 geometry, geom2 geometry,spheroid)
+       RETURNS FLOAT8 AS
+  $$ SELECT _postgis_deprecate('ST_Distance_Spheroid', 'ST_DistanceSpheroid', '2.2.0');
+    SELECT ST_DistanceSpheroid($1,$2,$3);
+  $$
+       LANGUAGE 'sql' IMMUTABLE STRICT;
+
 -- Minimum distance. 2d only.
 
 -- PostGIS equivalent function: distance(geom1 geometry, geom2 geometry)
index 22136bab06b5ad9e8396d27eb7089f24a2eb4d54..e84e1318fb60b400cb1239c2661186a1a0a9f6c7 100644 (file)
@@ -260,4 +260,5 @@ select 'emptyMultiPointArea', st_area('MULTIPOINT EMPTY');
 select 'emptyCollectionArea', st_area('GEOMETRYCOLLECTION EMPTY');
 
 -- 
-select 'spheroidLength1', round(st_length_spheroid('MULTILINESTRING((-118.584 38.374,-118.583 38.5),(-71.05957 42.3589 , -71.061 43))'::geometry,'SPHEROID["GRS_1980",6378137,298.257222101]'::spheroid)::numeric,5);
+select 'spheroidLength1_deprecated', round(st_length_spheroid('MULTILINESTRING((-118.584 38.374,-118.583 38.5),(-71.05957 42.3589 , -71.061 43))'::geometry,'SPHEROID["GRS_1980",6378137,298.257222101]'::spheroid)::numeric,5);
+select 'spheroidLength1', round(ST_LengthSpheroid('MULTILINESTRING((-118.584 38.374,-118.583 38.5),(-71.05957 42.3589 , -71.061 43))'::geometry,'SPHEROID["GRS_1980",6378137,298.257222101]'::spheroid)::numeric,5);
index f945b15023454c82b63611d9613611efb6310d66..e2e2fefc317735e20cb06b98567637df0f8b3219 100644 (file)
@@ -42,4 +42,5 @@ emptyMultiPolyArea|0
 emptyMultiLineArea|0
 emptyMultiPointArea|0
 emptyCollectionArea|0
+spheroidLength1_deprecated|85204.52077
 spheroidLength1|85204.52077
index a33003406d811a55e9d51093d177113c62996367..ef0840146ffad560c8ed097ff4812b59141de9a2 100644 (file)
@@ -325,7 +325,8 @@ SELECT '#650', ST_AsText(ST_Collect(ARRAY[ST_MakePoint(0,0), ST_MakePoint(1,1),
 SELECT '#667', ST_AsEWKT(ST_LineToCurve(ST_Buffer(ST_SetSRID(ST_Point(i,j),4326), j))) As the_geom FROM generate_series(-10,50,10) As i CROSS JOIN generate_series(40,70, 20) As j ORDER BY i, j, i*j LIMIT 1;
 
 -- #677 --
-SELECT '#677',round(ST_Distance_Spheroid(ST_GeomFromEWKT('MULTIPOLYGON(((-10 40,-10 55,-10 70,5 40,-10 40)))'), ST_GeomFromEWKT('MULTIPOINT(20 40,20 55,20 70,35 40,35 55,35 70,50 40,50 55,50 70)'), 'SPHEROID["GRS_1980",6378137,298.257222101]')) As result;
+SELECT '#677.deprecated',round(ST_Distance_Spheroid(ST_GeomFromEWKT('MULTIPOLYGON(((-10 40,-10 55,-10 70,5 40,-10 40)))'), ST_GeomFromEWKT('MULTIPOINT(20 40,20 55,20 70,35 40,35 55,35 70,50 40,50 55,50 70)'), 'SPHEROID["GRS_1980",6378137,298.257222101]')) As result;
+SELECT '#677',round(ST_DistanceSpheroid(ST_GeomFromEWKT('MULTIPOLYGON(((-10 40,-10 55,-10 70,5 40,-10 40)))'), ST_GeomFromEWKT('MULTIPOINT(20 40,20 55,20 70,35 40,35 55,35 70,50 40,50 55,50 70)'), 'SPHEROID["GRS_1980",6378137,298.257222101]')) As result;
 
 -- #680 --
 SELECT '#680', encode(ST_AsBinary(geography(foo1.the_geom),'ndr'),'hex') As result FROM ((SELECT ST_SetSRID(ST_MakePointM(i,j,m),4326) As the_geom FROM generate_series(-10,50,10) As i CROSS JOIN generate_series(50,70, 20) AS j CROSS JOIN generate_series(1,2) As m ORDER BY i, j, i*j*m)) As foo1 LIMIT 1;
index 514e22e17d666c7a2332a6150adbaf25bb73fca1..a95fc96e545b5ee6798a3f2e39d975cb03f9a167 100644 (file)
@@ -96,6 +96,7 @@ NOTICE:  IllegalArgumentException: Invalid number of points in LinearRing found
 #835.12|MULTIPOLYGON EMPTY
 #650|MULTIPOINT(0 0,1 1,2 2)
 #667|SRID=4326;CURVEPOLYGON(CIRCULARSTRING(30 40,-50 39.9999999999999,30 40))
+#677.deprecated|1121395
 #677|1121395
 #680|01d107000000000000000024c000000000000049400000000000000040
 #681a|