6

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:

  1. Who is travelling from pointA1 which is 5% of the total distance from A->B? and
  2. Is there a point in the route points array that coincides with the location of someone else to the user could pick them up?

Thanks for reading through this. Please help me out in choosing the best database architecture for the geolocation querying system described above.

2
  • These sorts of 'please help choose the best architecture' questions aren't really a good fit for Stack Overflow. See the FAQ: stackoverflow.com/faq Commented Jun 1, 2013 at 5:27
  • 2
    I don't agree with the downvoter though - and you should always leave a comment if you downvote, please, especially for a new user. Commented Jun 1, 2013 at 5:58

1 Answer 1

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.