[openstreetmap/openstreetmap-website] Store all GPS traces as LineStrings (Issue #7339)

Paul Norman notifications at github.com
Wed Sep 16 20:22:48 UTC 2026


pnorman left a comment (openstreetmap/openstreetmap-website#7339)

I've looked into this for areas and there's a few considerations here
- smaller segments lead to more rows and bigger indexes
- smaller segments lead to smaller geometries which are faster to fetch and operate on

When operating on areas segmentation is very useful because large portions of polygons can be turned into very simple geometries and point-in-polygon (PIP) checks can be slow with complex geometries. They also reduce the difference between bounding box coverage and geometry coverage which reduces the number of tuples the index finds. This is observed by having fewer rows dropped during the PIP recheck

Linestrings are different because PIP checks do not exist when there are no polygons and linestrings are faster to work with.

Segments significantly smaller than the bounding box queried will tend to lie entirely inside or outside the query bounding box, so intersection rechecks do not apply. Segments significantly larger will result in the query bbox often being inside a segment bbox while not intersecting the segment.

This makes me think that the ideal segment length within an order of magnitude of the typical query bbox side length.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/7339#issuecomment-5703976974
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/7339/5703976974 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260916/e5a46e37/attachment.htm>


More information about the rails-dev mailing list