0

I am using LocateFeaturesAlongRoutes_lr, MakeRouteEventLayer_lr, and MakeRouteEventLayer_lr to combine three different overlays into one based on this question I asked month ago. The code is as follow:

try:    
    print "\n\t\t\tLocating features along roads",
    arcpy.LocateFeaturesAlongRoutes_lr(FTR_TO_RS_TEMP, ORIG_RD_FTR,
                                       "CONTROL_SE", "0 Meters",
                                       FTR_TO_RS_DB_TEMP,
                                       "RCSKEY LINE FMEAS TMEAS", "FIRST",
                                       "DISTANCE", "ZERO", "FIELDS",
                                       "M_DIRECTON")

    print "\t\t\t[OK]\n\t\tcombining features and PDT schedule",
    arcpy.OverlayRouteEvents_lr(FTR_TO_RS_DB_TEMP,
                                "RCSKEY LINE FMEAS TMEAS",
                                LP_SCHEDULE, "RCSKEY LINE START END",
                                "UNION", ROAD_LP_JOINED_TEMP,
                                "RCSKEY LINE FMEAS2 TMEAS2",
                                "NO_ZERO", "FIELDS", "INDEX")

    print "\t\t\t[OK]\n\t\t\tNew event route layer",
    arcpy.MakeRouteEventLayer_lr(ORIG_RD_FTR, "CONTROL_SE",
                                 ROAD_LP_JOINED_TEMP,
                                 "RCSKEY LINE FMEAS2 TMEAS2",
                                 LP_EVENT_LAYER_TEMP)

except Exception, e:
    tb = sys.exc_info()[2]
    print "Line %i" % tb.tb_lineno
    print e.message

For some reason, the routine is causing the following two issues:

  1. Duplicate records of overlayed route events. For example, when ArcGIS creates a new record based on a union of two others, it would duplicate it 5 to 10 times.
  2. New fmeas and tmeas that are -0.000023 to 0 and 0 to 2.999977 instead of 0 to 3 as in the original layers

I am quiet certain that the two issues are related and was wondering if anyone can shed a light

1 Answer 1

2

Without more exact knowledge about your source route system and event overlays it is difficult to say exactly what is going on. It would appear that your route is not being created with a starting measure of 0, since negative measures should normally not be created by these tools unless those measures exist on the route. The Create Route tool can generate these kinds of distortions if you do not explicitly set the MDomain environment parameters when running that tool. Please calculate your start and end route measure of your routes into a pair of double fields using the Python calculation of !Shape.FirstPoint.M! and !Shape.LastPoint.M! and verify whether or not the route measures actually start at 0 or not.

I actually almost always use LocateFeaturesAlongRoute_lr to define point positions, even for line segment events and recombine the two point events to recreate the line events rather than trying to use this tool to locate line events directly. I find that the M tolerance and resolution settings have less effect on points then they do on lines. The distortions you are encountering almost certainly fall within your M tolerance and resolution settings. My original post mentioned that I often use points rather than lines with the Locate tool and effects like these are why.

The begin and end point of a line can be extracted with the ObjectID of the line using the Feature Vertices to Points tool if you have an Advanced license. If you have a lower license this can still be extracted using the geometry calculator to convert the end points to coordinates, exporting the table twice, and then using the XY Event layer to convert each end back to points that are located along the route. The From and To points events combine back together by joining the two point event tables on the common ObjectID and transferring the data over with the field calculator to a single table. (It has been a while since I worked out the exact steps, so I will have to research where I last posted the process).

Anyway, I find that I often need to set the arcpy.env parameters in my scripts for MDomain, MResolution and MTolerance prior to running tools in modelbuilder or python scripts in order to get consistent results. Using env parameters is often useful for limiting these kinds of strange behaviors for these tools. More info will follow after you have done a few experiments with these ideas. Conflation often has special challenges like these and it can take some experimentation to isolate the ideal process for preserving the greatest precision.

Additionally, it may be possible that you have to accept that absolute precision may not be possible. For example I intentionally disregard all digits beyond 4 significant digits for measures done in feet, because Land Surveyors have told me that in practice no actual field measurements or legal survey documents attempt to even be that accurate and the notion of sustaining that level of precision in the field is not practical or worthwhile for transportation and utility purposes. The equivalent of what I disregard in meters is any measure differences that are less than +/-0.0000152400305 meters in length, but in practice Surveyors disregard differences that are less than +/-0.00152400305 meters on our published survey documents.

3
  • Hi Richard, would you be interested in joining me in a chatroom on this site perhaps so you can audit and have a look at my full code?
    – dassouki
    Commented Oct 24, 2014 at 14:21
  • If you are still there I am willing to join you in a chatroom. I will stay on here for about an hour to see if you reply. Commented Oct 24, 2014 at 16:12
  • Hi Richard, I am in the main GIS chat room now if you want to join
    – dassouki
    Commented Oct 24, 2014 at 16:14

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.