Skip to content
Snippets Groups Projects
Commit 6be1bb72 authored by User expired's avatar User expired
Browse files

adding MineT(X) functions for geography datatype

parent 9e1ae090
No related branches found
No related tags found
No related merge requests found
Pipeline #
Upcoming version: Upcoming version:
----------------- -----------------
- adding MineT(X) functions for geography datatype (Nikolaus Krismer)
- moved berlin dataset to only be deployed on dbis-isochrone (Nikolaus Krismer) - moved berlin dataset to only be deployed on dbis-isochrone (Nikolaus Krismer)
- added functions for MineT(X) algorithm to postgis/postgresql DB (Nikolaus Krismer) - added functions for MineT(X) algorithm to postgis/postgresql DB (Nikolaus Krismer)
- updated gradle to version 3.0 (Nikolaus Krismer) - updated gradle to version 3.0 (Nikolaus Krismer)
......
...@@ -55,3 +55,20 @@ BEGIN ...@@ -55,3 +55,20 @@ BEGIN
END; END;
$BODY$ $BODY$
LANGUAGE plpgsql IMMUTABLE; LANGUAGE plpgsql IMMUTABLE;
CREATE OR REPLACE FUNCTION getTileEnvelope(geog geography, zoom integer)
RETURNS geography AS
$BODY$
DECLARE
_result geography;
BEGIN
SELECT ST_MakeEnvelope(bbox.xmin, bbox.ymin, bbox.xmax, bbox.ymax, 4326)::geography INTO _result FROM (
SELECT tile2lon(tile.x, zoom) AS xmin, tile2lat(y, zoom) AS ymin, tile2lon(tile.x + 1, zoom) AS xmax, tile2lat(y + 1, zoom) AS ymax FROM (
SELECT lon2tile(ST_X(geog::geometry), zoom) AS x, lat2tile(ST_Y(geog::geometry), zoom) AS y
) AS tile
) AS bbox;
RETURN _result;
END;
$BODY$
LANGUAGE plpgsql IMMUTABLE;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment