Sunday 27 May 2018

cursor - Getting values from attribute table and inserting another table using ArcPy?


I have line feature class of a river network and “FromTo” table. Lines are dissolved so they are not segmented from junctions. I need to write a Python script in ArcGIS to do following:



  1. Begin from the first row in Hydro feature class attribute table and get its ID

  2. Insert this ID into “From” field in “FromTo” table

  3. Get ID(s) of line(s) which intersect(s) first line (e.g. second line intersect first line)


  4. Inset ID into “To” field in FromTo table


For second loop




  1. Get ID of second row in Hydro feature class attribute table




  2. Insert this ID into “From” field in “FromTo” table





  3. Get IDs of lines which intersect second line (e.g. first and third lines intersect second line)




  4. Inset IDs into “To” field in FromTo table




  5. So on…





Perhaps, you show a different way in order to get the same result by Python


enter image description here




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...