Created
June 26, 2015 13:14
-
-
Save stepankuzmin/fca34a82eb71b813dc16 to your computer and use it in GitHub Desktop.
PostGIS polygon inversion function — allows to invert polygon with 900913 SRID
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| create function st_invert(geometry) returns setof geometry as | |
| 'SELECT st_difference(st_geomfromtext(''POLYGON((-20037508.3427892 147730758.194568, | |
| 20037508.3427892 147730758.194568, | |
| 20037508.3427892 -147730762.669922, | |
| -20037508.3427892 -147730762.669922, | |
| -20037508.3427892 147730758.194568))'', 900913), $1)' | |
| language sql; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment