Add `length()` Lua function for geometries
It would be great to have a length() function for (multi)linestrings. Implementation similar to the area() function for polygons using the boost::geometry function of the same name.
See #1756
Should this be the total length, or, when splitting is on, the length of the split linestring?
Should this be the total length, or, when splitting is on, the length of the split linestring?
This would be a function on geometry objects which don't do magic auto-splitting. It should just do what it says on the box, i.e. calculate the length of that geometry.
Hello, I am interested in contributing. This would be my first contribution so I might need some extra guidence, would that be alright?
@victoriasiver26 Sure. Try installing osm2pgsql from source and running it using the flex output. Try the geometries-using-insert.lua example from the flex-config directory. Look there for use of the area() function. Then find the places in the source where the area() function is implemented and do the equivalent for the length() function.
Implemented in #1777.