1

I have points along along a line. Points that intersect the segment of the line to return attribute information. My line as three connected segments.

ESRI Docs says

disjoint (second_geometry) Indicates if the base and comparison geometries share no points in common. Two geometries intersect if disjoint returns False.

with arcpy.da.UpdateCursor(in_point_along_line, ["SHAPE@", "Azimuth", "OID@"]) as cursor:
        for row in cursor:
            azimuth = get_azimuth_intersect(row[0], row[2])
            row[1] = azimuth
    def get_azimuth_intersect(in_geom, id):
        for geom in in_geom_azimuth_list:
            if in_geom.disjoint(geom[0]) is False:
                print id
                print in_geom.centroid
                print "Intersect"
                print geom[0].firstPoint
                print geom[0].lastPoint
                print geom[0].length

Result:

This one is reporting False, and is correct the point does intersect the line segment.
252501.7229 5653692.1437 NaN NaN The Point
252657.6907 5653761.9575 NaN NaN The line firstpoint
251107.9884 5653068.2849 NaN NaN The line lastpoint

The one is reporting it's also False? But it does not intersect...
252501.7229 5653692.1437 NaN NaN The Point
251107.9884 5653068.2849 NaN NaN The line firstpoint
251169.5741 5652467.8243 NaN NaN The line lastpoint

The one is reporting it's also False? But it does not intersect...
252501.7229 5653692.1437 NaN NaN The Point
251169.5741 5652467.8243 NaN NaN The line firstpoint
250415.1493 5651836.5709 NaN NaN The line lastpoint

What am I missing?

0

1 Answer 1

3

Make sure all your files are projected.

Not my proudest moment but I figured it out. The input line geometry was not projected. I have done this function before but I was outputting to an actually feature class not just held in memory. When it was outputted to feature class it was getting an projection because of the environment settings, but the in memory one has to be specifically set.

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.