RE: [mapserver-users] Labeling behavior at the edge of image
MINFEATURESIZE is used only for labeling and makes sense when a polygons are clipped. It allows you avoid labeling slivers. Steve -Original Message- From: Jackey Cheung [mailto:cheung.jac...@gmail.com] Sent: Thursday, January 19, 2012 6:52 PM To: Lime, Steve D (DNR) Cc: mapserver-users@lists.osgeo.org Subject: Re: [mapserver-users] Labeling behavior at the edge of image Hi Steve, Thanks for you promptly reply. I've definitely try label_no_clip out. However, I don't think the MINFEATURESIZE if for me. The polygon as a whole is big enough for labeling, the problem is just that it's sliced into two parts. Having a min size limit on it may render the label gone at the edge, which is not the desire result. On Thu, Jan 19, 2012 at 10:26 PM, Lime, Steve D (DNR) steve.l...@state.mn.us wrote: You can use the label_no_clip (I think that's right) PROCESSING parameter to force label position to be computed on the untransformed geometry. This results in a stable position regardless of scale or map extent. You can also use the label parameter MINFEATURESIZE to limit the size of the features being labeled. Its value is given in pixel and for polygons its compared against the narrowest portion of the computed bounding box for the feature. Steve From: mapserver-users-boun...@lists.osgeo.org [mapserver-users-boun...@lists.osgeo.org] on behalf of Jackey Cheung [cheung.jac...@gmail.com] Sent: Thursday, January 19, 2012 3:49 AM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] Labeling behavior at the edge of image Hi all, I've met an issue during my work. There is a polygon right at the edge of an generated image. By setting position to auto, the label is rendered, shifted a little bit off. It's as expected I would say. However, a question arose immediately, what happen to the label of the other part of the same polygon in the tile right next to this image? Answer is that it's not render, no label to the other part. It seems reasonable too. But it does seems a bit odd to viewers, since after tiles are shown on a browser tile by tile side by side. No one will notice that there is the edge slicing the polygon right into two parts, and the label is shifted off from the center of the polygon. So, if I would like to have the label sits right at the middle (position cc) of the polygon, then what? Not sure if it can be achieved. I've tried allowing partial label, but doesn't seem working. Anyone have any idea? ___ 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] Labeling behavior at the edge of image
You can use the label_no_clip (I think that's right) PROCESSING parameter to force label position to be computed on the untransformed geometry. This results in a stable position regardless of scale or map extent. You can also use the label parameter MINFEATURESIZE to limit the size of the features being labeled. Its value is given in pixel and for polygons its compared against the narrowest portion of the computed bounding box for the feature. Steve From: mapserver-users-boun...@lists.osgeo.org [mapserver-users-boun...@lists.osgeo.org] on behalf of Jackey Cheung [cheung.jac...@gmail.com] Sent: Thursday, January 19, 2012 3:49 AM To: mapserver-users@lists.osgeo.org Subject: [mapserver-users] Labeling behavior at the edge of image Hi all, I've met an issue during my work. There is a polygon right at the edge of an generated image. By setting position to auto, the label is rendered, shifted a little bit off. It's as expected I would say. However, a question arose immediately, what happen to the label of the other part of the same polygon in the tile right next to this image? Answer is that it's not render, no label to the other part. It seems reasonable too. But it does seems a bit odd to viewers, since after tiles are shown on a browser tile by tile side by side. No one will notice that there is the edge slicing the polygon right into two parts, and the label is shifted off from the center of the polygon. So, if I would like to have the label sits right at the middle (position cc) of the polygon, then what? Not sure if it can be achieved. I've tried allowing partial label, but doesn't seem working. Anyone have any idea? ___ 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] labeling streets
Hi, I think I found the cause. When declaring ANGLE AUTO, then MINFEATURESIZE auto was working. But with ANGLE FOLLOW there was a problem displaying labels. Could it be considered as a bug? Raivo On Tue, Jun 9, 2009 at 9:48 AM, Raivo Allasnaper...@gmail.com wrote: Hi, I added red box to visualize line vertices (style geomtransform start symbol box color 255 0 0 size 6 end) and the result is displayed here: http://picasaweb.google.com/snaperski/Ort#5345215158256974066 Best wishes, Raivo On Tue, Jun 9, 2009 at 9:18 AM, Thomas Bonfortthomas.bonf...@camptocamp.com wrote: Raivo, are you sure that your streets only contain one feature? If you are using 5.4+, you can check by appending a geomtransform style to your street layer, to draw a symbol at the beginning of each feature: style geomtransform start symbol circle color 255 0 0 size 15 end regards, thomas www.camptocamp.com +33 4 79 26 57 97 On Tue, Jun 9, 2009 at 07:50, Raivo Allasnaper...@gmail.com wrote: Thank You, so it should be, but somehow in my case it does not work properly. When i have no declaration of MINFEATURESIZE, then the picture looks fine: http://picasaweb.google.com/snaperski/Ort#5345194219497220482 But when I add MINFEATURESIZE AUTO, most labels just disappear, even if they have enough space to fit in: http://picasaweb.google.com/snaperski/Ort#5345195269825705586 And those labeled straight streets contain only one feature (line feature) each - so the label should fit in decently. Label is declared this way: LABEL TYPE truetype ANTIALIAS true FONT arial COLOR 240 240 240 OUTLINECOLOR 52 52 52 SIZE 9 force false MINDISTANCE 250 MINFEATURESIZE auto ANGLE follow POSITION cc BUFFER 1 END Changing FORCE or POSITION parameters didnt help either Raivo On Mon, Jun 8, 2009 at 12:55 PM, Christy Niemancnie...@dmsolutions.ca wrote: Hi, You could set MINFEATURESIZE to AUTO and then only the labels that fit on the lines should be drawn. Regards, Christy Raivo Alla wrote: Hello! I'm stuck in simple-looking problem, but the solution is just hiding somewhere. The question is: how I can label only those line features, whos label does not run over the line like that: http://picasaweb.google.com/snaperski/Ort#5344831130138846050 As street lengths are very different, I cant solve the problem by setting suitable MINFEATURESIZE for respective MINSCALE,MAXSCALE range. All the best, Raivo Alla ___ 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] labeling streets
Raivo, are you sure that your streets only contain one feature? If you are using 5.4+, you can check by appending a geomtransform style to your street layer, to draw a symbol at the beginning of each feature: style geomtransform start symbol circle color 255 0 0 size 15 end regards, thomas www.camptocamp.com +33 4 79 26 57 97 On Tue, Jun 9, 2009 at 07:50, Raivo Allasnaper...@gmail.com wrote: Thank You, so it should be, but somehow in my case it does not work properly. When i have no declaration of MINFEATURESIZE, then the picture looks fine: http://picasaweb.google.com/snaperski/Ort#5345194219497220482 But when I add MINFEATURESIZE AUTO, most labels just disappear, even if they have enough space to fit in: http://picasaweb.google.com/snaperski/Ort#5345195269825705586 And those labeled straight streets contain only one feature (line feature) each - so the label should fit in decently. Label is declared this way: LABEL TYPE truetype ANTIALIAS true FONT arial COLOR 240 240 240 OUTLINECOLOR 52 52 52 SIZE 9 force false MINDISTANCE 250 MINFEATURESIZE auto ANGLE follow POSITION cc BUFFER 1 END Changing FORCE or POSITION parameters didnt help either Raivo On Mon, Jun 8, 2009 at 12:55 PM, Christy Niemancnie...@dmsolutions.ca wrote: Hi, You could set MINFEATURESIZE to AUTO and then only the labels that fit on the lines should be drawn. Regards, Christy Raivo Alla wrote: Hello! I'm stuck in simple-looking problem, but the solution is just hiding somewhere. The question is: how I can label only those line features, whos label does not run over the line like that: http://picasaweb.google.com/snaperski/Ort#5344831130138846050 As street lengths are very different, I cant solve the problem by setting suitable MINFEATURESIZE for respective MINSCALE,MAXSCALE range. All the best, Raivo Alla ___ 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] labeling streets
Hi, I added red box to visualize line vertices (style geomtransform start symbol box color 255 0 0 size 6 end) and the result is displayed here: http://picasaweb.google.com/snaperski/Ort#5345215158256974066 Best wishes, Raivo On Tue, Jun 9, 2009 at 9:18 AM, Thomas Bonfortthomas.bonf...@camptocamp.com wrote: Raivo, are you sure that your streets only contain one feature? If you are using 5.4+, you can check by appending a geomtransform style to your street layer, to draw a symbol at the beginning of each feature: style geomtransform start symbol circle color 255 0 0 size 15 end regards, thomas www.camptocamp.com +33 4 79 26 57 97 On Tue, Jun 9, 2009 at 07:50, Raivo Allasnaper...@gmail.com wrote: Thank You, so it should be, but somehow in my case it does not work properly. When i have no declaration of MINFEATURESIZE, then the picture looks fine: http://picasaweb.google.com/snaperski/Ort#5345194219497220482 But when I add MINFEATURESIZE AUTO, most labels just disappear, even if they have enough space to fit in: http://picasaweb.google.com/snaperski/Ort#5345195269825705586 And those labeled straight streets contain only one feature (line feature) each - so the label should fit in decently. Label is declared this way: LABEL TYPE truetype ANTIALIAS true FONT arial COLOR 240 240 240 OUTLINECOLOR 52 52 52 SIZE 9 force false MINDISTANCE 250 MINFEATURESIZE auto ANGLE follow POSITION cc BUFFER 1 END Changing FORCE or POSITION parameters didnt help either Raivo On Mon, Jun 8, 2009 at 12:55 PM, Christy Niemancnie...@dmsolutions.ca wrote: Hi, You could set MINFEATURESIZE to AUTO and then only the labels that fit on the lines should be drawn. Regards, Christy Raivo Alla wrote: Hello! I'm stuck in simple-looking problem, but the solution is just hiding somewhere. The question is: how I can label only those line features, whos label does not run over the line like that: http://picasaweb.google.com/snaperski/Ort#5344831130138846050 As street lengths are very different, I cant solve the problem by setting suitable MINFEATURESIZE for respective MINSCALE,MAXSCALE range. All the best, Raivo Alla ___ 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] labeling streets
Hi, You could set MINFEATURESIZE to AUTO and then only the labels that fit on the lines should be drawn. Regards, Christy Raivo Alla wrote: Hello! I'm stuck in simple-looking problem, but the solution is just hiding somewhere. The question is: how I can label only those line features, whos label does not run over the line like that: http://picasaweb.google.com/snaperski/Ort#5344831130138846050 As street lengths are very different, I cant solve the problem by setting suitable MINFEATURESIZE for respective MINSCALE,MAXSCALE range. All the best, Raivo Alla ___ 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] labeling streets
Thank You, so it should be, but somehow in my case it does not work properly. When i have no declaration of MINFEATURESIZE, then the picture looks fine: http://picasaweb.google.com/snaperski/Ort#5345194219497220482 But when I add MINFEATURESIZE AUTO, most labels just disappear, even if they have enough space to fit in: http://picasaweb.google.com/snaperski/Ort#5345195269825705586 And those labeled straight streets contain only one feature (line feature) each - so the label should fit in decently. Label is declared this way: LABEL TYPE truetype ANTIALIAS true FONT arial COLOR 240 240 240 OUTLINECOLOR 52 52 52 SIZE 9 force false MINDISTANCE 250 MINFEATURESIZE auto ANGLE follow POSITION cc BUFFER 1 END Changing FORCE or POSITION parameters didnt help either Raivo On Mon, Jun 8, 2009 at 12:55 PM, Christy Niemancnie...@dmsolutions.ca wrote: Hi, You could set MINFEATURESIZE to AUTO and then only the labels that fit on the lines should be drawn. Regards, Christy Raivo Alla wrote: Hello! I'm stuck in simple-looking problem, but the solution is just hiding somewhere. The question is: how I can label only those line features, whos label does not run over the line like that: http://picasaweb.google.com/snaperski/Ort#5344831130138846050 As street lengths are very different, I cant solve the problem by setting suitable MINFEATURESIZE for respective MINSCALE,MAXSCALE range. All the best, Raivo Alla ___ 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] Labeling
It is always an option to create a string column and then populate it with your numbers formatted the way that you want them to appear. I am sure that you realize this, but it is something that I have done in the past. David. -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jay Kapalczynski Sent: Thursday, March 26, 2009 9:14 AM To: 'mapserver-users@lists.osgeo.org' Subject: [mapserver-users] Labeling Is there any way to eliminate the decimal places here...I looked online but was unable to find anything. Thanks The fields I am labeling are numeric...so I get this 3434. 123. I am looking to drop all the extra decimal places... Or maybe set it to keep two 3434.00 THANKS LAYER # Maple Grove Parcels NAME Parcel_Labels DATA './parcels.shp' STATUS DEFAULT TYPE annotation MAXSCALE 2000 MINSCALE 100 LABELITEM 'EMV_LAND' LABELCACHE ON CLASS COLOR -1 -1 -1 LABEL POSITION UC TYPE TRUETYPE FONT vera_sans MAXSIZE 7 SIZE 7 OFFSET 0 10 MINSIZE 4 #ANTIALIAS TRUE COLOR 0 0 0 OUTLINECOLOR 255 255 128 BUFFER 2 END END END # Maple Grove Parcels ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Labeling
Yea I can do that but then I have to build processes to do all the converting... I want to read this data live. Anyone else have any ideas? Thanks One Last thought, don't know if I should enter a new topic... I have three labels I want to label. Right now I am using an Offset to push one above, and one below (UC, CC, LC) with offsets. And as such these are three separate layers in my app I tried to combine all three into one map file but it only labels the first one (I copied the original code in the original email and simply changed the label field)(no matter what I do it just labels the first one it reads) Can I combine these into one and still have them label on three different rows Value 1 Value 2 Value 3 Can I concatenate like this? LABELITEM 'Value 1' 'VALUE 2' 'VALUE 3' But how would I specify they are supposed to create 3 lines??? THANKS From: Fawcett, David [mailto:david.fawc...@state.mn.us] Sent: Thursday, March 26, 2009 9:38 AM To: Jay Kapalczynski; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] Labeling It is always an option to create a string column and then populate it with your numbers formatted the way that you want them to appear. I am sure that you realize this, but it is something that I have done in the past. David. -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jay Kapalczynski Sent: Thursday, March 26, 2009 9:14 AM To: 'mapserver-users@lists.osgeo.org' Subject: [mapserver-users] Labeling Is there any way to eliminate the decimal places here...I looked online but was unable to find anything. Thanks The fields I am labeling are numeric...so I get this 3434. 123. I am looking to drop all the extra decimal places... Or maybe set it to keep two 3434.00 THANKS LAYER # Maple Grove Parcels NAME Parcel_Labels DATA './parcels.shp' STATUS DEFAULT TYPE annotation MAXSCALE 2000 MINSCALE 100 LABELITEM 'EMV_LAND' LABELCACHE ON CLASS COLOR -1 -1 -1 LABEL POSITION UC TYPE TRUETYPE FONT vera_sans MAXSIZE 7 SIZE 7 OFFSET 0 10 MINSIZE 4 #ANTIALIAS TRUE COLOR 0 0 0 OUTLINECOLOR 255 255 128 BUFFER 2 END END END # Maple Grove Parcels ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Labeling
The decimal truncation simply can't be done with a shapefile at the moment. There's a ticket in place to add this functionality but it will be a 6.0 improvement. Wish I have better news. One the other question you can use the class TEXT property along with a wrap character to achieve the multiline labels. E.g.: CLASS ... TEXT [col1]|[col2]|[col3] LABEL ... WRAP | END END and that should get you a multi-line label based on 3 attributes. Steve On 3/26/2009 at 10:57 AM, in message d7a5eac385604446ab1dd24bf4f5a9181e06947...@mg-mail.ci.maple-grove.mn.us, Jay Kapalczynski jkapalczyn...@ci.maple-grove.mn.us wrote: Yea I can do that but then I have to build processes to do all the converting... I want to read this data live. Anyone else have any ideas? Thanks One Last thought, don't know if I should enter a new topic... I have three labels I want to label. Right now I am using an Offset to push one above, and one below (UC, CC, LC) with offsets. And as such these are three separate layers in my app I tried to combine all three into one map file but it only labels the first one (I copied the original code in the original email and simply changed the label field)(no matter what I do it just labels the first one it reads) Can I combine these into one and still have them label on three different rows Value 1 Value 2 Value 3 Can I concatenate like this? LABELITEM 'Value 1' 'VALUE 2' 'VALUE 3' But how would I specify they are supposed to create 3 lines??? THANKS From: Fawcett, David [mailto:david.fawc...@state.mn.us] Sent: Thursday, March 26, 2009 9:38 AM To: Jay Kapalczynski; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] Labeling It is always an option to create a string column and then populate it with your numbers formatted the way that you want them to appear. I am sure that you realize this, but it is something that I have done in the past. David. -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jay Kapalczynski Sent: Thursday, March 26, 2009 9:14 AM To: 'mapserver-users@lists.osgeo.org' Subject: [mapserver-users] Labeling Is there any way to eliminate the decimal places here...I looked online but was unable to find anything. Thanks The fields I am labeling are numeric...so I get this 3434. 123. I am looking to drop all the extra decimal places... Or maybe set it to keep two 3434.00 THANKS LAYER # Maple Grove Parcels NAME Parcel_Labels DATA './parcels.shp' STATUS DEFAULT TYPE annotation MAXSCALE 2000 MINSCALE 100 LABELITEM 'EMV_LAND' LABELCACHE ON CLASS COLOR -1 -1 -1 LABEL POSITION UC TYPE TRUETYPE FONT vera_sans MAXSIZE 7 SIZE 7 OFFSET 0 10 MINSIZE 4 #ANTIALIAS TRUE COLOR 0 0 0 OUTLINECOLOR 255 255 128 BUFFER 2 END END END # Maple Grove Parcels ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] Labeling
Thank you all for your help... No worries on the decimal truncationwill patiently wait for the 6.0 releasein the mean time I have just updated the test data to a string (text) As for the multi-lineThank you Steve and Mark Volz for your thoughts... They are working although it seems to indent the 2nd and 3rd line...I posted this on the other email sent by Mark Volz Any thoughts -Original Message- From: Steve Lime [mailto:steve.l...@dnr.state.mn.us] Sent: Thursday, March 26, 2009 11:46 AM To: Jay Kapalczynski; mapserver-users@lists.osgeo.org; David' 'Fawcett Subject: RE: [mapserver-users] Labeling The decimal truncation simply can't be done with a shapefile at the moment. There's a ticket in place to add this functionality but it will be a 6.0 improvement. Wish I have better news. One the other question you can use the class TEXT property along with a wrap character to achieve the multiline labels. E.g.: CLASS ... TEXT [col1]|[col2]|[col3] LABEL ... WRAP | END END and that should get you a multi-line label based on 3 attributes. Steve On 3/26/2009 at 10:57 AM, in message d7a5eac385604446ab1dd24bf4f5a9181e06947...@mg-mail.ci.maple-grove.mn.us, Jay Kapalczynski jkapalczyn...@ci.maple-grove.mn.us wrote: Yea I can do that but then I have to build processes to do all the converting... I want to read this data live. Anyone else have any ideas? Thanks One Last thought, don't know if I should enter a new topic... I have three labels I want to label. Right now I am using an Offset to push one above, and one below (UC, CC, LC) with offsets. And as such these are three separate layers in my app I tried to combine all three into one map file but it only labels the first one (I copied the original code in the original email and simply changed the label field)(no matter what I do it just labels the first one it reads) Can I combine these into one and still have them label on three different rows Value 1 Value 2 Value 3 Can I concatenate like this? LABELITEM 'Value 1' 'VALUE 2' 'VALUE 3' But how would I specify they are supposed to create 3 lines??? THANKS From: Fawcett, David [mailto:david.fawc...@state.mn.us] Sent: Thursday, March 26, 2009 9:38 AM To: Jay Kapalczynski; mapserver-users@lists.osgeo.org Subject: RE: [mapserver-users] Labeling It is always an option to create a string column and then populate it with your numbers formatted the way that you want them to appear. I am sure that you realize this, but it is something that I have done in the past. David. -Original Message- From: mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Jay Kapalczynski Sent: Thursday, March 26, 2009 9:14 AM To: 'mapserver-users@lists.osgeo.org' Subject: [mapserver-users] Labeling Is there any way to eliminate the decimal places here...I looked online but was unable to find anything. Thanks The fields I am labeling are numeric...so I get this 3434. 123. I am looking to drop all the extra decimal places... Or maybe set it to keep two 3434.00 THANKS LAYER # Maple Grove Parcels NAME Parcel_Labels DATA './parcels.shp' STATUS DEFAULT TYPE annotation MAXSCALE 2000 MINSCALE 100 LABELITEM 'EMV_LAND' LABELCACHE ON CLASS COLOR -1 -1 -1 LABEL POSITION UC TYPE TRUETYPE FONT vera_sans MAXSIZE 7 SIZE 7 OFFSET 0 10 MINSIZE 4 #ANTIALIAS TRUE COLOR 0 0 0 OUTLINECOLOR 255 255 128 BUFFER 2 END END END # Maple Grove Parcels ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users