Hello everyone, I have a problem with setting up legends to my mapfiles - i
would like to use png picture as legend.
 MAP
    NAME "se2waq_color"
    CONFIG "GDAL_HTTP_TCP_KEEPALIVE" "YES"
    CONFIG "CPL_VSIL_CURL_CHUNK_SIZE" "98304"
    CONFIG "GDAL_INGESTED_BYTES_AT_OPEN" "16384"
    CONFIG "CPL_DEBUG" "OFF"
    CONFIG "GDAL_NUM_THREADS" "-1"
    CONFIG "PROJ_DEBUG" "OFF"

    EXTENT 1832873.2304 6205299.2694 2619574.5428 7545553.5142
    UNITS METERS
    SIZE 512 512
    IMAGETYPE PNG
    SHAPEPATH "/data/"
    PROJECTION
        "init=epsg:3857"
    END

    WEB
        IMAGEPATH "/tmp/"
        IMAGEURL "/tmp/"
        METADATA
            "wms_title"           "se2waq_color"
            "wms_srs"             "EPSG:3857 EPSG:4326 EPSG:2180"
            "wms_enable_request"  "*"
            "wms_server_version"  "1.3.0"
            "wms_feature_info_mime_type" "text/html"
            "wms_include_items" "all"
            "wms_getcapabilities_version" "1.3.0"
            "wms_timeitem" "date" # Kolumna z czasem
            "wms_legendgraphic" "se2waq_legend" # Powiązanie z warstwą
legendy
            "wms_getlegendgraphic_format" "image/png"
        END
    END

    LEGEND
        STATUS ON
        IMAGECOLOR 25 25 25
        KEYSIZE 180 120
        LABEL
            SIZE SMALL
            COLOR 80 80 80
        END
        TRANSPARENT TRUE
        OUTLINECOLOR 80 80 80
    END

    ########################################################################
    LAYER
        STATUS ON
        NAME "se2waq_color_index"
        TYPE POLYGON

        CONNECTIONTYPE postgis
        CONNECTION "user=staradmin password=jabolowice1L dbname=indeksy
host=starserver1.postgres.database.azure.com port=5432"

        DATA 'geometry from se2waq_color using unique id using srid=3857'

        PROJECTION
            "init=epsg:3857"
        END

        METADATA
            "wms_timeextent" "2023-01-01/2024-01-01/P1D"
            "wms_timeitem" "date"
            "wms_enable_request" "*"
        END
        PROCESSING "CLOSE_CONNECTION=DEFER"
    END
    ########################################################################
    LAYER
        NAME "se2waq_color"
        TYPE RASTER
        STATUS ON
        DEBUG ON

        PROJECTION
            "+init=epsg:3857"
        END

        METADATA
            "wms_timeextent" "2023-01-01/2024-01-01/P1D"
            "wms_timeitem" "date"
            "wms_enable_request" "*"
        END

        TILEITEM "file_path"
        TILEINDEX "se2waq_color_index"
        PROCESSING "CLOSE_CONNECTION=DEFER"
    END
    ########################################################################
    LAYER
        NAME "se2waq_legend"
        TYPE RASTER
        STATUS ON
        DATA "/home/eouser/Desktop/mapfiles/watercolorlegend.png"

        METADATA
            "wms_title" "Legenda"
            "wms_enable_request" "*"
        END
    END
END

This mapfile works and is displayed via mapbender, but legend doesnt work,
and when i use wms request like this
http://localhost:8585/?map=/etc/mapserver/se2waq_color.map&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&FORMAT=image/png&LAYER=se2waq_color&SLD_VERSION=1.1.0
I
only get white, narrow square as output. I suppose it might be some
problems with path. Im looking forward for your help.
_______________________________________________
MapServer-users mailing list
MapServer-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to