AW: [mapserver-users] Errors in trying to angle my labels.

Stephen Woodbridge woodbri at swoodbridge.com
Thu Feb 12 13:13:59 PST 2009


Since you seem to be doing this in postgis, I think the way to do thie 
is something like this:


DATA "the_geom from (select 
(180/3.141592654*atan2((y(endpoint(the_geom))-y(startpoint(the_geom))),
 >> (x(endpoint(the_geom))-x(startpoint(the_geom))))) as angle, 
the_geom, ... from table ...) as foo using ..."

then you can do

    ANGLE [angle]

to use the value as an attribute column.

-Steve W.

Ron M wrote:
> Eichner, Andreas - SID-NLKM wrote:
>> Not sure, but try again without the square brackets. I believe MapServer
>> treats there content as column name. Since you used LABELANGLEITEM
>> successfully the generalized ANGLE should also work...
>> So try
>>
>> ANGLE
>> "(180/3.141592654*atan2((y(endpoint(the_geom))-y(startpoint(the_geom))),
>> (x(endpoint(the_geom))-x(startpoint(the_geom)))))"
> 
> Nope, no such luck.
> 
> The Mapserver 5 migration guide
> http://trac.osgeo.org/mapserver/browser/branches/branch-5-0/mapserver/MIGRATION_GUIDE.TXT
> suggests that I should be using LABEL...ANGLE...END instead of LABELANGLEITEM,
> and the mapserver docs for ANGLE say the square brackets are required.
> 
> But mapserver 5's ANGLE seems less flexible than mapserver 4's LABELANGLEITEM
> in the ability to use complex expressions for the labels.
> 
> Is the best approach to create a view in the database for mapserver that
> makes that expression look like a column?
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list