2

I am trying to create some visualisations using bus journey data. I am looking to plot journeys along one long road, showing passenge journeys. The principle is the same as a radial flow map for flight paths for example. However the geographical area is much smaller as it only covers one road.

This is where I am running into problems. I have the data in StartX,Y and End X,Y format and then with each possible journey I have a total number.

I have tried plotting this as XY to Line using the various different Line Types (e.g. Geodesic). The result is a series of straight lines on top one another. Ideally I would like to produce a series of curved lines so that you can see the different journeys a bit more clearly.

I have tried to research this problem quite extensively online but the majority of cases are plotting data over a much wider geographical area.

Is there a way to produce a curve / arc between a start and end point?

I do not want to do this manually as I have large number of lines to plot.

I would like to use ArcMap.

2
  • I think your question would benefit from the inclusion of a picture that illustrates what you are trying to do.
    – PolyGeo
    Commented Apr 5, 2016 at 22:27
  • This question is similar or could possibly answered by the answer/links in this thread.
    – Hornbydd
    Commented Apr 6, 2016 at 14:45

2 Answers 2

1

SIMULATION:

  • Split line (bus route) into equal length parts
  • Create end points to represent bus stops

WORKFLOW:

  • Connect pairs of points by straight line (Points to Line, using LINEIDs)

enter image description here

  • Use Add Geometry attributes to calculate CENTROID_X, CENTROID_Y and BEARING of straight segments
  • Calculate LENGTH and field SMALL. Field SMALL I populated with same number 200.
  • Construct ellipses using centroid coordinates, LENGTH, SMALL and BEARINGS as individual ellipse parameters. Note you cannot use TABLE to Ellipse tool because it adjust your bearing to true north. I use ArcView 3 to construct them. I’ve heard there is ArcGIS add-on to calculate planar ellipses.

enter image description here

  • Merge straight and ellipse lines and dissolve them using segement ID, no multipart.
  • Remove ones that are less than maximum length per line ID

RESULT:

enter image description here

I guess you might play with minor axis length (SMALL in above) and make it variable to show multiple journeys or manually delete ellipses' parts if automatic removal doesn't look right.

0

Here is an alternative approach, it uses VBA (so you need that installed and licensed) and it stores the resulting curves in the graphics layer. I took this approach as you can play with the parameters and see what best fits your scenario then convert to features if required.

Below is a screen shot of some USA roads converted into EllipticalArcs.

Example

The key "command" or interface is IConstructEllipticArc there are others that you may want to experiment with? The code gives preference to creating arcs in a clockwise direction, maybe you want anti-clockwise? Changing the shape of the envelope will also influence the output.

Public Sub CreateArcs()
    ' Author: Duncan Hornby ([email protected])
    ' Date: 6/4/16

    ' Get map document
    Dim pMXDocument As IMxDocument
    Set pMXDocument = ThisDocument

    ' Get active view
    Dim pActiveView As IActiveView
    Set pActiveView = pMXDocument.ActiveView

    ' Get graphics container
    Dim pGraphicsContainer As IGraphicsContainer
    Set pGraphicsContainer = pActiveView.GraphicsContainer

    ' Get map and the first layer (assumed to be polyline)
    Dim pMap As IMap
    Set pMap = pMXDocument.FocusMap
    Dim pLayer As ILayer
    Set pLayer = pMap.Layer(0)
    Dim pFeatureLayer As IFeatureLayer
    Set pFeatureLayer = pLayer

    ' Create a cursor over dataset
    Dim pFeatureCursor As IFeatureCursor
    Set pFeatureCursor = pFeatureLayer.Search(Nothing, False)

    ' Declare objects
    Dim pPolyline As IPolyline
    Dim pPolyline2 As IPolyline
    Dim pConstructEllipticArc As IConstructEllipticArc
    Set pConstructEllipticArc = New EllipticArc
    Dim pF As IPoint
    Dim pT As IPoint
    Dim pEnvelope As IEnvelope
    Dim pSegment As ISegment
    Dim pSegmentCollection As ISegmentCollection
    Dim pLineElement As ILineElement
    Dim pLineSymbol As ILineSymbol
    Dim pElement As IElement

    ' Create a colour
    Dim pColour As IRgbColor
    Set pColour = New RgbColor
    With pColour
    .Red = 255
    .Green = 211
    .Blue = 127
    End With

    ' Main loop, read polyline and construct arcs, adding to graphics container
    Dim pFeature As IFeature
    Set pFeature = pFeatureCursor.NextFeature
    Do While Not pFeature Is Nothing
        ' Get line and extract nodes and envelope
        Set pPolyline = pFeature.Shape
        Set pF = pPolyline.FromPoint
        Set pT = pPolyline.ToPoint
        Set pEnvelope = pPolyline.Envelope

        ' Create arc and copy it into pPolyline2
        pConstructEllipticArc.ConstructTwoPointsEnvelope pF, pT, pEnvelope, esriArcClockwise
        Set pSegment = pConstructEllipticArc
        Set pPolyline2 = New Polyline
        Set pSegmentCollection = pPolyline2
        pSegmentCollection.AddSegment pSegment

        ' Add to map graphic container
        Set pLineElement = New LineElement
        Set pLineSymbol = New SimpleLineSymbol
        pLineSymbol.Color = pColour
        pLineSymbol.Width = 2
        pLineElement.Symbol = pLineSymbol
        Set pElement = pLineElement
        pElement.Geometry = pPolyline2
        pGraphicsContainer.AddElement pElement, 0

        ' Get next line feature
        Set pFeature = pFeatureCursor.NextFeature
    Loop

    ' Refresh map
    pActiveView.PartialRefresh esriViewGraphics, Nothing, Nothing
End Sub

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.