Version 3.217 available.

Grzegorz Myrda mapadm at polsl.gliwice.pl
Fri Jun 11 04:48:18 EDT 1999


Date sent:      	Thu, 10 Jun 1999 15:57:32 -0500
From:           	"Stephen Lime" <steve.lime at dnr.state.mn.us>
To:             	<bfraser at digitalscience.com>
Copies to:      	<mapserver-users at lists.gis.umn.edu>
Subject:        	Re: Version 3.217 available.

> >>> "Brent Fraser" <bfraser at digitalscience.com> 06/10 3:18 PM >>>
> >>>"Stephen Lime" <steve.lime at dnr.state.mn.us>
Hi,

There is quite easy way to add rotated label for every individual 
LINE shape.
I used your "Find Middle" procedure Steve, you are calculating the 
angle there :), added two lines and "Find Angle" is ready.

------------------------------
  /*
  ** point we want lies between point i and i-1
  */  
  if (p[i].y==p[i-1].y)
	  return(0);
  theta = asin(ms_abs(p[i].x - p[i-1].x)/sqrt((pow((p[i].x - p[i-1].x),2) 
+ pow((p[i].y - p[i-1].y),2))));

  if ( ((p[i].y < p[i-1].y) && (p[i].x < p[i-1].x)) || ((p[i].y > p[i-1].y) && 
(p[i].x > p[i-1].x))  )
	  theta = theta + 2*PI;
  return(ms_abs(theta - PI/2));
------------------------------

As a point of placement may be used CR label position (eventually 
with "advance_x" in gdttf set to negative value of half string length).

Grzegorz





More information about the mapserver-users mailing list