This code will break if trail segments with LineStrings is in the data. This function should be robust enough to handle them.
This code will break if trail segments with LineStrings is in the data. This function should be robust enough to handle them.