When using a PostGIS datastore it is possible to easily invert a polygon (by using ST_Difference).
This can be useful for visualization issues (for example when computing reachable areas), but it does not work when WMS advanced projection handling is enabled and a very large “masking polygon” (the whole world) is used.
I described this issue already on stackexchange with some sample screenshots:
http://gis.stackexchange.com/questions/202152/geoserver-and-inverting-a-multipolygon-to-dim-the-rest-of-a-map
Some sample data to reproduce the issue using a PostGIS datastore (in a PostGIS enabled database):
CREATE TABLE tbl_coverage (
id serial
)
SELECT AddGeometryColumn('tbl_coverage', 'geometry', 3857, 'MULTIPOLYGON', 2);
INSERT INTO tbl_coverage(id, geometry) VALUES (1, ST_GeomFromText('MULTIPOLYGON(((-20037508.34 -20037508.34,-20037508.34 20037508.34,20037508.34 20037508.34,20037508.34 -20037508.34,-20037508.34 -20037508.34),(1263712.34698648 5860372.32061089,1263714.48057553 5860329.57073683,1263721.03609557 5860315.73817625,1263735.45264563 5860310.59253155,1263749.28520621 5860317.14805159,1263754.43085091 5860331.56460165,1263752.34686607 5860373.32057592,1263754.02301501 5860407.11047801,1263753.94291004 5860407.33469354,1263754.04003213 5860407.55207963,1263754.9021743 5860438.93192778,1263755.82774871 5860464.92383092,1263797.70961396 5860463.42673455,1263812.05198292 5860468.77566224,1263818.41130623 5860482.69951164,1263813.06237854 5860497.04188061,1263799.13852914 5860503.40120392,1263757.61312918 5860504.88555819,1263759.89525378 5860547.46943944,1263754.8025924 5860561.90479102,1263740.99420201 5860568.51107061,1263726.55885044 5860563.41840923,1263719.95257084 5860549.61001885,1263717.60173289 5860505.74396342,1263690.51729945 5860505.91254828,1263690.44317542 5860505.88238425,1263690.36920448 5860505.91292177,1263690.35610841 5860505.90747908,1263690.34299244 5860505.91287365,1263673.69730521 5860505.87140825,1263659.56980571 5860499.97833325,1263653.74718831 5860485.82164926,1263659.64026331 5860471.69414976,1263673.7969473 5860465.87153235,1263677.38817805 5860465.88047833,1263690.42281294 5860460.49937365,1263703.25522207 5860465.83248726,1263715.83196484 5860465.75420434,1263714.92461937 5860440.27420493,1263714.95531969 5860440.19192054,1263714.91949477 5860440.11173447,1263714.06118938 5860408.87153549,1263712.34668544 5860374.30842544,1263712.70175723 5860373.31457192,1263712.34698648 5860372.32061089)))', 3857))
|