Created
May 17, 2019 22:52
-
-
Save math77/ab9a7d722b62d045dd6c104f2a01de2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location_user = Point(-6.291, -36.020, srid=4326) | |
Locais.objects.annotate(distance=Distance("location", location_user)).order_by('distance') |
Essa query está retornando o seguinte erro:
Only numeric values of degree units are allowed on geodetic distance queries.
O que pode ser?
https://stackoverflow.com/a/53074722
Note that you can only provide Distance objects if the targeted geometries are in a projected system. For geographic geometries, you > should use units of the geometry field (e.g. degrees for WGS84) .
https://gis.stackexchange.com/a/94930
Achei esses comentário ai. Acredito que seja com relação ao tipo de point salvo no seu model (o srid no caso). Está sendo o mesmo srid do seu model esse criado ai?
Quando eu utilizei, não tive esse problema. Porém não achei meu código disso.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Exemplo de uma query dessas.
Considerando que
CAMPO_GEOPOINT
é um field do tipoPoint
do geodjango