Я пытаюсь выяснить, как перевести запрос PostGIS в GeoDjango:
def my_view(request, tempounix):
conn.execute('SELECT ST_X(geom) as x, ST_Y(geom) AS y, accuracy, altitude, speed, tempounix '
'FROM authapp_posizione '
'ORDER BY tempounix DESC LIMIT 1;')
x, y, accuracy, altitude, speed, timestamp = c.fetchone()
data = {
"geometry": {
"type": "Point",
"coordinates": [x, y],
},
"type": "Feature",
"properties": {
"accuracy": accuracy,
"altitude": altitude,
"speed": speed,
"tempounix": tempounix,
},
}
return JsonResponse(data)