r/DatabaseHelp • u/Sihal • Feb 26 '24
Creating a spatial database
I am using Postgres with Postgis.
I have a lot of multilinestring features I want to store. My data is represented as FeatureCollection of Points and as a MultilineString.
This data is going to be used to create new routes as a result of combining stored features. For example:
I have 3 multilinestring features:
feature A starts at point A1 and ends at A2
feature B starts at point B1 and ends at B2
feature C starts at point C1 and ends at C2
I want to find the route starting at point A1 and ending at point C2. There is no direct route, but combining all three features I can create the route.
How to store it efficiently and correctly?
View all comments
Show parent comment
1
u/IQueryVisiC Feb 29 '24
You want to solve it efficiently. I just mentioned the one and only simple standard algorithm which every CS students write memes about. This algorithm does not use an index. It solves your problem. It gives you a keyword to search in the documentation.