[OpenMap Users] RE: OMLine or OMPoly with segments

From: P T <tprakashreddy_at_hotmail.com>
Date: Wed, 14 Nov 2007 23:28:52 +0000

 
Hi All,
 
I came up with the following two methods to draw N number of arcs given start point, end point, and arc angle. Can you let me know, if this is reasonable way to approach this problem or is there a simpler procedure.
 
Problem: Get N number of equal length arcs given start point, end point and arc angle between these two points.
 
Approach 1:
      a) project lat, lon coordinates of start and end points into xy space using the forward method in projection class.
b) Create an ArcCalc object from the given arc angle
c) Generate the points for the curved line using generate method of ArcCalc.
d) Get the array of x and y points from the ArcCalc
e) Inverse the x and y into lat, lon coordinates
f) Draw OMLines based on these inverted points
 
Questions:
a) What if the number of points generated is less than the number of required arcs?
b) If there are more points than the required number of arcs, skipping some points generate a choppy curve. Also this may not generate equal length arcs.
 
Code Snippet:
            [additional code deleted]
Point p1 = this.projection.forward(x1, y1);
            Point p2 = this.projection.forward(x2, y2);
            arcAngle.generate(p1.x,p1.y,p2.x,p2.y);
            int[] xPts = arcAngle.getXPoints();
            int[] yPts = arcAngle.getYPoints();
            [additional code deleted]
 
 -------------------------------------------------------
 
Approach 2:
a) Convert the lat/lon from degrees to radians
b) Compue the points on the Great Circle using GreatCircle.great_circle(x1,y1,x2,y2,N,true)
c) Draw OMLine based on the points.
 
Questions:
a) How do we use the arc angle in this case?
b) The OMLines go through the date line (e.g. if I use New York and Tokyo as starting and ending points, the arcs go from New York to some point near Alaska and then to Tokyo instead of direct curve from New York to Tokyo)
 
Your help is highly appreciated!
Prakash





 Hi,I can draw an arc between two points using OMLine with starting and ending lat/lons and ArcCalc. However, I want to segment this arc into several arcs so that I can manipulate these individual segments (e.g. change color, add arrow etc). I can use OMPoly but looks like it requires knowledge of lat/lons for intermediate points. How can I draw an arc with multiple segments by specifying the end points and overall line arc angle only (not individual segments arc angles)?Thanks in advance!Prakash

Climb to the top of the charts! Play Star Shuffle: the word scramble challenge with star power. Play Now!
_________________________________________________________________
Climb to the top of the charts!  Play Star Shuffle:  the word scramble challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Nov 14 2007 - 18:47:19 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:08 EDT