Project

General

Profile

« Previous | Next » 

Revision 13811

bugfix: schemas/util.sql: bounding_box(): must use postgis.geography (instead of postgis.geometry) because that handles geocoordinate wraparound correctly

View differences:

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

  
740
CREATE FUNCTION bounding_box(latitude_range_deg range, longitude_range_deg range) RETURNS postgis.geometry
740
CREATE FUNCTION bounding_box(latitude_range_deg range, longitude_range_deg range) RETURNS postgis.geography
741 741
    LANGUAGE sql IMMUTABLE
742 742
    AS $_$
743 743
/* don't use st_makebox2d() because it doesn't support geocoordinate wraparound
......
746 746
  /*xmin=*/$2.lower, /*ymin=*/$1.lower
747 747
, /*xmax=*/$2.upper, /*ymax=*/$1.upper
748 748
, /*WGS84*/4326
749
)
749
)::postgis.geography
750 750
$_$;
751 751

  
752 752

  

Also available in: Unified diff