MaxMind-DB-Reader-java icon indicating copy to clipboard operation
MaxMind-DB-Reader-java copied to clipboard

Is it possible to iterate over all records of a GeoIP database

Open turchanov opened this issue 7 years ago • 2 comments

Hi! We need to get all records contained in a database file, something like this: "Network/mask", "Attributes..." We we able to do that with CSV format exports of GeoIP2Lite database. Now that we are using GeoIP2 (which is binary format) we no longer can do that.

Is it possible with current API? Or will you be able to add such an API?

turchanov avatar Dec 06 '18 01:12 turchanov

I don't think any of our Java libraries support iteration currently. It has come up before though. You can see a potential way here: https://github.com/maxmind/GeoIP2-java/issues/93. (Note it might need some work)

If you're flexible on language, I think it's available in libraries for other languages. I like to use https://github.com/oschwald/maxminddb-golang for this. https://github.com/maxmind/MaxMind-DB-Reader-perl supports it as well.

It might be there's a CSV format already available for your database though. That might be worth checking into as well.

horgh avatar Dec 06 '18 02:12 horgh

Oh! Thank you for the information. I guess I leave this ticket open as pending for https://github.com/maxmind/GeoIP2-java/issues/93 resolution?

turchanov avatar Dec 06 '18 07:12 turchanov

This was added in #131.

oschwald avatar Nov 21 '23 21:11 oschwald