[mapserver-users] symbology showing line direction

Rodrigo Martín LÓPEZ GREGORIO rodrigomartin at lopezgregorio.com.ar
Fri Feb 29 07:53:25 PST 2008


Hi.

I'm not sure if I understand what you are trying to do, but if I'm right you
need to draw a > symbol over your lines in the direction of the line. If
this is what you want you must define a SYMBOL and set it to your line. The
trick to get the symbol drawed along line direction is to set the symbol GAP
with a negative value. By example:

SYMBOL
  NAME "arrow"
  TYPE truetype
  FONT arialbd
 * CHARACTER '»'*
  FILLED true
  ANTIALIAS true
  *GAP -100*
END

where the -100 value represents that CHARACTER must be drawed in the
direction of the line (the minus) and CHARACTER must be drawed with a GAP of
100 map units between each other (In my case, my map unit is meters, so
there will not be two > symbols for the same line in a radius of 100
meters).

Then you must use this symbol in your line layer definition as SYMBOL for
your CLASS element. Something like:

LAYER
....................
      STYLE
        ANTIALIAS TRUE
        COLOR 255 255 255
        OUTLINECOLOR 0 0 0
        *SYMBOL "arrow"*
        SIZE 15
      END
.....................
END

I hope it works for you. Sorry my english.

Rodrigo.

On Fri, Feb 29, 2008 at 3:06 PM, Adam Feidt <afeidt at edenprairie.org> wrote:

> I was hoping it could read ESRI's From and To node structure much like
> ArcMap, but by the sounds of it that isn't possible. Shapefile geometry
> is saved in the Shape column, which I'm guessing is useless in
> Mapserver.  What you're saying is I need to create an attribute and
> populate it with the angle of the line and use that to define my label
> direction?
>
> Adam M. Feidt
> GIS Coordinator
> City of Eden Prairie
> 8080 Mitchell Rd
> Eden Prairie, MN 55344
> phone# 952-949-8443
> fax# 952-949-8334
>
>
> -----Original Message-----
> From: G. Allegri [mailto:giohappy at gmail.com]
> Sent: Friday, February 29, 2008 8:57 AM
> To: Adam Feidt
> Cc: Fawcett, David; mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] symbology showing line direction
>
> A question: how can you derive a line direction by a shp without
> having an appropriate attribute?
>
> Giovanni
>
> 2008/2/29, Adam Feidt <afeidt at edenprairie.org>:
> >
> >
> >
> >
> > David,
> >
> >      Below is my Layer definition.  I've tried a truetype symbol and
> label
> > with the ANGLE parameter set to AUTO or FOLLOW.  Neither case pointed
> out
> > actual shapefile line direction.  I'm reading an ESRI shapefile so
> there is
> > no specific column for line direction.
> >
> >
> >
> > LAYER
> >
> >             NAME 'Utilities Sanitary Lines'
> >
> >             DATA './UtilitiesSanitaryLines.shp'
> >
> >             TYPE LINE
> >
> >             STATUS DEFAULT
> >
> >             CLASSITEM "Function"
> >
> >             CLASS
> >
> >                   NAME 'Main'
> >
> >                   EXPRESSION ""
> >
> >                   STYLE
> >
> >                     COLOR 85 255 0
> >
> >                     SYMBOL "plainline"
> >
> >                     SIZE 2
> >
> >                   END
> >
> >             END # end class
> >
> >             CLASS
> >
> >                   NAME 'Low Pressure'
> >
> >                   EXPRESSION "Low Pressure"
> >
> >                   STYLE
> >
> >                     COLOR 255 85 0
> >
> >                     SYMBOL "plainline"
> >
> >                     SIZE 2
> >
> >                   END
> >
> >             END # end class
> >
> >             CLASS
> >
> >                   NAME 'Sub Trunk'
> >
> >                   EXPRESSION "Sub Trunk"
> >
> >                   STYLE
> >
> >                     COLOR 85 255 0
> >
> >                     SYMBOL "plainline"
> >
> >                     SIZE 2
> >
> >                   END
> >
> >             END # end class
> >
> >             CLASS
> >
> >                   NAME 'Trunk'
> >
> >                   EXPRESSION "Trunk"
> >
> >                   STYLE
> >
> >                     COLOR 112 168 0
> >
> >                     SYMBOL "plainline"
> >
> >                     SIZE 2
> >
> >                   END
> >
> >             END # end class
> >
> >             CLASS
> >
> >                   NAME 'Force Main'
> >
> >                   EXPRESSION "forcemain"
> >
> >                   STYLE
> >
> >                     COLOR 255 170 0
> >
> >                     SYMBOL 'dashed1'
> >
> >                     SIZE 2
> >
> >                   END
> >
> >             END # end class
> >
> >             CLASS
> >
> >                   NAME 'Private'
> >
> >                   EXPRESSION "private"
> >
> >                   STYLE
> >
> >                     COLOR 161 33 240
> >
> >                     SYMBOL 'plainline'
> >
> >                     SIZE 2
> >
> >                   END
> >
> >             END # end class
> >
> >       END #end layer
> >
> >
> >
> >
> >
> >
> > Adam M. Feidt
> >
> > GIS Coordinator
> >
> > City of Eden Prairie
> >
> > 8080 Mitchell Rd
> >
> > Eden Prairie, MN 55344
> >
> > phone# 952-949-8443
> >
> > fax# 952-949-8334
> >
> >
> >
> >
> >
> > From: Fawcett, David [mailto:David.Fawcett at state.mn.us]
> >  Sent: Friday, February 29, 2008 8:19 AM
> >  To: Adam Feidt; mapserver-users at lists.osgeo.org
> >  Subject: RE: [mapserver-users] symbology showing line direction
> >
> >
> >
> >
> >
> > Adam,
> >
> >
> >
> >
> >
> > What does your layer definition, with the classes look like?
> >
> >
> >
> >
> >
> > Does your data have the direction column properly populated for all
> records?
> >
> >
> >
> >
> >
> >
> > David.
> >
> >
> > -----Original Message-----
> >  From: mapserver-users-bounces at lists.osgeo.org
> > [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf
> > Of Adam Feidt
> >  Sent: Friday, February 29, 2008 8:14 AM
> >  To: mapserver-users at lists.osgeo.org
> >  Subject: [mapserver-users] symbology showing line direction
> >
> >       I'm working in a GeoMoose application and trying to display
> utility
> > lines with the correct line direction via some arrow character or
> symbol.
> > I've had no luck so far.  I've successfully labeled my lines with a
> truetype
> > font character by defining the TEXT ">" parameter in the CLASS object.
> I've
> > also tried a pixelmap symbol definition using a .gif file.  Both
> appear to
> > work at first, but when you compare it to the actual line direction it
> isn't
> > true in all cases.  Has anybody found a way to accomplish this?  I
> would
> > appreciate if you could send me any examples.
> >
> >
> >
> >
> >
> > Adam M. Feidt
> >
> > GIS Coordinator
> >
> > City of Eden Prairie
> >
> > 8080 Mitchell Rd
> >
> > Eden Prairie, MN 55344
> >
> > phone# 952-949-8443
> >
> > fax# 952-949-8334
> >
> >
> > _______________________________________________
> >  mapserver-users mailing list
> >  mapserver-users at lists.osgeo.org
> >  http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
> >
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080229/463d5f9c/attachment.htm>


More information about the MapServer-users mailing list