{"version":"1.0","type":"rich","title":"PLPGSQL Function to cross the dateline","description":"This example provides a PL/pgSQL function, `AXH_CrossDateLine`, that constructs a valid geometry for a line crossing the antimeridian in Web Mercator projection (EPSG:3857). It takes two input points, identifies the western and easternmost coordinates, and calculates the latitude where the line intersects the projection’s edge using proportional math. The function then returns a multi-part line by splitting the path at the ±20037508.34 meter boundaries, using PostGIS functions like `ST_MakeLine`, `ST_SetSRID`, and `ST_Collect`. This utility ensures dateline-crossing routes render correctly in web maps.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-8795878?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}