With a point layer, you can fix this using the offset trick I
referred to in my earlier post:

The following works for me using Mapserver 6 (the arrow head is
centred at the point, but you can shift it using the same
technique as shown for the arrow line)

   SYMBOL
     NAME "up"
     TYPE vector
     POINTS
       0  10
       5  0
       10 10
     END
   END

   SYMBOL
     NAME "vert-line"
     TYPE vector
     POINTS
       0 5
       0 10
     END
   END

   ...
     CLASS
       STYLE
         SYMBOL "vert-line"
         ANGLE [az]
         SIZE [rate]
         COLOR 0 0 0
         WIDTH 1
       END # STYLE
       STYLE
         SYMBOL "up"
         ANGLE [az]
         SIZE 5
         WIDTH 2
         COLOR 0 0 0
       END # STYLE
     END # CLASS

In my opinion, the best thing would be to be able to specify
the "centre/origin" of the point explicitly, as suggested in
RFC45.  But this part of the RFC has not yet been implemented.

Håvard


On 9/27/2011 4:48 PM, Puneet Kishor wrote:

On Sep 27, 2011, at 2:18 AM, Havard Tveite wrote:

Have you seen:

http://mapserver.org/mapfile/symbology/construction.html#changing-the-center-of-a-point-symbol


Yup, seen and read it from end to end until my eyes glazed. Perhaps it is clear 
as crystal to the rest of the world, but I can't fathom anything there 
applicable to me. I am facing four problems --

1. As I mentioned below, per the docs, I am supposed to be able to declare "ANGLE AUTO" 
in my STYLE definition. That simply does not work for me. I *have* to declare the angle the same as 
the angle of the stem of the arrow "ANGLE [az]" in order to get arrow heads headed in the 
same direction as the arrow stems.

2. From the docs on GEOMTRANSFORM, "end: produces the last point of the geometry. 
When used with ANGLE AUTO, it can for instance be used to render an arrowhead." 
Well, no... it is *not* producing the *last point of the geometry* as I understand it. 
Instead, it is producing the middle point of the geometry. And it sure as as I can see is 
not working with ANGLE AUTO (see #1 above).

3. I have tried several variations on my arrow head to try shift its center, 
but I am failing to translate the information in the above document to be able 
to do it correctly.

4. Perhaps most important: the length of the arrow is varying based on [rate]. In other 
words, I want only the stem to be shorter or longer, but the arrow head to be the same 
size, and to be at the "end" of the stem always. In fact, there are instances 
in which [rate] could be equal to zero. In those instances I don't want any arrow to be 
drawn at all.

*** In other words, I want an arrow stem to be as long as the varying [rate], 
and if the stem has a length greater than zero then and only then do I want an 
arrow head at the end of the stem pointing in the same direction as the stem. 
***

I even tried using a truetype font symbol, but I get no image at all but no 
error as well.

I even tried using a SYMBOL of TYPE pixmap pointing to an image of an arrow. I 
realize that if I could make that work, it would still be unsatisfactory 
because as MapServer would scale my arrow image, it would make the attached 
arrow head also larger, and that would look ugly. In any case, I couldn't get 
that to work as well... no image at all, but no error as well.

Could be my compilation of MapServer was buggy, but I didn't see any 
compilation time errors, and other than the above oddities, it works quite well.

$./mapserv -v
MapServer version 6.0.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ 
SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER 
SUPPORTS=WMS_CLIENT SUPPORTS=GEOS INPUT=POSTGIS INPUT=GDAL INPUT=SHAPEFILE

I would love to know if my *** objective *** above can be accomplished with 
MapServer. If not, I would look at other workaround. I am currently rendering 
arrows using OpenLayers vector layer... it works quite well, but is slow... 
MapServer is much faster, and could be cached, hence my desire to use MapServer.

Thanks.



Håvard Tveite

On 9/27/2011 4:12 AM, Puneet Kishor wrote:
My arrows look like so -->-- instead of ---->   with declarations like so

     SYMBOL
         NAME "vert-line"
         TYPE vector
         POINTS
             0 1
             0 0
         END
     END

      SYMBOL
         NAME "up"
         TYPE vector
         POINTS
             0 1
             0.5 0
             1 1
         END
     END

     CLASS
         STYLE
             SYMBOL 'vert-line'
             ANGLE [az]
             SIZE [rate]
             COLOR 0 0 0
             WIDTH 1
         END
         STYLE
             SYMBOL "up"
             ANGLE [az]
             SIZE 5
             GEOMTRANSFORM "end"
             COLOR 0 0 0
         END
     END

But, at least the arrow heads are aligned correctly. Because, if I use "ANGLE auto" as 
prescribed in the docs instead of "ANGLE [az]" as shown above, my arrows draw like so 
--^--. The heads are always pointed up, and are in the middle.

Suggestions?



--
Håvard Tveite
Department of Mathematical Sciences and Technology, UMB
Drøbakveien 31, POBox 5003, N-1432 Ås, NORWAY
Phone: +47 64965483 Fax: +47 64965401 http://www.umb.no/imt/
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to