Skip to content

Instantly share code, notes, and snippets.

@andrewxhill
andrewxhill / AXH_CrossDateLine.sql
Last active October 13, 2015 20:55
PLPGSQL Function to cross the dateline
--
-- Create a valid GEOMETRY in 3857 like the_geom_webmercator
--
-- @param pointa is GEOMETRY in 3857 like the_geom_webmercator
--
-- @param pointb is GEOMETRY in 3857 like the_geom_webmercator
--
--
CREATE OR REPLACE FUNCTION AXH_CrossDateLine (pointa GEOMETRY, pointb GEOMETRY) RETURNS geometry as $$