-- See it on a map:
--
-- with a as (
-- 	SELECT
-- 		axh_crossdateline(the_geom_webmercator ORDER BY cartodb_id DESC) geom 
-- 	FROM 
-- 	deletetest
-- )
-- SELECT geom AS the_geom_webmercator from a
--
-- OR, write it back to a new table: 
--
-- with a as (
-- 	SELECT
-- 		axh_crossdateline(the_geom_webmercator ORDER BY cartodb_id DESC) geom 
-- 	FROM 
-- 	deletetest
-- )
-- SELECT ST_Transform(geom,4326) AS the_geom from a

CREATE AGGREGATE axh_crossdateline (geometry)
(
    sfunc = axh_crossdateline_fn,
    stype = geometry
);

