[mapserver-users] Problem with "ANGLE FOLLOW"
Olivier Courtin
olivier.courtin at gmail.com
Mon Dec 3 06:35:20 PST 2012
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20121203/2d935d8c/attachment.htm>
More information about the MapServer-users
mailing list