<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Bob,<br>
<br>
I take it you mean making the transformed geometry persistent to
minimize the performance hit? You can do that now by creating
additional layers with your favorite GUI or command line tools. My
buffered geometry is for visualization only (so far?) so the buffer
distance is in pixels (or text points). I want the thick line
rendered inside the polygon to be 5 pixels wide regardless of the
zoom level, or I want the stream label to be placed [approximately]
4 pixels above the stream regardless of the view scale.<br>
<br>
On the other hand, Steve Lime had mused about having LAYER-level
transformed geometry so it could be used in queries. It kind of
boggles the mind (well, mine anyway). Would it be possible to
select features by attribute (where name='my stream') from one,
buffer it (my_buffer=buffer(shape, 500m)), and use the resulting
geometry to select from another layer (where
building_type="residential' and within(my_buffer))?<br>
<br>
Oh wait, "Mapserver is not a full-featured GIS"...<br>
<pre class="moz-signature" cols="72">Best Regards,
Brent Fraser</pre>
<br>
On 6/7/2011 8:21 AM, Bob Basques wrote:
<blockquote cite="mid:4DEDEDB5020000A80002AD45@heckle" type="cite">
<p style="margin-top: 0pt; margin-bottom: 0pt;"> <font
face="Comic Sans MS" size="3">All,</font> </p>
<br>
<p style="margin-top: 0pt; margin-bottom: 0pt;"> <font
face="Comic Sans MS" size="3">I've been following this thread
with interest.</font> </p>
<br>
<p style="margin-top: 0pt; margin-bottom: 0pt;"> <font
face="Comic Sans MS" size="3">Was wondering, does it make any
sense to consider building out an entirely new geometry set
that is based on the original geometry. On the surface this
seems like overkill, but I wonder if treating this situation
as an indexing sort of problem might not help. The buffered
result geometries could easily become more complex than the
original geometries for example, and having them as a
separated group may be beneficial to performance tuning, etc.</font>
</p>
<br>
<p style="margin-top: 0pt; margin-bottom: 0pt;"> <font
face="Comic Sans MS" size="3">Might this be a new commandline
tool for building these extras into a dataset (similar to
making IDX files?). I could think of a few uses of this type
of thing for highlighting, etc. Although, now that I've
thought about it even more, the idea of being able to change
these things on the fly makes the whole conversation go round
back to the beginning again. :c). Making the buffering
dynamic has it's advantages as well for example.</font> </p>
<br>
<p style="margin-top: 0pt; margin-bottom: 0pt;"> <font
face="Comic Sans MS" size="3">bobb</font> </p>
<br>
<br>
<br>
<p style="margin-top: 0pt; margin-bottom: 0pt;"> <br>
<br>
>>> Brent Fraser <a class="moz-txt-link-rfc2396E" href="mailto:bfraser@geoanalytic.com"><bfraser@geoanalytic.com></a> wrote:<br>
</p>
<table style="margin: 0pt 0pt 0pt 15px; font-size: 1em;"
bgcolor="#f3f3f3" border="0">
<tbody>
<tr>
<td>
<div style="border-left: 1px solid rgb(5, 5, 5);
padding-left: 7px;">
<p style="margin-top: 0pt; margin-bottom: 0pt;"> Thomas,<br>
<br>
Yes, I've been trying to come up with good map file
syntax to<br>
indicate labeling of the transformed geometry.
Currently mapserver allows:<br>
- transformed original geometry (buffer, difference)<br>
- augmented original geometry (bbox, start/end,
vertices)<br>
- rendered label geometry (labelpoint, labelpoly)<br>
<br>
but it doesn't label transformed geometry, only
original geometry. The<br>
main problem (from a user interface perspective) is
how to relate<br>
transformed geometry to the label specification.<br>
<br>
One solution is to allow a LABEL object within a STYLE
object:<br>
<br>
CLASS<br>
NAME 'Streams'<br>
STYLE<br>
GEOMTRANSFORM (buffer([shape], 5))<br>
<br>
LABEL<br>
usual label settings<br>
END # Label<br>
END # Style<br>
<br>
but that's a little strange as STYLE objects are
currently allowed<br>
within LABEL objects.<br>
<br>
Another solution is to have "named" geometry and
reference it in the<br>
LABEL object (and keep the existing CLASS/STYLE/LABEL
structure):<br>
<br>
CLASS<br>
NAME 'Streams'<br>
STYLE<br>
GEOMTRANSFORM my_label_shape =
(buffer([shape], 5))<br>
END # Style<br>
<br>
LABEL<br>
usual label settings<br>
GEOMETRY my_label_shape<br>
END # Label<br>
<br>
And I'm sure there are other (and hopefully better)
solutions.<br>
<br>
Best Regards,<br>
Brent Fraser<br>
<br>
<br>
On 6/6/2011 11:02 AM, thomas bonfort wrote:<br>
> Yes, the resulting shape seems like a nice
candidate for offseting<br>
> labels, but the problem with buffer is you will
have more difficulty<br>
> in deciding what is to the left from what is to
the right of the line.<br>
> We'd also have to make sure that the buffer
operation is not too<br>
> costly on cpu cycles.<br>
> Anyways, until geomtransform is not applied at
the layer level, there<br>
> is no way to use this method as the label does
not operate on the<br>
> transformed geometry.<br>
><br>
> On Mon, Jun 6, 2011 at 17:30, Brent
Fraser<a class="moz-txt-link-rfc2396E" href="mailto:bfraser@geoanalytic.com"><bfraser@geoanalytic.com></a> wrote:<br>
>> Steve,<br>
>><br>
>> I think just buffering the line would apply
a type of smoothing (see<br>
>> attached image). Using the resulting buffer
line (or perhaps doing some<br>
>> simple line smoothing on it) for labeling
would be good enough.<br>
>><br>
>> Best Regards,<br>
>> Brent Fraser<br>
>><br>
>><br>
>> On 6/6/2011 9:04 AM, Stephen Woodbridge
wrote:<br>
>>> Duh! you are correct, I always forget
this point until I after my second<br>
>>> cup of coffee has kicked in :)<br>
>>><br>
>>> That article looks very interesting, I
have to read up on that.<br>
>>><br>
>>> In a past career in computer aided design
and manufacturing, we used the<br>
>>> idea of a rolling ball offset because it
modeled a milling machine. The<br>
>>> rolling ball offset is defined as the
curve traced by the center of a ball<br>
>>> of a given radius as you roll it along a
curve. The circumference of the<br>
>>> ball can not cross over the original
curve so for tight "S" curves if the<br>
>>> diameter of the ball is larger than the
gap in the "S" then the ball does<br>
>>> not enter the gap but floats over it.
This same concept would make for well<br>
>>> behaved and good looking labels along
tight twisty paths like rivers and<br>
>>> roads.<br>
>>><br>
>>> Another idea for smoothing out curves for
labeling might be to apply an N<br>
>>> point moving average and allow that to be
the label path. I don't think this<br>
>>> has been mentioned as an option in the
past.<br>
>>><br>
>>> -Steve W<br>
>>><br>
>>> On 6/6/2011 10:20 AM, thomas bonfort
wrote:<br>
>>>> There are two problems with the
solution you propose:<br>
>>>> - if you offset the geometry in
postgis, the distance of the offset<br>
>>>> will be in geographical units, i.e.
it will not give correct results<br>
>>>> at all scales when rendered with
mapserver (what you basically want is<br>
>>>> to offset the line by a number of
pixels roughly equal to the size of<br>
>>>> the font used for labelling)<br>
>>>> - angle follow on offset line should
probably be done on a<br>
>>>> simplified/smoothed geometry. see<br>
>>>> <a moz-do-not-send="true"
href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.24.6970">http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.24.6970</a> .<br>
>>>> Ideally someone will want the feature
badly enough to fund it :)<br>
>>>><br>
>>>> --<br>
>>>> thomas<br>
>>>><br>
>>>><br>
>>>><br>
>>>> On Mon, Jun 6, 2011 at 16:02, Stephen
Woodbridge<br>
>>>> <a class="moz-txt-link-rfc2396E" href="mailto:woodbri@swoodbridge.com"><woodbri@swoodbridge.com></a>
wrote:<br>
>>>>> There was some recent discussion
on the dev list about potentially using<br>
>>>>> the<br>
>>>>> GEOMTRANSFORM to do something
like a single sided offset then using that<br>
>>>>> to<br>
>>>>> apply the label to. BUT I do not
think that has been implemented yet in<br>
>>>>> mapserver.<br>
>>>>><br>
>>>>> Google for "mapserver
geomtransform" also look at "geoprocessing" for<br>
>>>>> some<br>
>>>>> other ideas.<br>
>>>>><br>
>>>>> Anyway, you might be able to do
what you want if you:<br>
>>>>><br>
>>>>> 1. import your data into PostGIS<br>
>>>>> 2. create offset geometry in
another table<br>
>>>>> 3. export that table to a
shapefile<br>
>>>>> 4. then label that as an
annotation layer so you do not draw the<br>
>>>>> geometry<br>
>>>>> only the label and use the
original data to draw the grometry ie: two<br>
>>>>> layers.<br>
>>>>><br>
>>>>> I have not tried this, but it
might solve your problem.<br>
>>>>><br>
>>>>> -Steve W<br>
>>>>><br>
>>>>> On 6/6/2011 9:48 AM, uvg wrote:<br>
>>>>>> Thank you, Thomas.<br>
>>>>>> Are there any workarounds for
this problem?<br>
>>>>>> Is there 'best practices' for
the problem?<br>
>>>>>> Maybe unvisible layer or
other?<br>
>>>>>> 06.06.2011, 17:35, "thomas
bonfort [via OSGeo.org]"<[hidden email]<br>
>>>>>>
</user/SendEmail.jtp?type=node&node=6445194&i=0>>:<br>
>>>>>><br>
>>>>>> The status has not
changed: label follow with offset is not<br>
>>>>>> supported.<br>
>>>>>><br>
>>>>>> regards,<br>
>>>>>> thomas<br>
>>>>>><br>
>>>>>> On Mon, Jun 6, 2011 at
15:33, uvg<[hidden email]> wrote:<br>
>>>>>><br>
>>>>>>> Hi all!<br>
>>>>>>> Sorry for my bad
English.<br>
>>>>>>><br>
>>>>>>> I am trying to achieve
is a label that follows the rivers that is<br>
>>>>>> also<br>
>>>>>>> OFFSET so that<br>
>>>>>>> the label does not
'above' on the line for the river.<br>
>>>>>>><br>
>>>>>>> Sample code of mapfile:<br>
>>>>>>><br>
>>>>>>> LABEL<br>
>>>>>>> COLOR 0 40 255<br>
>>>>>>> FONT "arial-italic"<br>
>>>>>>> TYPE truetype<br>
>>>>>>> SIZE 7<br>
>>>>>>> OFFSET 5 0<br>
>>>>>>> ANGLE FOLLOW<br>
>>>>>>> POSITION LC<br>
>>>>>>> FORCE true<br>
>>>>>>> PARTIALS FALSE<br>
>>>>>>><br>
>>>>>>> END<br>
>>>>>>><br>
>>>>>>> "OFFSET" does not work.<br>
>>>>>>> How can I offset a
label?<br>
>>>>>>><br>
>>>>>>> I found a message
posted for a long time:<br>
>>>>>>> click here.<br>
>>>>>><br>
>>>>>> View this message in context:
Re: ANGLE FOLLOW and Label Offset (v.<br>
>>>>>> 5.6.6)<br>
>>>>>><br>
>>>>>><br>
>>>>>> <<a moz-do-not-send="true"
href="http://osgeo-org.1803224.n2.nabble.com/ANGLE-FOLLOW-and-Label-Offset-v-5-6-6-tp6445138p6445194.html">http://osgeo-org.1803224.n2.nabble.com/ANGLE-FOLLOW-and-Label-Offset-v-5-6-6-tp6445138p6445194.html</a>><br>
>>>>>> Sent from the Mapserver -
User mailing list archive<br>
>>>>>> <<a moz-do-not-send="true"
href="http://osgeo-org.1803224.n2.nabble.com/Mapserver-User-f1969211.html">http://osgeo-org.1803224.n2.nabble.com/Mapserver-User-f1969211.html</a>><br>
>>>>>> at<br>
>>>>>> Nabble.com.<br>
>>>>>><br>
>>>>>><br>
>>>>>><br>
>>>>>>
_______________________________________________<br>
>>>>>> mapserver-users mailing list<br>
>>>>>>
<a class="moz-txt-link-abbreviated" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
>>>>>> <a moz-do-not-send="true"
href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
>>>>>
_______________________________________________<br>
>>>>> mapserver-users mailing list<br>
>>>>> <a class="moz-txt-link-abbreviated" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
>>>>> <a moz-do-not-send="true"
href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
>>>>><br>
>>>
_______________________________________________<br>
>>> mapserver-users mailing list<br>
>>> <a class="moz-txt-link-abbreviated" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
>>> <a moz-do-not-send="true"
href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
>>><br>
>>
_______________________________________________<br>
>> mapserver-users mailing list<br>
>> <a class="moz-txt-link-abbreviated" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
>> <a moz-do-not-send="true"
href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
>><br>
>><br>
<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a class="moz-txt-link-abbreviated" href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a moz-do-not-send="true"
href="http://lists.osgeo.org/mailman/listinfo/mapserver-users">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
</p>
</div>
</td>
</tr>
</tbody>
</table>
</blockquote>
</body>
</html>