[mapserver-users] Using MASK to obscure areas

thomas bonfort thomas.bonfort at gmail.com
Mon Oct 28 03:32:17 PDT 2013


Fabian,
For now you should "invert" your masking features, which is something
you can probably do rather easily with a few lines of geos code in
your python scripts. To my knowledge, there is no such thing as being
able to mask out a pre-exisiting map state, but this is something that
would be possible to implement with the "source" compositing operator,
and that I would like to see coming into mapserver along with other
compositing operations (e.g. multiply). I don't have any funding for
this at the time being, so the timeframe for this actually happening
is still very uncertain.

cheers,
thomas


On 28 October 2013 09:39, Fabian Schindler <fabian.schindler at eox.at> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Dear mapserver devs and users,
>
> Using the MASK feature of mapserver I'm able to define areas which are
> visible (masked 'in'). My goal is to achieve the opposite, to mask
> *out* areas of the image which shall be rendered transparent.
>
> Is there any way to do this?
>
> Thanks,
> Fabian
>
>
> P.S: My mapfile currently looks like this (it is autogenerated, as I'm
> using mapscript for the task):
>
> MAP
>
>   # ... a lot of stuff left out for brevity
>
>   PROJECTION
>     "init=epsg:4326"
>   END # PROJECTION
>
>   WEB
>     METADATA
>       "ows_enable_request"      "*"
>     END # METADATA
>   END # WEB
>
>   LAYER
>     NAME "masklayer"
>     CONNECTION "mask.json"
>     CONNECTIONTYPE OGR
>     METADATA
>       "wms_srs" "EPSG:4326"
>       "wms_include_items"       "all"
>       "ows_srs" "EPSG:4326"
>       "gml_include_items"       "all"
>     END # METADATA
>     PROJECTION
>       "init=epsg:4326"
>     END # PROJECTION
>     STATUS ON
>     TYPE POLYGON
>     CLASS
>       STYLE
>         COLOR 0 0 0
>       END # STYLE
>     END # CLASS
>   END # LAYER
>
>   LAYER
>     NAME "data"
>     DATA "data.tif"
>     EXTENT 11.331755 32.19025 28.29481 46.268645
>     MASK "masklayer"
>     METADATA
>       "wms_srs" "EPSG:4326"
>       "wms_extent"      "11.331755 32.190250 28.294810 46.268645"
>       "ows_srs" "EPSG:4326"
>     END # METADATA
>     OFFSITE 0 0 0
>     PROJECTION
>       "proj=longlat"
>       "datum=WGS84"
>       "no_defs"
>     END # PROJECTION
>     STATUS OFF
>     TYPE RASTER
>   END # LAYER
>
> END # MAP
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.14 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQEcBAEBAgAGBQJSbiLRAAoJEJoaok7HgajK8hEIAJoGasCNOVAyaLvFqHy47l3P
> USjbfd4Ry23EwTJf+NrNgfAVWZaCvs6kzPqD5rHX02zkDJPnh/UKfyMkJPfRGfpC
> Ar+aZZaK+u8PtP9UZGhXqJq1mHEqee5zX4SwbvMO7RA1AF1ggtKa3OLLWMqq/Dsx
> 1FgNAS++lsUFG0p47YCyIe0Trl78aRhK7LnAD0yYeD1N8zLPnkbOnn5KnrUlrTB+
> 8Jne9xKKcDI9IbTRORWZ0Ngrr+WxUHm6HYEduyy4gqPFKU9lVEJXWykDqHSfQHcT
> fG0aDdBmLWtgwzWzHCM+gBeiUf3ruUsECxX4flQ+mwQTGI5ajrORPYyzWGZkb5Y=
> =PmMP
> -----END PGP SIGNATURE-----
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the MapServer-users mailing list