Normally it would be a pain to (efficiently) determine location based on IP, but since the distinction between ARIN and RIPE addresses
A few years ago, I took the databases of RIPE and the APNIC (ARIN's were unavailable) and, using a little bit of C and Perl, converted them into multiple-terminal binary decision diagrams mapping each IP address to a country. The resulting database fit on a floppy disk. Checking one IP address needed at most 32 pointer dereferences in a table that easily fits into a small part of the RAM of modern computers.
I haven't updated the database since then but this may be done by downloading tables from RIPE and APNIC and processing them.
Regards