-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Reverse Geocode #41
Comments
Unfortunately, you might need boundary coordinates to do that since cities |
Sorry, I got confused with the answer. Let me elaborate the question.
This can be done in csv, the downside is performance though. Since I don't have any idea around how the binary dat format organizes the data, I would need some help to implement this. Would really appreciate a help on this. |
That is interesting problem solution of I decided to implement. First it creates trie of geo hashes computed from locations. Introduces new method info that takes latitude and longitude as a parameters. How it works:
Example:
Result:
If you think that is useful I could create a pull request |
Thanks, this will definitely be helpful, have you checked in into node module as well? I would request you to do that, please Meanwhile, I did some intermediate research around this and found that kd-tree is also useful for such scenarios. I created an intermediate solution for myself with node module named 'kdt' and below are the stats (tested with GeoLiteCity-Location.csv having around 470,000 records):-
As you can see, the penalty is mostly around CSV read and tree creation. Unfortunately I am not good at coding for binary data, so the solution you have implemented will definitely worth exploring and I will also do a performance comparison and will let you know the results. Also, can you please add areacode, metrocode and postal code wherever available. |
Sorry for repeated messages. I did a quick testing by replacing geoip.js and utils.js and putting geohash.js in the lib folder and found that there is a performance regression while loading the module, it now takes more than 40 seconds to load (previously it was quick, less than a second). Please see below Loading module started: Tue Dec 24 2013 17:46:43 GMT+0530 (IST) |
Indeed the time it loads increases significantly. I have been thinking on how to optimize this. Sorry for limited response, but I am quite busy today. |
Hi elcct, |
Sorry I was on a break. I tried some other implementations of binary tree, but it doesn't make too much of a difference in terms of loading speed. Probably the best solution would be to use a database like MongoDB (Mongo has geo index built-in) - not sure if that is considered for this project though. |
Hi, is there any update or update about the performance for this feature? :) |
Currently have the same requirement to do a reverse lookup based on coordinates. |
This isn't a relevant feature for geo-ip. There is no IP involved. I'm sure there's a different module that is more appropriate. Secondly, the implementation isn't correct. Haversine distance will tell you which city center is closest, but it does not mean you are actually in that city since cities aren't circular in shape. You'll may not even be in the same country or continent. |
Thanks for the great module.
I have one more requirement though. I need to find out the city details from the latitude and longitude values. Since the maxmind database already contains tables which contain these values, should that be doable?
I found some node modules which are calling google apis for this, however, I am trying to see if I can achieve this without calling a web service and can do it offline.
The text was updated successfully, but these errors were encountered: