]> granicus.if.org Git - postgis/commitdiff
#1040 -- ST_MinimumBoundingCircle -- replace X(), Y() deprecated calls with ST_X...
authorRegina Obe <lr@pcorp.us>
Mon, 20 Jun 2011 09:29:31 +0000 (09:29 +0000)
committerRegina Obe <lr@pcorp.us>
Mon, 20 Jun 2011 09:29:31 +0000 (09:29 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@7430 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_processing.xml
postgis/postgis.sql.in.c
postgis/postgis_drop.sql.in.c

index 6ee12d86fc184ad8a7edba6696aa5acaacd8cba3..be574328e1c12ae5f809119fc099d4b5267d06e7 100644 (file)
@@ -1685,11 +1685,7 @@ SELECT ST_AsEWKT(ST_LineToCurve(ST_GeomFromEWKT('LINESTRING(1 2 3, 3 4 8, 5 6 4,
                  <funcprototype>
                        <funcdef>geometry <function>ST_MinimumBoundingCircle</function></funcdef>
                        <paramdef><type>geometry </type> <parameter>geomA</parameter></paramdef>
-                 </funcprototype>
-                 <funcprototype>
-                       <funcdef>geometry <function>ST_MinimumBoundingCircle</function></funcdef>
-                       <paramdef><type>geometry </type> <parameter>geomA</parameter></paramdef>
-                       <paramdef><type>integer </type> <parameter>num_segs_per_qt_circ</parameter></paramdef>
+                       <paramdef choice='opt'><type>integer </type> <parameter>num_segs_per_qt_circ=48</parameter></paramdef>
                  </funcprototype>
                </funcsynopsis>
          </refsynopsisdiv>
index 9cff0446212b1435006ce12deea6cff8b35bdd7b..6c4f2e4193af651fb0ea0257cf497c2e9f865a2f 100644 (file)
@@ -4938,7 +4938,7 @@ CREATE OR REPLACE FUNCTION ST_LineToCurve(geometry)
 -- Contributed by Bruce Rindahl\r
 -- Availability: 1.4.0\r
 -----------------------------------------------------------------------\r
-CREATE OR REPLACE FUNCTION ST_MinimumBoundingCircle(inputgeom geometry, segs_per_quarter integer)\r
+CREATE OR REPLACE FUNCTION ST_MinimumBoundingCircle(inputgeom geometry, segs_per_quarter integer DEFAULT 48)\r
        RETURNS geometry AS\r
 $BODY$\r
        DECLARE\r
@@ -5011,20 +5011,20 @@ $BODY$
                                -- Compute the midpoint\r
                                p1 = ST_line_interpolate_point(l1,0.5);\r
                                -- Rotate the line 90 degrees around the midpoint (perpendicular bisector)\r
-                               l1 = ST_Translate(ST_Rotate(ST_Translate(l1,-X(p1),-Y(p1)),pi()/2),X(p1),Y(p1));\r
+                               l1 = ST_Translate(ST_Rotate(ST_Translate(l1,-ST_X(p1),-ST_Y(p1)),pi()/2),ST_X(p1),ST_Y(p1));\r
                                --  Compute the azimuth of the bisector\r
                                a1 = ST_Azimuth(ST_PointN(l1,1),ST_PointN(l1,2));\r
                                --  Extend the line in each direction the new computed distance to insure they will intersect\r
-                               l1 = ST_AddPoint(l1,ST_Makepoint(X(ST_PointN(l1,2))+sin(a1)*dist,Y(ST_PointN(l1,2))+cos(a1)*dist),-1);\r
-                               l1 = ST_AddPoint(l1,ST_Makepoint(X(ST_PointN(l1,1))-sin(a1)*dist,Y(ST_PointN(l1,1))-cos(a1)*dist),0);\r
+                               l1 = ST_AddPoint(l1,ST_Makepoint(ST_X(ST_PointN(l1,2))+sin(a1)*dist,ST_Y(ST_PointN(l1,2))+cos(a1)*dist),-1);\r
+                               l1 = ST_AddPoint(l1,ST_Makepoint(ST_X(ST_PointN(l1,1))-sin(a1)*dist,ST_Y(ST_PointN(l1,1))-cos(a1)*dist),0);\r
 \r
                                -- Repeat for the line from the point to the other diameter point\r
                                l2 = ST_Makeline(ST_PointN(ring,idx2),ST_PointN(ring,k));\r
                                p2 = ST_Line_interpolate_point(l2,0.5);\r
-                               l2 = ST_Translate(ST_Rotate(ST_Translate(l2,-X(p2),-Y(p2)),pi()/2),X(p2),Y(p2));\r
+                               l2 = ST_Translate(ST_Rotate(ST_Translate(l2,-ST_X(p2),-ST_Y(p2)),pi()/2),ST_X(p2),ST_Y(p2));\r
                                a2 = ST_Azimuth(ST_PointN(l2,1),ST_PointN(l2,2));\r
-                               l2 = ST_AddPoint(l2,ST_Makepoint(X(ST_PointN(l2,2))+sin(a2)*dist,Y(ST_PointN(l2,2))+cos(a2)*dist),-1);\r
-                               l2 = ST_AddPoint(l2,ST_Makepoint(X(ST_PointN(l2,1))-sin(a2)*dist,Y(ST_PointN(l2,1))-cos(a2)*dist),0);\r
+                               l2 = ST_AddPoint(l2,ST_Makepoint(ST_X(ST_PointN(l2,2))+sin(a2)*dist,ST_Y(ST_PointN(l2,2))+cos(a2)*dist),-1);\r
+                               l2 = ST_AddPoint(l2,ST_Makepoint(ST_X(ST_PointN(l2,1))-sin(a2)*dist,ST_Y(ST_PointN(l2,1))-cos(a2)*dist),0);\r
 \r
                                -- The new center is the intersection of the two bisectors\r
                                center = ST_Intersection(l1,l2);\r
@@ -5040,10 +5040,6 @@ $BODY$
 $BODY$\r
        LANGUAGE 'plpgsql' IMMUTABLE STRICT;\r
 \r
-CREATE OR REPLACE FUNCTION ST_MinimumBoundingCircle(geometry)\r
- RETURNS geometry AS\r
-'SELECT ST_MinimumBoundingCircle($1, 48)'\r
- LANGUAGE 'sql' IMMUTABLE STRICT;\r
  \r
 -- ST_ConcaveHull and Helper functions starts here --\r
 -----------------------------------------------------------------------\r
index 808c743cda3cef17f097b478d09b2d6f90fecedb..1272f340b90ddfc8ca6a3b80a48b15a53944e25e 100644 (file)
@@ -61,6 +61,7 @@ DROP FUNCTION IF EXISTS geosnoop(geometry);
 DROP FUNCTION IF EXISTS jtsnoop(geometry);
 DROP FUNCTION IF EXISTS st_noop(geometry);
 DROP FUNCTION IF EXISTS st_max_distance(geometry, geometry);
+DROP FUNCTION IF EXISTS  ST_MinimumBoundingCircle(geometry); --changed to use default parameters
 -- Drop internals that should never have existed --
 DROP FUNCTION IF EXISTS st_geometry_analyze(internal);
 DROP FUNCTION IF EXISTS st_geometry_in(cstring);
@@ -73,4 +74,5 @@ DROP FUNCTION IF EXISTS st_geometry_lt(geometry, geometry);
 DROP FUNCTION IF EXISTS st_geometry_gt(geometry, geometry);
 DROP FUNCTION IF EXISTS st_geometry_ge(geometry, geometry);
 DROP FUNCTION IF EXISTS st_geometry_eq(geometry, geometry);
-DROP FUNCTION IF EXISTS st_geometry_cmp(geometry, geometry);
\ No newline at end of file
+DROP FUNCTION IF EXISTS st_geometry_cmp(geometry, geometry);
+DROP FUNCTION IF EXISTS SnapToGrid(geometry, float8, float8);
\ No newline at end of file