Conclusion
Final consideration
Last updated
Final consideration
Last updated
After doing the experimentation for a similar requirement we observed that PostGIS’s response time is much faster and consistent for geospatial queries and roughly its response time is 2x
faster than our Elasticsearch cluster.
The major advantages of using PostGIS for geospatial queries are:
PostGIS seamlessly integrates with PostgreSQL which means that we can work with existing relational data and perform geo queries in conjunction with the traditional SQL queries.
With Proper configuration and indexing (Spatial indexing, GiST
), it can deliver high performance for geo-distance queries.
PostGIS can handle complex spatial queries efficiently for more advanced geographic analysis needs.
We can easily scale and manage performance along with PostgreSQL ( e.g Amazon Aurora)
:There is a limitation with the PostGIS, which is we can’t use distance in other metrics (Kms, Miles, etc) and we have only to use distance in meters with the geography
type and distance in degrees for the geometry
type. So we need to convert the given distance in meters or degrees respectively which is a straightforward calculation.
Hence, the conclusion is we can confidently say that the PostGIS
extension of PostgreSQL is the most preferred choice for geo distance-based filtering, sorting and searching.
http://postgis.net/docs/ST_DWithin.html https://github.com/felt/geo_postgis https://hexdocs.pm/geo_postgis/readme.html http://postgis.net/workshops/postgis-intro/indexing.html https://github.com/capterra/capterra-graphql/pull/975https://mapscaping.com/create-a-spatial-index-in-postgis/ https://postgis.net/docs/manual-1.3/ch03.html#id434747https://postgis.net/documentation/tips/lon-lat-or-lat-lon/
Azeem Chauhan | LinkedIn