Rossitten
Rossitten

Reputation: 1166

MaxMind's GeoIPCity for a single country only?

Recently I have stumbled upon a problem - MaxMind's GeoIPCity file is way too big for our needs and contains A LOT of data we don't need and won't need.

The question is: is there a way to limit the City database to a single country? let's say, Canadian cities only?

Upvotes: -1

Views: 449

Answers (1)

raccoon
raccoon

Reputation: 559

You cannot just conveniently download the database for Canadian cities only, but you can certainly prune the database once you have downloaded and loaded it. This is true whether you use the MaxMind DB or download the CSV format, just trim out the lines that do not represent Canada's country code or geoname_id (depending on v1 or v2 of the dataset).

If you identify your specific coding environment and language, I'm certain someone can help you write a few lines of code that chops out all the fat.

Upvotes: 2

Related Questions