Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid call to deprecated ST_Distance_Sphere #69

Merged
merged 5 commits into from
May 8, 2017
Merged

Avoid call to deprecated ST_Distance_Sphere #69

merged 5 commits into from
May 8, 2017

Conversation

mkrogemann
Copy link
Contributor

Switch to using ST_DistanceSphere instead. This avoids frequent warnings
in the postgresql server log.

Switch to using ST_DistanceSphere instead. This avoids frequent warnings
in the postgresql server log.
@mkrogemann
Copy link
Contributor Author

Just noticed that this PR already exists ;-)

@mkrogemann mkrogemann closed this May 5, 2017
@bryanjos
Copy link
Contributor

bryanjos commented May 5, 2017

@mkrogemann I can accept this PR over that one if you do the following:

  • revert the change to st_distance_sphere/2
  • create a new macro, st_distancesphere/2

The reason for keeping the old one is for anyone using a version of postgis that doesn't have the new function (for instance, doesn't look like travis ci's version of postgis has it). Since the other one throws a postgresql warning, I don't think we will have to make any warnings here. But maybe add a doc on st_distance_sphere/2 that it is deprecated as of postgis 2.2 I think?

@mkrogemann
Copy link
Contributor Author

Sounds good. I will look into it

@mkrogemann mkrogemann reopened this May 6, 2017
@mkrogemann
Copy link
Contributor Author

Looks like Postgis 2.2 has been a requirement from PostgreSQL 9.5 onwards and that 2.1. is no longer supported with PostgreSQL >= 9.5.
Travis supports 9.5 and 9.6 so Postgis 2.2 should be available. Will verify.

travis-ci/travis-ci#5575

Markus Krogemann added 3 commits May 6, 2017 20:41
This avoids deprecation warnings for users of Postgis 2.2 and newer.
@mkrogemann
Copy link
Contributor Author

All tests are green now that I switched to postgresql 9.6 which also required switching to the 'trusty' build environment which is (I believe) becoming the next default environment in Travis CI.
I did not add a test to cover the old macro. Would be easy to do but I felt this does not provide real benefit right now and that we should be testing the new API instead.
What is your view on this?

@bryanjos
Copy link
Contributor

bryanjos commented May 8, 2017

Looks good! Thanks!

@bryanjos bryanjos merged commit 6a426ee into felt:master May 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants