We are working on a ride sharing service, where we are using PostgreSQL as our database management system to store ride details. We haven't used any special datatypes for storing our latitude and longitude info, but are currently saving them as string objects. In order to improve the performance of our search queries on geolocation data, could we use PostGIS or is there any other location-related support from PostgreSQL? Something to improve the database's performance in a situation like this? (We are using Django btw.)
Our data would look something like this:
Ride1
starts from pointA(lat,long)
and goes to pointB(lat,long)
with routePoints(lat,long)(lat,long)
... along the way.
We need to perform complex queries on this data, for example:
pointA1
which is 5% of the total distance from A->B? andThanks for reading through this. Please help me out in choosing the best database architecture for the geolocation querying system described above.
Postgis is an excellent choice if you already have your data stored into Postgres (well, it actually is THE choice).
Postgis has functions that will convert your textual coordinate representation into geometry/geography objects and then others that can be used to perform all sorts of calculations.
Django has a Postgis module, even though I have never used it, so YMMV.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With