maxmind / MaxMind-DB-Reader-java

Java reader for the MaxMind DB format
https://maxmind.github.io/MaxMind-DB-Reader-java/
Apache License 2.0
114 stars 43 forks source link

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

Closed turchanov closed 11 months ago

turchanov commented 5 years ago

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?

horgh commented 5 years ago

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.

turchanov commented 5 years ago

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?

oschwald commented 11 months ago

This was added in #131.