Creating Raster from Strava GPX points

874
1
05-13-2020 01:41 PM
JohnnyHarley
New Contributor

Hello!

I am working on maybe an unusal project right now. I have downloaded a race route from my Strava account as a GPX file and then used the GPX to Points tool in Arc. What tool should I use that would and parameters so that this current point route (attached) could be converted into a straight DEM file. The current shapefile has a Z value field. I could convert this point shapefile into a line and then add a DEM online and visualize the elevation of the route from there but thought there might be a way to bypass that. Thanks!!

0 Kudos
1 Reply
DanPatterson
MVP Esteemed Contributor

If the points are sequential along the route, perhaps just calculate the cumulative distance and the Z value into 2 fields and produce an X-Y graph.

Use

Python parser required.  For calculating the Z value into a field (type Double) use...

!Shape!.centroid.Z

and for the cumulative distance

Expression

dist_cum(!Shape!)

Code block

"""-----------------------------------------
dist_cumu(shape)
input:      shape field
returns:    cumulative distance between points
expression: dist_cumu(!Shape!)
"""

x0 = 0.0
y0 = 0.0
distance = 0.0
def dist_cumu(shape):
    global x0
    global y0
    global distance
    x = shape.firstpoint.X
    y = shape.firstpoint.Y
    if x0 == 0.0 and y0 == 0.0:
        x0 = x
        y0 = y
    distance += math.sqrt((x - x0)**2 + (y - y0)**2)
    x0 = x
    y0 = y
    return distance

Then you can use the two field for graphing inside or outside (Table to Excel tool, for instance)


... sort of retired...
0 Kudos