Hi, Listers!

Here comes the summary I promised... Which in this case is simply the one
and only response I got concerning my problem.
Thank you, Jeff James! We're still working on (A) though, and it will be
some time till we get to (C) finally, but at least it was a bit of a
consolation for us that there isn't an out-of-the-box solution that we
didn't know about.

Here's what Jeff wrote:

The quickest and easiest way would be to take your street layer, copy all
the one way streets into a new temporary(?) layer, and then turn on the line
direction arrows for that new layer.  Downsides to this: you get a small
blue triangular arrow (which you can't change) pointing in the direction in
which the line was drawn (which might not be the same as the street
direction), and you get one arrow per line segment (not one per polyline).

Going beyond that, you're opening up quite a can of worms.  The process as I
see it involves the following:

(A) Determine the angle of the line segment in the polyline at a point
somewhere along its length near the center.  I don't think MapX's polyline
features have the concept of a centroid, so you'll probably have to kludge
something together: measure the length of all the line segments that make it
up, and then mathematically determine which one contains the halfway point,
and then determine the coordinates of that halfway point.  Lots of math.
Lots of fun.

(B) When you find that line segment that contains that centerpoint, you'll
use the arctangent of the difference of the change in Y (latitude) divided
by the change in X (longitude) to get an absolute angle between 0 and 90
(where 0 is horizontal and 90 is vertical).  In pseudocode, it will probably
look like this: Angle = Atn((Y1-Y2)/(X1-X2)).  Determining the exact angle
within a 360 degree circle will entail your adding some number to that (90,
180, or 270) based upon whether or not the X's and Y's of the one endpoint
are less than or greater than the X's and Y's of the other point.  

(C) Finally, once you've got that, you'll need to create a new layer for
dropping your new "one-way" symbols, rotated appropriately.

Needless to say, I don't envy you this task.

There could be other issues -- and there could be a much easier way that I'm
overlooking -- but this is off the top of my head.  Looks good on paper, if
nothing else.

Good luck,
 
Jeff James
Vice President
Sage Software, Inc.
3423 Piedmont Road NE
Suite 550
Atlanta, Georgia 30305
Phone: 404.262.7478 Ext. 12
Fax: 404.832.3366
eFax: 520.222.2020
www.sagesoft.com <http://www.sagesoft.com> 

___________________________________________________________________

-----Original Message-----
From: Niermann, Till, PASSO-TD, NI [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 22, 2000 8:13 AM
To: '[EMAIL PROTECTED]'
Subject: MI MapX: Labelling One Way Streets


Hi, Listers!

Here is one which we really need your help on:

Question:
=>      How do I find the angle of a line at a given point without having to
write a lengthy MapBasic program? (MapX would be OK since we're developing a
C++ application)

Problem:
=>      Putting a "One Way" Symbol on each of the street segments that
represent One Way streets.
=>      Symbol should be placed only once for each street, in or near the
centroid, and in an appropriate angle. Streets are MI lines with 0 to many
vertices, starting and ending in a crossroads, with no crossing in between.

Prerequisites:
=>      We would prefer a solution using SpatialWare / Oracle / MapX (as
opposed to MI Pro / MapBasic).
=>      Coordinates of beginning and end of lines are available in
SpatialWare.
=>      We're dealing with millions of streets, 10% of which are One Way...

Any hints would be greatly appreciated! - Will post a summary.

Till

------------------------------------
Till Niermann
mailto:[EMAIL PROTECTED]
Mannesmann Passo GmbH
Niederkasseler Lohweg 20
D-40547 Duesseldorf
Tel. +49 211 5368 - 648
Fax +49 211 5368 - 334
http://www.passo.de
------------------------------------

----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to