Project

General

Profile

« Previous | Next » 

Revision 13901

schemas/util.sql: added contained_within_approx(geocoord, geometry) and corresponding OPERATOR ~@(geocoord, geometry)

View differences:

util.sql
1154 1154

  
1155 1155

  
1156 1156
--
1157
-- Name: contained_within_approx(geocoord, postgis.geometry); Type: FUNCTION; Schema: util; Owner: -
1158
--
1159

  
1160
CREATE FUNCTION contained_within_approx(point geocoord, region postgis.geometry) RETURNS boolean
1161
    LANGUAGE sql IMMUTABLE
1162
    AS $_$
1163
SELECT util.contained_within_approx(util.geometry($1), $2)
1164
$_$;
1165

  
1166

  
1167
--
1168
-- Name: FUNCTION contained_within_approx(point geocoord, region postgis.geometry); Type: COMMENT; Schema: util; Owner: -
1169
--
1170

  
1171
COMMENT ON FUNCTION contained_within_approx(point geocoord, region postgis.geometry) IS '
1172
defining this in addition to contained_within_approx(geometry, geometry) enables
1173
specifying just `(lat, long)` without the ::util.geocoord type specifier
1174
';
1175

  
1176

  
1177
--
1157 1178
-- Name: contains(text, text); Type: FUNCTION; Schema: util; Owner: -
1158 1179
--
1159 1180

  
......
4925 4946
);
4926 4947

  
4927 4948

  
4949
--
4950
-- Name: ~@; Type: OPERATOR; Schema: util; Owner: -
4951
--
4952

  
4953
CREATE OPERATOR ~@ (
4954
    PROCEDURE = contained_within_approx,
4955
    LEFTARG = geocoord,
4956
    RIGHTARG = postgis.geometry
4957
);
4958

  
4959

  
4928 4960
SET search_path = pg_catalog;
4929 4961

  
4930 4962
--

Also available in: Unified diff