2014-05-05 23:13:06 +08:00
|
|
|
--
|
|
|
|
-- Create a valid GEOMETRY in 4326 from a lat/lng pair
|
|
|
|
--
|
|
|
|
-- @param lat A numeric latitude value.
|
|
|
|
--
|
|
|
|
-- @param lng A numeric longitude value.
|
|
|
|
--
|
|
|
|
--
|
|
|
|
|
2019-05-31 21:29:28 +08:00
|
|
|
CREATE OR REPLACE FUNCTION @extschema@.CDB_LatLng (lat NUMERIC, lng NUMERIC) RETURNS @postgisschema@.geometry as $$
|
|
|
|
SELECT @postgisschema@.ST_SetSRID(@postgisschema@.ST_MakePoint(lng,lat), 4326);
|
2017-10-24 20:16:56 +08:00
|
|
|
$$ language SQL IMMUTABLE PARALLEL SAFE;
|
2014-05-05 23:13:06 +08:00
|
|
|
|
2019-05-31 21:29:28 +08:00
|
|
|
CREATE OR REPLACE FUNCTION @extschema@.CDB_LatLng (lat FLOAT8, lng FLOAT8) RETURNS @postgisschema@.geometry as $$
|
|
|
|
SELECT @postgisschema@.ST_SetSRID(@postgisschema@.ST_MakePoint(lng,lat), 4326);
|
2017-10-24 20:16:56 +08:00
|
|
|
$$ language SQL IMMUTABLE PARALLEL SAFE;
|
2014-05-05 23:13:06 +08:00
|
|
|
|