robhogan / dynamodb-geo.js

A node-friendly typescript port of https://github.com/awslabs/dynamodb-geo
210 stars 96 forks source link

S2.exp - method not written yet #11

Closed oliversturm closed 6 years ago

oliversturm commented 6 years ago

I'm calling queryRadius like this:

manager.queryRadius({
  RadiusInMeter: 10000,
  CenterPoint: {
    latitude: 55.1418401, 
    longitude: -4.110009499999933
  }})

And I'm seeing this exception:

2017-11-21T18:52:14.192Z    15d68269-ceed-11e7-9d2c-afc530895a1c    Unhandled rejection Error: method not written yet
at Function.S2.exp (/var/task/node_modules/nodes2ts/dist/S2.js:51:15)
at S2Metric.getMaxLevel (/var/task/node_modules/nodes2ts/dist/S2Metric.js:67:32)
at S2RegionCoverer.getInitialCandidates (/var/task/node_modules/nodes2ts/dist/S2RegionCoverer.js:321:87)
at S2RegionCoverer.getCoveringInternal (/var/task/node_modules/nodes2ts/dist/S2RegionCoverer.js:366:14)
at S2RegionCoverer.getCoveringUnion (/var/task/node_modules/nodes2ts/dist/S2RegionCoverer.js:181:14)
at S2RegionCoverer.getCoveringCells (/var/task/node_modules/nodes2ts/dist/S2RegionCoverer.js:156:24)
at GeoDataManager.queryRadius (/var/task/node_modules/dynamodb-geo/dist/GeoDataManager.js:205:82)
at Object.queryRadius (/var/task/dist/lib/storage/dynamodb/geo.js:65:20)
at Object.queryRadius [as radius] (/var/task/dist/readmodels/geocoded.js:62:34)
at query (/var/task/dist/readmodels/geocoded.js:76:53)
at /var/task/dist/readmodels/geocoded.js:91:31
at next (native)
at step (/var/task/dist/readmodels/geocoded.js:3:191)
at /var/task/dist/readmodels/geocoded.js:3:437
at Promise._execute (/var/task/node_modules/bluebird/js/release/debuggability.js:303:9)
at Promise._resolveFromExecutor (/var/task/node_modules/bluebird/js/release/promise.js:483:18)

I had a look at the function in question, but I can't tell why it reaches the point where this exception is thrown. It is also unclear to me why this happens with the parameters in question, or whether it depends on the data in my database? Any ideas?

oliversturm commented 6 years ago

Turns out the problem was mine - I was passing undefined for RadiusInMeter due to some other issue.