0

I have an sf polyline layer in R an would like to calculate the sinuosity (i.e. actual length of segment divided by the shortest distance between start and endpoint). Does anyone know of a function from sf or similar packages to accomplish this?

  • 1
    What's an "sf polyline layer"? Do you have an sf data frame with a geometry column or a vector of st_linestring or st_multilinestring object? Have you tried using st_length to get the length of linear features, and st_cast to convert to points, getting the first and last and using s_distance on them? – Spacedman Sep 10 at 6:59
  • yes, that's what I meant. No, I have not tried this but it sounds like a good idea thanks! – JonJup Sep 10 at 7:03

Your Answer

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

Browse other questions tagged or ask your own question.