0

I am able to draw and create a WMS mapfile for POLYGON and LINE but not for a POINT, I am not sure what maybe the issue, can you assist

LAYER
    NAME    Country
    TYPE POINT
    EXTENT -25 -35 51 37
    CONNECTIONTYPE  POSTGIS
    CONNECTION  'host=localhost dbname=xxx user=xxxx password=xxx port=5432'
    DATA "geom from (SELECT geom, gid FROM education WHERE country = 'xxxx' AND electricity = 'Yes' AND water = 'Yes') as subquery USING unique gid USING srid=4326" 
    METADATA
        'wms_title' 'Country'
        'wms_server_version'    '1.1.0'
        'gml_include_items' 'all'
        'wms_include_items' 'all'
    END
    STATUS  OFF
    TRANSPARENCY 100
    PROJECTION
        'init=epsg:4326'
    END
    
    CLASS
        NAME    'Country'
        STYLE
            SYMBOL "circle"
            SIZE 16
            COLOR 255 0 0
            OUTLINECOLOR 0 0 0
        END
    END
END

Please assist...

1
  • Where is circle defined?
    – nmtoken
    Commented Sep 5, 2018 at 10:12

1 Answer 1

1

You reference a symbol called circle, so make sure that your map file can find the definition of circle.

Classical way is to have your symbols in a separate file let's call it symbols.sym then in your MAP section reference its location like:

SYMBOLSET "../DefaultMapIncludes/symbols.sym"

In symbols.sym you'd define your symbols like:

SYMBOLSET
    SYMBOL
        NAME "circle"
        TYPE ellipse
        FILLED false
        POINTS
            1 1
        END
        ANCHORPOINT 0.5 0.5
    END
    SYMBOL
        NAME "circlef"
        TYPE ellipse
        FILLED true
        POINTS
            10 10
        END
        ANCHORPOINT 0.5 0.5
    END
    SYMBOL
        NAME "cross"
        TYPE vector
        POINTS
            2.0 0.0
            2.0 4.0
            -99 -99
            0.0 2.0
            4.0 2.0
        END
    END
    SYMBOL
        NAME "cross2"
        # This is a multiplies type cross
        TYPE vector
        POINTS
            0 0
            1 1
            -99 -99
            0 1
            1 0
        END
    END
    SYMBOL
        NAME "plus"
        # This is a plus type cross
        TYPE vector
        POINTS
            .5 0
            .5 1
            -99 -99
            0 .5
            1 .5
        END
    END
    SYMBOL
        NAME "squaref"
        TYPE vector
        POINTS
          0 0
          0 1
          1 1
          1 0
          0 0
        END
        FILLED true
        ANCHORPOINT 0.5 0.5
    END
        SYMBOL
        NAME "square"
        TYPE vector
        POINTS
            0 0
            0 1
            1 1
            1 0
            0 0
        END
        FILLED false
        ANCHORPOINT 0.5 0.5
    END
    SYMBOL
        NAME "dsquaref"
        TYPE vector
        POINTS
            0 2
            2 4
            4 2
            2 0
            0 2
        END
        FILLED true
        ANCHORPOINT 0.5 0.5
    END
    SYMBOL
        NAME "triangle"
        TYPE vector
        POINTS
           0 4
           2 0
           4 4
           0 4
        END
        FILLED false
    END
    SYMBOL
        NAME "trianglef"
        TYPE vector
        POINTS
           0 4
           2 0
           4 4
           0 4
        END
        FILLED true
    END
        SYMBOL
        NAME "dtrianglef"
        TYPE vector
        POINTS
            2 4
            4 0
            0 0
            2 4
        END
        FILLED true
    END
    SYMBOL
        NAME starf
        TYPE vector
        FILLED TRUE
        POINTS
            0 .375
            .35 .375
            .5 0
            .65 .375
            1 .375
            .75 .625
            .875 1
            .5 .75
            .125 1
            .25 .625
        END
    END
    SYMBOL
        NAME fatplusf
        TYPE vector
        FILLED TRUE
        POINTS
            0 1
            0 2
            1 2
            1 3
            2 3
            2 2
            3 2
            3 1
            2 1
            2 0
            1 0
            1 1
         END
    END
    SYMBOL
        NAME pentagonf
        TYPE vector
        FILLED TRUE
        POINTS
            0 .375
            .5 0
            1 .375
            .875 1
            .125 1
        END
    END
END

and then you can reference the symbol in your LAYER > CLASS > STYLE

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.