I have the following problem:
I created two points, for example:
SRID=3857;POINT Z (62780.8532226825 5415035.177460473 100)
SRID=3857;POINT Z (62785.8532226825 5415035.177460473 70)
As you can see, the difference in the X coordinates is 5 m, and 30 m in the Z coordinates. When I run a.distance(b)django in the shell, it returns 5 , which is wrong.
However, when I run in the psql shell:
SELECT ST_3DDistance(a.coordinates, b.coordinates)
FROM restapi_entityxyz a, restapi_entityxyz b
WHERE a.external_id='6841zef1561' AND b.external_id='1G23Fzd';
It returns:
st_3ddistance
------------------
30.4138126514911
What is the correct answer.
Is this a lack of functionality in geodjangoor a bug?
Should I use a custom library to perform this calculation?
My surroundings are as follows:
- Python 3.5,
- Django
- postgresql 9.4 + postgis
- gdal and many python libraries.