[MapServer-users] Layer is opaque

Rahkonen Jukka jukka.rahkonen at maanmittauslaitos.fi
Thu Apr 20 12:51:32 PDT 2023


Hi,

Work for me in two different ways with this test layer

LAYER
      NAME "layername"
      TYPE POLYGON
      FEATURE
      POINTS 10 5 15 10 5 10 10 5 END
      END #feature
    # opacity defined with COMPOSITE
      COMPOSITE
      OPACITY 70
     END # COMPOSITE

      METADATA
      'wms_title' 'layername'
      "wms_srs" "EPSG:4326"
      END #metadata
    CLASS
        STYLE
            #alternatively opacity defined in style
            #OPACITY 80
            COLOR  210 155 100
        END #style
        END #class
        END #layer

The outputformat must be png, jpeg does not support opacity/transparency.

-Jukka Rahkonen-

Lähettäjä: MapServer-users <mapserver-users-bounces at lists.osgeo.org> Puolesta Atlanta Geek
Lähetetty: torstai 20. huhtikuuta 2023 16.03
Vastaanottaja: mapserver <MapServer-users at lists.osgeo.org>
Aihe: [MapServer-users] Layer is opaque

I am trying to use mapserver to display some data but unfortunately the map in not visible below the layer. My configuration of my mapserver is below. Any guidance would be appreciated.

MAP
IMAGETYPE png
MAXSIZE 4000
SIZE 800 800
EXTENT -9583207 3548826 -8999182 4183713
UNITS meters
IMAGECOLOR "#FF000000"
WEB
   METADATA
      "wfs_title" "mapserverdemo"
      "wfs_enable_request" "*"
      "wfs_onlineresource" "http://localhost:8080/mapserv?map=/etc/mapserver/wms.map"
      "ows_enable_request" "*"
      "wms_srs" "EPSG:3857 EPSG:4326"
      "wfs_srs" "EPSG:3857 EPSG:4326"
      "labelcache_map_edge_buffer" "-1"
      "wms_title" "OpenStreetMap"
      "wms_feature_info_mime_type" "text/plain text/html application/json"
   END
   IMAGEPATH "/ms4w/tmp/ms_tmp/"
   IMAGEURL "/ms_tmp/"
END
DEBUG 1
CONFIG "MS_ERRORFILE" "stderr"
PROJECTION
   "init=epsg:3857"
END
OUTPUTFORMAT
  NAME "jpeg_png"
  MIMETYPE "image/vnd.jpeg-png"
  DRIVER AGG/MIXED
  IMAGEMODE RGBA
  FORMATOPTION "TRANSPARENT_FORMAT=png"
  FORMATOPTION "OPAQUE_FORMAT=jpeg"
END


LAYER
    STATUS DEFAULT
    TYPE POLYGON
    NAME "h3_polygons"
    GROUP "h3"
    CONNECTIONTYPE postgis
    CONNECTION "host=host.docker.internal dbname=h3demo user=postgres password=postgres port=5432"
    DATA "geom from pop6 using unique fld using srid=4326"
    COMPOSITE
      OPACITY 70
    END # COMPOSITE
    CLASS
      STYLE
         OUTLINECOLOR 0 0 255
         WIDTH 3
      END
      STYLE
         COLOR 255 0 0
         OPACITY 10
      END
   END



  PROJECTION #source
    "init=epsg:4326"
  END
END

END

--
http://www.atlantageek.com<http://www.atlantageek.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20230420/54ad2c13/attachment.htm>


More information about the MapServer-users mailing list