Arangodb: GEO_DISTANCE returns null

Created on 28 Aug 2019  路  3Comments  路  Source: arangodb/arangodb

My Environment

  • __ArangoDB Version__: 3.4.7
  • __Operating System__: Ubuntu 18.04
  • __Total RAM in your machine__: 16GB
  • __Disks in use__: SSD
  • __Used Package__: .deb

    Component, Query & Data

__Affected feature__:
AQL query

__AQL query (if applicable)__:
return GEO_DISTANCE({ "type": "Polygon", "coordinates": [ [ [ 18.48252296447754, 50.0977892579842 ], [ 18.502349853515625, 50.094540690213215 ], [ 18.514108657836914, 50.09365968471758 ], [ 18.51848602294922, 50.09189762513111 ], [ 18.51874351501465, 50.0905760379201 ], [ 18.52972984313965, 50.08523425160345 ], [ 18.534021377563477, 50.08330665676086 ], [ 18.53917121887207, 50.08341680712576 ], [ 18.544321060180664, 50.086335699567556 ], [ 18.548612594604492, 50.08958482359351 ], [ 18.555479049682617, 50.09277866302357 ], [ 18.580799102783203, 50.07498957323004 ], [ 18.58749389648437, 50.078955514883766 ], [ 18.59607696533203, 50.07146401635589 ], [ 18.61478805541992, 50.07928599521379 ], [ 18.638134002685543, 50.08479366533065 ], [ 18.63006591796875, 50.10935016970876 ], [ 18.61272811889648, 50.11716596689089 ], [ 18.60071182250977, 50.14775639001055 ], [ 18.57461929321289, 50.136974947444195 ], [ 18.557109832763672, 50.18008613874543 ], [ 18.495311737060547, 50.17997621067504 ], [ 18.469562530517578, 50.177008057154424 ], [ 18.456687927246094, 50.16997169735088 ], [ 18.437461853027344, 50.15424608665335 ], [ 18.42081069946289, 50.1390654170196 ], [ 18.42081069946289, 50.12751167954746 ], [ 18.39454650878906, 50.10924007894779 ], [ 18.38047027587891, 50.092833727354 ], [ 18.391971588134766, 50.070692766236974 ], [ 18.455657958984375, 50.091181769916034 ], [ 18.476428985595703, 50.08644584297188 ], [ 18.482952117919922, 50.098339840861776 ], [ 18.48252296447754, 50.0977892579842 ] ] ] }, [20.9616284945545, 49.42298805])

__Problem__:
Warnings: [10], 'in function 'GEO_DISTANCE()': Invalid loop in polygon' Result: [ null ]

__Expected result__:
It should return valid distance between point and central point of area, returns null.
Result: [ {distance} ]

1 Feature 1 Question 2 Fixed

All 3 comments

I think the polygon loop is actually invalid, the first and last edges are crossing. Change "50.098339840861776" -> "50.097639840861776" and it works

I made a PR to pass through the validation errors to the client

I think the polygon loop is actually invalid, the first and last edges are crossing. Change "50.098339840861776" -> "50.097639840861776" and it works

Thank you for your answer, it works :)

Was this page helpful?
0 / 5 - 0 ratings