gis
gis copied to clipboard
Wrong distance
I implemented my version based on https://tarantool.github.io/gis/intro.html For European coordinates everithing work correctly. {47.222531, 39.718705} I have distance 112. But for {55.030199, 104.920430} I have distance 1.7976931348623e+308.
Why?
tarantool-gis (0.1.22-1)
unix/:/var/run/tarantool/master.control> gis.Point({52.506361, 103.839354}, 4326):transform(4328)
---
- POINT Z (inf inf 0)
...
unix/:/var/run/tarantool/master.control> gis.Point({47.222531, 39.718705}, 4326):transform(4328)
---
- POINT Z (3336490.407890617 3605925.221262013 4054010.729922025)
...
I don't know any geoinformation system specifics, but whether latitude and longitude are passed correctly (not in the reverse order)?
The API describes the following order of arguments:
class gis.Point({lon, lat}, srid) class gis.Point({x, y}, srid) class gis.Point({x, y, z}, srid)
BTW, it worth to note that now the example above fails this way:
$ tarantool
Tarantool 2.6.0-27-g4920782e5
type 'help' for interactive help
tarantool> box.cfg{}
tarantool> gis = require('gis')
tarantool> gis.install()
tarantool> gis.Point({52.506361, 103.839354}, 4326):transform(4328)
---
- error: '/home/alex/projects/tarantool-meta/gis/gis/projection.lua:46: PROJ: latitude
or longitude exceeded limits'
...
I'm on 3f95c3106eb11aa405801f54bc7c2eb9566fbe95, it is current master ATM.