How to use the geolib.isPointWithinRadius function in geolib

To help you get started, we’ve selected a few geolib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github awslabs / aws-connected-vehicle-solution / source / services / marketing / lib / marketing.js View on Github external
let getGeolocationResults = function(items, index, record, cb) {
      console.log(items)
      if (index < items.length) {
          console.log("processing: ", items[index]);
          let poi_point = {latitude: items[index].latitude, longitude: items[index].longitude};
          if(geolib.isPointWithinRadius(poi_point,{latitude: record.latitude, longitude: record.longitude},items[index].radius)){
              console.log('point is in circle for ' + items[index].poi);
              processAd(record, items[index], function(err, data) {
                  if (err) {
                      console.log("error processing ad");
                      console.log(err);
                      return cb(err, null);
                  } else {
                      index++;
                      getGeolocationResults(items, index, record, cb);
                  }
              });
          } else {
              index++;
              getGeolocationResults(items, index, record, cb);
          }
github rdrnt / tps-calls / src / components / Listeners / incident.tsx View on Github external
incident =>
            isPointWithinRadius(
              incident.coordinates,
              user.location.coordinates!,
              filter.distance! * 1000
            )
        );

geolib

Library to provide basic geospatial operations like distance calculation, conversion of decimal coordinates to sexagesimal and vice versa, etc. This library is currently **2D**, meaning that altitude/elevation is not yet supported by any of its functions!

MIT
Latest version published 2 years ago

Package Health Score

58 / 100
Full package analysis

Similar packages