Is there a reason for using PostGIS functions such as ST_Area and ST_Length when there are already functions/operators for doing the same thing in PostgreSQL (area and @-@)
Asked
Active
Viewed 504 times
1
displayName
- 123
- 4
-
2See https://gis.stackexchange.com/questions/223487/what-is-the-purpose-of-postgis-on-postgresql – dbaston Sep 04 '18 at 11:22
-
if you only need the functions included in Postgres you can avoid having to add the postgis extension. – Marshall Sep 06 '18 at 03:33
1 Answers
2
I think the linked answer is good.
But to clarify.
The standard PostgreSQL spatial functions work on the PostgreSQL geometric types. While the PostGIS ones work on the PostGIS geometry types.
PostgreSQL offers a few functions to deal with spatial operators:
https://www.postgresql.org/docs/10/static/functions-geometry.html
It does not offer the full set that PostGIS does:
https://postgis.net/docs/reference.html
So if you will ever need a function that is not supported by PostgreSQL, you should go with the PostGIS geometry type, which allows for more spatial functionality.
HeikkiVesanto
- 16,433
- 2
- 46
- 68