Project

General

Profile

« Previous | Next » 

Revision 13804

bugfix: schemas/util.sql: bounding_box(): use util.range instead of numrange to support wraparound ranges for geocoordinates

View differences:

trunk/schemas/util.sql
734 734

  
735 735

  
736 736
--
737
-- Name: bounding_box(numrange, numrange); Type: FUNCTION; Schema: util; Owner: -
737
-- Name: bounding_box(range, range); Type: FUNCTION; Schema: util; Owner: -
738 738
--
739 739

  
740
CREATE FUNCTION bounding_box(latitude_range_deg numrange, longitude_range_deg numrange) RETURNS postgis.box2d
740
CREATE FUNCTION bounding_box(latitude_range_deg range, longitude_range_deg range) RETURNS postgis.box2d
741 741
    LANGUAGE sql IMMUTABLE
742 742
    SET search_path TO postgis
743 743
    AS $_$
744 744
SELECT st_makebox2d(
745
  /*pointLowLeft=*/st_point(/*x_lon=*/lower($2), /*y_lat=*/lower($1))
746
, /*pointUpRight=*/st_point(/*x_lon=*/upper($2), /*y_lat=*/upper($1))
745
  /*pointLowLeft=*/st_point(/*x_lon=*/$2.lower, /*y_lat=*/$1.lower)
746
, /*pointUpRight=*/st_point(/*x_lon=*/$2.upper, /*y_lat=*/$1.upper)
747 747
)
748 748
$_$;
749 749

  
750 750

  
751 751
--
752
-- Name: FUNCTION bounding_box(latitude_range_deg numrange, longitude_range_deg numrange); Type: COMMENT; Schema: util; Owner: -
752
-- Name: FUNCTION bounding_box(latitude_range_deg range, longitude_range_deg range); Type: COMMENT; Schema: util; Owner: -
753 753
--
754 754

  
755
COMMENT ON FUNCTION bounding_box(latitude_range_deg numrange, longitude_range_deg numrange) IS '
755
COMMENT ON FUNCTION bounding_box(latitude_range_deg range, longitude_range_deg range) IS '
756 756
usage:
757 757
SET search_path = util; -- for ~ operator
758 758
SELECT util.bounding_box(lower_lat ~ upper_lat, lower_long ~ upper_long);

Also available in: Unified diff