Steve,I think just buffering the line would apply a type of smoothing (see attached image). Using the resulting buffer line (or perhaps doing some simple line smoothing on it) for labeling would be good enough.
Best Regards, Brent Fraser On 6/6/2011 9:04 AM, Stephen Woodbridge wrote:
Duh! you are correct, I always forget this point until I after my second cup of coffee has kicked in :)That article looks very interesting, I have to read up on that.In a past career in computer aided design and manufacturing, we used the idea of a rolling ball offset because it modeled a milling machine. The rolling ball offset is defined as the curve traced by the center of a ball of a given radius as you roll it along a curve. The circumference of the ball can not cross over the original curve so for tight "S" curves if the diameter of the ball is larger than the gap in the "S" then the ball does not enter the gap but floats over it. This same concept would make for well behaved and good looking labels along tight twisty paths like rivers and roads.Another idea for smoothing out curves for labeling might be to apply an N point moving average and allow that to be the label path. I don't think this has been mentioned as an option in the past.-Steve W On 6/6/2011 10:20 AM, thomas bonfort wrote:There are two problems with the solution you propose: - if you offset the geometry in postgis, the distance of the offset will be in geographical units, i.e. it will not give correct results at all scales when rendered with mapserver (what you basically want is to offset the line by a number of pixels roughly equal to the size of the font used for labelling) - angle follow on offset line should probably be done on a simplified/smoothed geometry. see http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.24.6970 . Ideally someone will want the feature badly enough to fund it :) -- thomas On Mon, Jun 6, 2011 at 16:02, Stephen Woodbridge <wood...@swoodbridge.com> wrote:There was some recent discussion on the dev list about potentially using the GEOMTRANSFORM to do something like a single sided offset then using that toapply the label to. BUT I do not think that has been implemented yet in mapserver.Google for "mapserver geomtransform" also look at "geoprocessing" for someother ideas. Anyway, you might be able to do what you want if you: 1. import your data into PostGIS 2. create offset geometry in another table 3. export that table to a shapefile4. then label that as an annotation layer so you do not draw the geometryonly the label and use the original data to draw the grometry ie: two layers. I have not tried this, but it might solve your problem. -Steve W On 6/6/2011 9:48 AM, uvg wrote:Thank you, Thomas. Are there any workarounds for this problem? Is there 'best practices' for the problem? Maybe unvisible layer or other? 06.06.2011, 17:35, "thomas bonfort [via OSGeo.org]"<[hidden email] </user/SendEmail.jtp?type=node&node=6445194&i=0>>:The status has not changed: label follow with offset is not supported.regards, thomas On Mon, Jun 6, 2011 at 15:33, uvg<[hidden email]> wrote: > Hi all! > Sorry for my bad English. > > I am trying to achieve is a label that follows the rivers that is also > OFFSET so that > the label does not 'above' on the line for the river. > > Sample code of mapfile: > > LABEL > COLOR 0 40 255 > FONT "arial-italic" > TYPE truetype > SIZE 7 > OFFSET 5 0 > ANGLE FOLLOW > POSITION LC > FORCE true > PARTIALS FALSE > > END > > "OFFSET" does not work. > How can I offset a label? > > I found a message posted for a long time: > click here. View this message in context: Re: ANGLE FOLLOW and Label Offset (v. 5.6.6)<http://osgeo-org.1803224.n2.nabble.com/ANGLE-FOLLOW-and-Label-Offset-v-5-6-6-tp6445138p6445194.html>Sent from the Mapserver - User mailing list archive<http://osgeo-org.1803224.n2.nabble.com/Mapserver-User-f1969211.html> atNabble.com. _______________________________________________ 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
<<attachment: line_buffer.png>>
_______________________________________________ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users