0

I'm working on a project with MapServer with PostGIS and I need to retrieve from my table and display a layer that shows some information like a street name.

What I have? I have my map rendered perfectly, showing all streets of a city, and I need to define a layer to show on the rendered street their names.

I've searched in MapServer Documentation about text layers but I did not found anything that actually help to solve my problem.

I've read the link suggested in the comments of this question and make this code, but it does not work.

  LAYER
    NAME face_guarulhos
    TYPE line
    CONNECTIONTYPE postgis
    CONNECTION "db stuff config"
    DATA "geomlatlon from ctageo.face_guarulhos"
    STATUS default

        METADATA
            "wms_title" "face_guarulhos"
        END

    CLASS
      NAME "Faces Guarulhos"
            OUTLINECOLOR 139 134 130
      COLOR 255 145 145

            LABEL
                COLOR 255 255 255
                OUTLINECOLOR 0 0 0
                SIZE 10
                ANGLE 0
                POSITION AUTO
                PARTIALS false
            END
  END

END
3

1 Answer 1

1

I've found how to solve my problem, this is the correct mapfile!

LAYER
    NAME face_guarulhos
    TYPE line
    CONNECTIONTYPE postgis
    CONNECTION "db connection stuff"
    DATA "geomlatlon from ctageo.face_guarulhos"
    LABELITEM "vu_2017_uf"
    STATUS default

    METADATA
        "wms_title" "face_guarulhos"
    END

    CLASS
        NAME "Faces Guarulhos"
        OUTLINECOLOR 139 134 130
        COLOR 255 145 145

        LABEL
            COLOR 132 31 31
            SHADOWCOLOR 218 218 218
            SHADOWSIZE 2 2
            TYPE truetype
            #FONT "sans"
            SIZE 12
            ANTIALIAS TRUE
            POSITION CL
            PARTIALS FALSE
            MINDISTANCE 300
            BUFFER 4
        END
    END

END

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.