Re: [mapserver-users] Problem with ANGLE FOLLOW
Try lowering the BUFFER number? ... Good idea. But even changing to BUFFER 0 didn't change anything ... Problem is still there. Benedikt TC Haddad tchad...@gmail.com schrieb am 03.12.2012 13:54:56: TC Haddad tchad...@gmail.com 03.12.2012 13:55 An umn...@hydrotec.de umn...@hydrotec.de Kopie Thema Re: [mapserver-users] Problem with ANGLE FOLLOW Try lowering the BUFFER number? If each label has a big buffer, then less labels can fit... Tanya On Dec 3, 2012, at 2:56 AM, umn...@hydrotec.de wrote: Hi I'm using ANGLE-FOLLOW in Mapserver 6.2 to label lines. Unfortunately only 5 of 12 features are labeld. I attach an example with data and mapfile. It can be used with shp2img -m example.map -o out.png All features are drawn, but most of them are not labeld, although there should be enough space for all labels. (To activate this example, one has to add arialbd.ttf in the test-directory. I didn't attach this one, because of size-limits in this mailing-list...) Without ANGLE FOLLOW all labels are drawn. Benedikt #Layerdefinition: LAYER NAME Striche TYPE LINE STATUS ON DEBUG 5 TEMPLATE dummy.html TOLERANCE 0 DATA Striche LABELITEM name CLASS NAME Hauptsammler LABEL COLOR 0 0 0 OUTLINECOLOR 255 255 255 OUTLINEWIDTH 6 TYPE truetype SIZE 5 MINDISTANCE 0 ANGLE FOLLOW FORCE TRUE FONT arial-bold BUFFER 10 END STYLE OUTLINECOLOR 0 0 0 WIDTH 3 PATTERN 5 5 END LINECAP BUTT END END END (See attached file: missinglabel.zip) missinglabel.zip ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
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= port=5432 dbname= user= 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= port=5432 dbname= user= 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@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Problem with ANGLE FOLLOW
Hi, ANGLE FOLLOW is subject to MAXOVERLAPANGLE (see http://mapserver.org/mapfile/label.html). If there is an angle between letters that is larger than 22.5 (if you don't have a manually-set value), then the label will not be drawn. I wrote a blog post that may help you understand: http://research.dmsolutions.ca/2011/new-and-exciting-in-mapserver-6-0/ Christy On 12/03/2012 09:07 AM, umn...@hydrotec.de wrote: Try lowering the BUFFER number? ... Good idea. But even changing to BUFFER 0 didn't change anything ... Problem is still there. Benedikt TC Haddad tchad...@gmail.com schrieb am 03.12.2012 13:54:56: TC Haddad tchad...@gmail.com 03.12.2012 13:55 An umn...@hydrotec.de umn...@hydrotec.de Kopie Thema Re: [mapserver-users] Problem with ANGLE FOLLOW Try lowering the BUFFER number? If each label has a big buffer, then less labels can fit... Tanya On Dec 3, 2012, at 2:56 AM, umn...@hydrotec.de wrote: Hi I'm using ANGLE-FOLLOW in Mapserver 6.2 to label lines. Unfortunately only 5 of 12 features are labeld. I attach an example with data and mapfile. It can be used with shp2img -m example.map -o out.png All features are drawn, but most of them are not labeld, although there should be enough space for all labels. (To activate this example, one has to add arialbd.ttf in the test-directory. I didn't attach this one, because of size-limits in this mailing-list...) Without ANGLE FOLLOW all labels are drawn. Benedikt #Layerdefinition: LAYER NAME Striche TYPE LINE STATUS ON DEBUG 5 TEMPLATE dummy.html TOLERANCE 0 DATA Striche LABELITEM name CLASS NAME Hauptsammler LABEL COLOR 0 0 0 OUTLINECOLOR 255 255 255 OUTLINEWIDTH 6 TYPE truetype SIZE 5 MINDISTANCE 0 ANGLE FOLLOW FORCE TRUE FONT arial-bold BUFFER 10 END STYLE OUTLINECOLOR 0 0 0 WIDTH 3 PATTERN 5 5 END LINECAP BUTT END END END (See attached file: missinglabel.zip) missinglabel.zip ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Problem with ANGLE FOLLOW
I have updated the documentation for 6.2 by including a reference to MAXOVERLAPANGLE in the description of ANGLE FOLLOW. Håvard On 12/3/2012 3:35 PM, Olivier Courtin wrote: 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= port=5432 dbname= user= 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= port=5432 dbname= user= 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@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Problem with ANGLE FOLLOW
@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-boun...@lists.osgeo.org schrieb am 03.12.2012 15:35:20: Olivier Courtin olivier.cour...@gmail.com Gesendet von: mapserver-users-boun...@lists.osgeo.org 03.12.2012 15:35 An mapserver-users@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= port=5432 dbname= user= 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= port=5432 dbname= user= 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@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users