Skip to content

Instantly share code, notes, and snippets.

@dbaston
Created December 26, 2019 18:10
Show Gist options
  • Save dbaston/f9fb0ba9dbb7d3abef9ad0a934bcff88 to your computer and use it in GitHub Desktop.
Save dbaston/f9fb0ba9dbb7d3abef9ad0a934bcff88 to your computer and use it in GitHub Desktop.
Natural Earth oceans 2163
select st_difference(st_expand(st_envelope(geom), 100), geom) from
(select st_unaryunion(st_transform(st_union(geom), 2163)::geometry(geometry, 2163)) as geom from ne_50m_land) sq;
@dbaston
Copy link
Author

dbaston commented Dec 26, 2019

unary union is needed to fix invalidity in Antarctica after transform:
image

This is the only polygon that becomes invalid on transformation (at 50m, at least)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment