[mapserver-users] Using MASK to obscure areas

Fabian Schindler fabian.schindler at eox.at
Mon Oct 28 01:39:45 PDT 2013


-----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-----



More information about the MapServer-users mailing list