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

Indexing a Geoposition field #59

Open
khlumzeemee opened this issue Jan 22, 2016 · 2 comments
Open

Indexing a Geoposition field #59

khlumzeemee opened this issue Jan 22, 2016 · 2 comments

Comments

@khlumzeemee
Copy link

Hi,
This is more a question than an issue. I use geoposition to store POI. Then I want to find the POI located near the user. I want to use Postgres earthdistance and cube extensions.
I found this module on github which manages the two:
https://github.com/jneight/django-earthdistance

However for performance reasons it is highly recommended to create an index on the lat and long fields, which I cannot do because the geoposition field is a comma separated string value.

Is there an easy work-around? A hook to save the lat and long to distinct indexable fields on creation / modification?

Or put another way, is it possible to specify the way we want the data to be saved in the database, as two separate decimal fields or as a single comma separated string? That would be a great abstraction!

@asennoussi
Copy link

Did you get any workaround yet ?

@khlumzeemee
Copy link
Author

Unfortunately no, the current work-around it to not use django-geoposition and generate the two long and lat fields separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants