[mapserver-users] Problem with "ANGLE FOLLOW"

umn-ms at hydrotec.de umn-ms at hydrotec.de
Mon Dec 3 08:38:46 PST 2012


@Christy Nieman and @Olivier Courtin: Thank you very much!
This solved the issue.

I tried "MAXOVERLAPANGLE <shameless big number>" and all labels were drawn.
We'll read the blog to find a reasonable solution.

Thank's
Benedikt

mapserver-users-bounces at lists.osgeo.org schrieb am 03.12.2012 15:35:20:

> Olivier Courtin <olivier.courtin at gmail.com>
> Gesendet von: mapserver-users-bounces at lists.osgeo.org
>
> 03.12.2012 15:35
>
> An
>
> mapserver-users at lists.osgeo.org
>
> Kopie
>
> Thema
>
> Re: [mapserver-users] Problem with "ANGLE FOLLOW"
>
> Hi,
>
> For same kind of need (i.e hydrologic line to label), i've found that:
>  - Your lines must be long enough to allow the label to fit on
> (seems already your case, as it works for you without ANGLE FOLLOW)
>  - You have to increase MAXOVERLAPANGLE property
>  - Your lines have to be as smooth as possible
>
> Below a sample of such a thing with two layers, one with the data
> itself and one another using a generalization trought PostGIS
> ST_Simplify to help the geometry to be smoother enough
>
>  LAYER
>         NAME "label"
>         METADATA
>             "ows_title"           "Label des cours d'eau Carthage AERMC"
>        "ows_extent" "573401 6050407 1242369 6811885"
>        "ows_featureid" "gid"
>         END
>
>         PROJECTION
>             "init=epsg:2154"
>         END
>
>         TYPE line
>         STATUS on
>         DATA "geom from (SELECT gid, ST_simplify(geom, 200) As geom
> , toponyme, classe::integer
>                          FROM aermc.cours_eau WHERE toponyme IS NOT NULL)

>               AS foo using unique gid using srid=2154"
>        CONNECTIONTYPE postgis
>        CONNECTION "host=XXXX port=5432 dbname=XXXX user=XXXX"
>         LABELITEM toponyme
>         CLASSITEM classe
>         CLASS
>             EXPRESSION ([classe] <= 2)
>             LABEL
>               COLOR 0 0 0
>               OUTLINECOLOR 210 210 210
>               TYPE TRUETYPE
>          FONT vera
>              SIZE 10
>               ANTIALIAS TRUE
>               POSITION UC
>               ANGLE FOLLOW
>               PARTIALS FALSE
>               MINFEATURESIZE auto
>               REPEATDISTANCE 500
>          MAXOVERLAPANGLE 45
>             END
>         END
>         CLASS
>             EXPRESSION ([classe] <= 4)
>             LABEL
>               COLOR 30 30 30
>               OUTLINECOLOR 210 210 210
>               TYPE TRUETYPE
>          FONT vera
>              SIZE 8
>               ANTIALIAS TRUE
>               POSITION UC
>               ANGLE FOLLOW
>               PARTIALS FALSE
>               MINFEATURESIZE auto
>          MAXOVERLAPANGLE 40
>             END
>         END
>         CLASS
>             LABEL
>               COLOR 60 60 60
>               OUTLINECOLOR 210 210 210
>               TYPE TRUETYPE
>          FONT vera
>              SIZE 8
>               ANTIALIAS TRUE
>               POSITION UC
>               ANGLE FOLLOW
>               PARTIALS FALSE
>               MINFEATURESIZE auto
>          MAXOVERLAPANGLE 40
>             END
>    END
>     END
>
>     LAYER
>         NAME "cours_eau"
>         METADATA
>             "ows_title"           "Cours d'eau Carthage"
>        "ows_extent" "573401 6050407 1242369 6811885"
>        "ows_featureid" "gid"
>         END
>
>         PROJECTION
>             "init=epsg:2154"
>         END
>
>         TYPE line
>         STATUS on
>         DATA "geom from (SELECT gid, geom , classe::integer FROM
> aermc.cours_eau
>                          WHERE toponyme IS NOT NULL)
>               AS foo using unique gid using srid=2154"
>        CONNECTIONTYPE postgis
>        CONNECTION "host=XXXX port=5432 dbname=XXXX user=XXXX"
>         CLASSITEM classe
>         CLASS
>             EXPRESSION ([classe] <= 2)
>        STYLE
>           COLOR 33 33 210
>       WIDTH 5
>             END
>         END
>         CLASS
>             EXPRESSION ([classe] <= 4)
>        STYLE
>           COLOR 66 66 210
>       WIDTH 3
>             END
>         END
>         CLASS
>        STYLE
>           COLOR 99 99 210
>       WIDTH 1
>             END
>    END
>     END
>
> HTH,
>
> --
> Olivier_______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list