ArcGIS Desktop – Creating Radial Flow Map with Curved Lines Over Short Distances (20km)

arcgis-10.0arcgis-desktopflow-maporigin-destinationpolyline-creation

Esri have provided instructions on how to make a radial flow map but I think the curved lines will only be produced over a long distance, like half the globe.

For short distances (20km) a geodetic line will probably still look pretty straight. To keep using this process for a radial flow map over short distances, then, I thought we could edit the datum settings so the earth is smaller, hence you'll get a nice curved line for a small distance. Anyone know how to do this?

Alternatively, is there another tool in ArcGIS Desktop 10.0 to use for making curved lines? I have 90 points that I need to connect up to 54 points, would be good to automate it rather than having to draw the lines manually.

Best Answer

Here is an illustration of the workflow I mentioned in the comment above, and although I don't know of any simple pre-canned routine to do this, I have attached an excel spreadsheet that one can import a set of origin-destination coordinates and the sheet then makes a set or circular line coordinates (spreadsheet here). It has formulas set up so it is pretty easy to import new OD coordinates and extend the formulas to fill in the results, but I will go through the logic of the process more explicitly though, and others can give advice how to script it entirely within ArcMap (or whatever).

Briefly, I think this is reasonable for visualizing OD data mainly for the same reason great circle lines are popular, they provide more visual distinction between lines. The approach I suggest also has one advantage over great circle lines, in that the direction of the flow is encoded in the half-circle. In this other answer on the site I give a more general over-view of visualization techniques for flow mapping, and many of those same techniques can be applied in addition to making arcs like this.

So, to detail how one draws lines like I am suggestion, essentially I only have 3 steps for the process, 1) find the orientation of the flow, 2) find the mid-point and the distance of the flow, 3) treat the mid-point as the center of a circle, and then draw the arc (a half-circle from the origin to the destination). To be clear, I am starting with a set pair of projected origin coordinates (x1,y1) and destination coordinates (x2,y2).

So 1) find the orientation of the flow. One first uses the formula ATAN((y2 - y1)/(x2 - x1)) and then depending on the direction assigns an orientation depending on whether the direction is eastward or westward. An example pseudocode below (I assign OD points that are both at the same coordinates an orientation of zero). Here the varaible or_rad is meant to be shorthand for "orientation in radians" and pi refers to the value of pi.

#tan_or = ATAN((y2 - y1)/(x2 - x1)).
Do If x2 = x1 and y1 <= y2. 
    compute or_rad = 0.
Else if x2 = x1 and y1 > y2.
    compute or_rad = pi.
Else if x1 > x2.
    compute or_rad = 270/180*pi - #tan_or.
Else if x1 < x2.
    compute or_rad = 90/180*pi - #tan_or.
End If.

2) Find the mid-point and the distance of the flow. This is very simple, for just one set of paired coordinates the mid-point in (x,y) coordinates will be (x1+x2/2,y1+y2/2). So lets define mid_x = (x1 + x2)/2 and mid_y = (y1 + y2)/2 for the next part. The distance using the pythagoreum theorum is simply distance = SQRT((x1 - x2)^2 + (y1 - y2)^2).

3) Then given that information, draw the circle given over a pre-specified number of degrees and a radius (which is half the distance between the two points). For instance, lets say we start out with a set of OD coordinate pairs at (1,3):(3,2). The orientation in degrees will be ~ 116 (and in radians ~2), the x,y mid-point will be (2,2.5) and the distance between the two points is about 2.2.

So lets say we want to draw the half-circle around 180 degrees. In pseduo-code (using the variables I already defined) the iterations will look something like;

for i in (0 to 180 degrees) 
    rad_i = i/180*pi. /*converts i from degrees to radians
    step_or = pi - rad_i /*for clarity, this makes the circle go from origin to destination
    radius = distance/2
    Arc_X = mid_x + sin(or_rad - step_or)*radius.
    Arc_Y = mid_y + cos(or_rad - step_or)*radius.

Inserted below is a diagram of the original coordinates I specified above. Starting at zero and ending at 180 makes sure the being and end points are at the same locations. Adjusting the loop to have more steps (more detailed arc) or fewer (less detailed arc) should be fairly obvious.

enter image description here

To note, other threads on the site discuss creating lines from point data (see the tag). I have an example in the attached xls spreadsheet, and I utilized the ET Geo-wizards arcmap tool to convert the spreadsheet coordinates to shapefile lines. The arcs in the example data in the attached spreadsheet subsequently looks like this;

enter image description here

One simple but potentially useful update to this current set up would be to update the formulas to allow for a pre-specified amount of eccentricity in arc, although I haven't been quite sure how to do that in my few attempts so far. I look forward to suggestions and feedback from the community here on my advice.

Related Question