add handling for degnerate geometries (linestring of all the same points). add test to check it