0

I have a shapefile of line segments representing global rivers. The segments are all different lengths. If a segment is longer than 10km, I would like to divide it in to multiple segments approx 10km long + a segment with whatever is leftover, because not all segment lengths are perfectly divisible by 10....Alternatively, I could divide the long segments evenly into multiple segments, as long as they are all under or near 10km in length. I'm not sure which is easier.

Since this is a global data set, manually splitting things using 'split' in editor is impossible.

Any ideas to do this for my whole dataset?

I haven't used python with GIS before, but it might be necessary here.

  • If you were using a Desktop GIS I think this would be easy to do. – PolyGeo Nov 30 '17 at 21:13
  • 1
    What software have you got at your disposal? Any help we can offer is dependent on your available software. If your data is worldwide it will probably be geographic coordinates so a measure of 10km is not going to match up, consider a unit that matches with your data.. like number of vertices. – Michael Stimson Nov 30 '17 at 21:13
  • Make a search about "densify". – user30184 Nov 30 '17 at 21:43
  • Apologies for not mentioning it. I have ArcMap 10.5, as well as Google Earth Engine. It is in geographic coordinates. Though I don't think that the number of vertices is totally related to segment length because some rivers are a lot more bendy than others. – Ana Nov 30 '17 at 21:46
  • The tool you want is Dice resources.arcgis.com/en/help/main/10.2/index.html#//… which will break into shorter segments of n vertices or less. Densify will add more vertices making the data more complex, you could do this prior to Dice to ensure that the lines have regularly spaced vertices no matter how 'bendy'. – Michael Stimson Nov 30 '17 at 21:49
1

In reality you need to use both Densify and Dice. Densify, as indicated by user30184, will add vertices at regular intervals to ensure your segments aren't too long and then Dice to cut lines down to a specified number of vertices.

The parameters for Densify distance and Dice vertex_limit are dependent on your expectations; remembering that the data is likely to be geographic coordinates and a figure of 10km at The Equator will not be 10km nearer the poles, you have to decide on a figure that works for you, or preferably, select by bands away from The Equator (multiple ring buffer might help here) and apply different parameter combinations to ensure that the segments are approximately 10km.

Remember to keep a backup of your original.

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.