1

I'm trying to get the density of intersection points along their related ellipse. What I'm missing is the length of the arc of the ellipses comprised in between the yellow polygon (which is a landslide deposit).

I would need help about step by step algorithm to calculate the distance between two points along a curved line.

martian landslide

  • 1
    You need to provide your code in the question. – Vince May 2 '17 at 10:51
  • 1) Are you looking for the length of this arc: i.stack.imgur.com/bSNDJ.jpg – Mr. Che May 2 '17 at 12:09
  • 2) Do you need step by step algorithm as an answer or python code? – Mr. Che May 2 '17 at 12:11
  • @Mr.Che Yes exactly! In other forums, I've found reference to the expression !shape.length@meters! but I have no idea how to apply it nor whether is a correct syntax. – GiuliaMagna May 2 '17 at 12:20
  • @GiuliaMagna Do you need step by step algorithm or python code? I could help with algorithm but not the code. – Mr. Che May 2 '17 at 12:25
0

enter image description here

Input data:

  1. Polygon_1 - random polygon (green color on the images).
  2. Polygon_2 - polygonal ellipses (red color on the images).

Step by step algorithm:

  1. Use tool Polygon To Line to convert Polygon_2 polygons to lines. Output data: Line_2
  2. Use tool Delete Identical with data from previous step Line_2 with fields parameter as SHAPE. (There are a lot of identical lines after previous step).
  3. Use tool Erase to delete features from Line_2 with erase_features parameter as Polygon_1. Output data: Line_2_Erase_1
  4. Use tool Erase to delete features from Line_2 with erase_features parameter as Line_2_Erase_1. Output data: Line_2_Erase_2
  5. Use tool Multipart To Singlepart to convert Line_2_Erase_2. Output data: Line_2_Erase_2_singlepart.
  6. Use tool Unsplit Line to convert Line_2_Erase_2_singlepart.
  7. If your vector data stored in geodatabase - use values in field SHAPE_Length as length of your curves.

or if your data is in shp format you have to a) create new field and b) calculate features length using this python code:

arcpy.CalculateField_management("Line_2_Erase_2_singlepart", "fieldName", "!shape.length@meters!", "PYTHON_9.3")
  • It works perfectly! Just wonder, step5 (Multipart To Singlepart) and step6 (Unsplit Line) are for the cases where lines intersect multiple times the polygon, aren't they? (for instance, in your image, the external ellipse intersects 3 times the polygon) In the case my ellipses intersect the polygon only once I can skip that, isn't it? – GiuliaMagna May 10 '17 at 11:56
  • I do not recommend you to skip these steps (results may be incorrect). But you can try at your own risk . BTW don't forget to accept answer if it is what you need. – Mr. Che May 10 '17 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.