onthegomap / planetiler

Flexible tool to build planet-scale vector tilesets from OpenStreetMap data fast
Apache License 2.0
1.36k stars 109 forks source link

[FEATURE] Line-to-point geometry transformations #890

Closed quincylvania closed 3 months ago

quincylvania commented 4 months ago

Is your feature request related to a problem? Please describe. Currently, there are transformations like polygon_centroid which convert areas to points. However, there does not seem to be a corresponding method for converting lines to points. This would be helpful for points of interest in OpenStreetMap that people often map as lines, such as benches, dams, and billboards (example).

Describe the solution you'd like Add one or more geometry types for layer definitions that convert lines to points. Perhaps one that chooses the centroid and one that puts the point on the line.

Describe alternatives you've considered We can output lines directly and render them as points if desired. However, this adds unnecessary bloat if we don't care about the exact geometry. Short lines are also likely to be dropped at lower zoom levels, which may be unexpected when we just want to display point icons.

msbarry commented 3 months ago

Sorry for the delay here! Should be fixed in #945

quincylvania commented 3 months ago

@msbarry Thank you!!