Giter Site home page Giter Site logo

strikeentco / geo-nearby Goto Github PK

View Code? Open in Web Editor NEW
79.0 4.0 13.0 110 KB

:globe_with_meridians: Search for nearby locations without DB usage.

License: MIT License

JavaScript 100.00%
nearby-locations geolocation search spatial-data geojson javascript nodejs geo geohash spatial-index

geo-nearby's People

Contributors

strikeentco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

geo-nearby's Issues

Geo result with full dataset

Hi,

Currently i am just getting id and geohash as result.
If i want to get full dataset along with id and deohash then is it possible with geo-nearby?

i am getting as search result:

 [
  {
"i": "AABC",
"g": 3624733589598182
},
  {
"i": "123dgff",
"g": 3624733589598182
}
]

I want something like:

 [
  {
"i": "AABC",
"g": 3624733589598182,
"name" : "test",
"model" : "aa11"
},
  {
"i": "123dgff",
"g": 3624733589598182,
"name" : "123",
"model" : "aa22"
}
]

Get nearBy lat lon

It would be great to have the option to return lat lon instead of geoHash,

Bug in nearBy() calculation?

I was seeing search results being included that were way outside the search radius, so I wrote the following code:

    const db = GeoNearby.createCompactSet( [ [ 40, 90, 'abc' ] ] );
    console.log(db);
    const gnb = new GeoNearby(db);
    const res = gnb.nearBy(45, 95, 390620);
    console.log(res);

This code returns the single result. The issue is that these two points are actually 690000m apart, and so the result set should be empty!

The value 390620 is the minimum value that works. Anything lower and the result set is empty.

Using an array as the search radius makes no difference in the behavior. [250, 390620] is still the minimum value.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.