3

I have several days worth of geotagged imagery to which I've attached a tree canopy mortality rating.

The goal is to eventually join all of these classifications to a shapefile that contains watershed catchments for a whole region.

The issue is that images were taken at an oblique angle, so the image location as reported by the camera may be different than the catchment with classified stands.

Determining which photos were in which catchment was done manually by using snapshot views in google earth. This was added to an excel file, from which XY coordinates were displayed. Each image has between 1-5 rows in the spreadsheet, each of which has following columns: Image Name, Catchment #, Easting, Northing, Elevation, and Mortality Classification. The same image may encompass up to 5 catchments, leading to the issue.

So far I've tried to select features by attributes to determine which photo points should be in which catchment.

Is there a way to move multiple points (different pictures) into a single polygon (the catchments) all at once? It's possible to manually move each photo individually into its respective catchment, but there are thousands of photos.

A catchment and 5 associated pictures. Both the catchment and the points have the same ID number, this ID number was used to determine which points were associated with which catchments. 3 Pictures fall outside of the catchment.

enter image description here

Where clause used to find a catchment of interest, as determined by that days spreadsheet.enter image description here

Where clause used to determine which points should fall within the catchment of interest. The catchment ID for each attribute table (catchment polygons vs photo points) is different.

5
  • 3
    How do you know which points belong in which polygon? Is it purely based on your personal knowledge, or are there criteria that a machine could understand?
    – csk
    Commented Feb 19, 2019 at 21:14
  • 2
    As @csk says you need to explain why you chose those 3 particular points and not any other. Did you use information attached to those points to make your decision? If so what attribute information do you have? Please edit your edit and add this information.
    – Hornbydd
    Commented Feb 19, 2019 at 21:22
  • I've edited the post with what I believe to be the info needed. If there's anything else I can add for clarity I'd be happy to
    – G Henry
    Commented Feb 19, 2019 at 21:44
  • 1
    Your additional information has been helpful. I can see multiple solutions to this problem but you need to clarify one thing. When one moves the points outside the catchment to within the catchment where in the catchment should they go? To me this becomes a trivial problem if you snap them to the polygon centroid. But are a set of stacked points at the centre of each polygon acceptable to you? Alternatively you know you have 5 points associated with the catchment ID then you could generate 5 random points within the polygon.
    – Hornbydd
    Commented Feb 19, 2019 at 23:20
  • 1
    The points can have any location within the catchment polygon, so multiple points stacked on top of one another would work just fine. Snapping to the polygon center seems like a relatively painless way to go about it, but which tool would I use in that case?
    – G Henry
    Commented Feb 20, 2019 at 20:53

1 Answer 1

1

If you are familiar with python, you can try with this code (replace "your_catchments_here" and "your_points_here" with your actual layers):

with arcpy.da.SearchCursor("your_catchments_here",["SHAPE@","ID"]) as s_cur:
    for polygon in s_cur:
        with arcpy.da.UpdateCursor("your_points_here",["SHAPE@XY","Catchment"]) as u_cur:
        for point in u_cur:
            if polygon[1] == point[1]:
                point[0] = polygon[0].centroid
                u_cur.updateRow(point)

I did not tested it, but:

  1. beware that sometimes the centroid of a polygon could lie outside of that polygon (e.g. half-moon-shaped polygons like)
  2. The code is not optimized (it will loop over all the points for each polygons. If you have many points, then let me know and I'll give you a modified version.
3
  • Thanks for your feedback. There are quite a few points, but this might be the best way to go about it.
    – G Henry
    Commented Feb 22, 2019 at 20:00
  • @GHenry You're welcome. Did you try the code and it worked?
    – umbe1987
    Commented Feb 24, 2019 at 17:32
  • We actually ended up using a different method: manually changing Lat/Long from points associated with a particular catchment to match the coordinates of a centroid generated within that polygon
    – G Henry
    Commented Sep 5, 2019 at 19:09

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.