I currently designing a table/document database structure and use GeoJson to store points and routes. Currently I choose MongoDb, I will consider PostGIS later.
I want to store route info for public bus. The route contain 2 sub routes going back and forth in circular within the same route number. The route info contain related bus stops and waypoints.
The structure should be based on how I can query back.
So my use case is I want to query and get the whole route info and also the current sub route based on current location.
Which one is suitable to query from db if I structure like:
أكثر...
I want to store route info for public bus. The route contain 2 sub routes going back and forth in circular within the same route number. The route info contain related bus stops and waypoints.
The structure should be based on how I can query back.
So my use case is I want to query and get the whole route info and also the current sub route based on current location.
Which one is suitable to query from db if I structure like:
- Use MultiLineString to store the 2 LineStrings consist of bus stops and waypoints. The other info store in different column/property. Problem: How to query or differentiate sub routes.
- Separate the sub routes in another table/document or use different column/property in a table/document (multiple geospartial indexes). Problem: Duplicate bus stops and waypoints and getting the whole route info. Probably need multiple db queries.
- Use Feature in GeoJson. However I can't imagine how FeatureCollection with multiple geometries can help to query my use case above.
أكثر...