ip to location
Hi, does anyone in the django community know of a public algorithm to get the location from the ip. If such a thing doesn't exist do you know of a service with an API which does it? Or maybe such a functionality will be available with the upcoming Geodjango? Many thanks Francesco --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ip to location
cesco schrieb: > Hi, > > does anyone in the django community know of a public algorithm to get > the location from the ip. > If such a thing doesn't exist do you know of a service with an API > which does it? > Or maybe such a functionality will be available with the upcoming > Geodjango? > > Many thanks > Francesco Coulix has a cool solution to your topic. He has small apllication that can handle the mapping. And he points to some files which provide a ip2country mapping and country flags for you. http://coulix.net/blog/2006/aug/17/ip-country-flags-django-comments/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ip to location
Thanks but I was asking for something more precise, like latitude and longitude (approximated, of course) rather than the country which would be too vague for my application. Any other suggestion? Thanks again On Jul 16, 1:07 pm, xaranduu <[EMAIL PROTECTED]> wrote: > cesco schrieb: > > > Hi, > > > does anyone in the django community know of a public algorithm to get > > the location from the ip. > > If such a thing doesn't exist do you know of a service with an API > > which does it? > > Or maybe such a functionality will be available with the upcoming > > Geodjango? > > > Many thanks > > Francesco > > Coulix has a cool solution to your topic. He has small apllication > that can handle the mapping. > And he points to some files which provide a ip2country mapping and > country flags for you. > > http://coulix.net/blog/2006/aug/17/ip-country-flags-django-comments/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ip to location
On Mon, 2007-07-16 at 13:36 +, cesco wrote: > Thanks but I was asking for something more precise, like latitude and > longitude (approximated, of course) rather than the country which > would be too vague for my application. Any other suggestion? Given the privacy implications, hopefully you wouldn't be able to be too precise with this. Search on Google for "geo IP". You can get some free data, but the most accurate information is only available commercially and cannot be redistributed. There is no algorithm to work this information out, since it is based on information contained in routing tables and the company I buy a block of IP addresses from for use in my company might not be anywhere near me geographically. Regards, Malcolm -- He who laughs last thinks slowest. http://www.pointy-stick.com/blog/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: ip to location
Francesco, MaxMind(R) produces commercial and free IP geolocation datasets. As a proof of concept I created GeoDjango-enabled models and import scripts for their CSV files: http://www.djangosnippets.org/snippets/327/ http://www.djangosnippets.org/snippets/328/ To create this code I had to patch Django since it lacks large integer support; specifically, IP address queries require conversion to a long integer. I used Peter Nixon's latest patch to get BigIntegerField: http://code.djangoproject.com/attachment/ticket/399/django-bigint-20070712.patch I'm not sure about the utility of including it in GeoDjango. The large database size (3 million rows for LocationBlock), makes queries slower -- however, there are much fewer CountryBlock rows. I will try out their C API and compare. This may be useful for some research purposes (e.g. how many IP allocations within a political boundary, etc.). Example: >>> from geoip.models import LocationBlock, CountryBlock >>> lb = LocationBlock.objects.ipquery('72.14.207.99') >>> print unicode(lb.location) Location 2633: United States - CA, Mountain View 94043 >>> print lb.location.point POINT (-122.05740012 37.41919965) >>> cb = CountryBlock.objects.ipquery('66.64.46.23') >>> print unicode(cb.location) United States: 66.60.64.0 to 66.70.70.109 -Justin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---