Why isn't Locate Features along Routes working?

607
2
Jump to solution
04-27-2018 03:27 PM
PaulHuffman
Occasional Contributor III

I just had a guy come through my office in a big hurry, wanting to know how far apart along a river were some points in his GPS.  I've done this a lot so I can't figure out why it is not working today.  I downloaded the GPS points from his units, converted them into shape files in WGS 84,  threw together a map in ArcMap 10.6 with a basemap from ESRI so we would be confident in the points position.  Then I added a routed hydro layer,  made a selection of just one route , the main river, and added the selected route as a layer.  But when I run "Locate Features Along Routes"  I don't get an output table.  I just get an unhelpful ERROR 999999.  Why isn't this working?  Is it the coordinate system I have fallen into? Identify Route Location tool is working with my route layers. 

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Esteemed Contributor

attachment failed... And probably, if you are using coordinates in decimal degrees don't expect distance measures in meters or feet.  

And if the points were sequential and in projected coordinates, you could even calculate the sequential cumulative distance between points.

"""-----------------------------------------
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

#----- use python parser -----
# ---- expression box 
# dist_cumu(!Shape!)

View solution in original post

2 Replies
DanPatterson_Retired
MVP Esteemed Contributor

attachment failed... And probably, if you are using coordinates in decimal degrees don't expect distance measures in meters or feet.  

And if the points were sequential and in projected coordinates, you could even calculate the sequential cumulative distance between points.

"""-----------------------------------------
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

#----- use python parser -----
# ---- expression box 
# dist_cumu(!Shape!)
PaulHuffman
Occasional Contributor III

Yes, I guess that was it.  The GPS points came in from a third party GPS utility which exported to a shape file in WGS 84.   I thought it would be enough to make the data frame State Plane feet,  but Locate Features didn't work until I ran the GPS points through Project to make a State Plane version.

Hey! I accidentally found a GPS toolbar in 10.6!  At what rev did that show up? 

0 Kudos