Skip to content
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

Return list of countries and cities #19

Closed
unabl4 opened this issue Oct 9, 2012 · 3 comments
Closed

Return list of countries and cities #19

unabl4 opened this issue Oct 9, 2012 · 3 comments

Comments

@unabl4
Copy link

unabl4 commented Oct 9, 2012

I know it is not directly related to this particular gem, but it would be quite nice to have all the cities and countries fetched from the .dat file, to be usable, for example, in forms (select fields). Just to avoid duplication in code / databases.

@cjheath
Copy link
Owner

cjheath commented Oct 9, 2012

I think the only way to do it would be a full scan of the data file, due to the way the data is indexed. You couldn't extract for example the towns in a certain state without scanning the whole file, I don't think. Still think it's a good idea?

@unabl4
Copy link
Author

unabl4 commented Oct 16, 2012

Ugh. Sounds scary :) What would be the best option then ? Use GeoLityCity in .csv ?

@cjheath
Copy link
Owner

cjheath commented Oct 19, 2012

You could load the CSV into a database table, which would mean you could index it to work the way you want it to. The .dat file is really just set up for searching by IP address.

@cjheath cjheath closed this as completed Oct 19, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants