There are many databases for geographic location query, most of which are available in free versions. There are pure databases in China, but they only provide the geographical location information of text and do not provide latitude and longitude data. Foreign geoip databases include maxmind and ip2location databases which provide latitude and longitude data. This article briefly introduces the geoip of maxmind, which is used for national queries.
First, download the required resources from the maxmind official website.
Geoip Database: http://geolite.maxmind.com/download/geoip/database/geolitecountry/geoip.dat.gz. After the download, decompress it to drive D. For more information about the installation documentation, see geoip city database installation instructions.
Maxmind provides a variety of API interfaces, such as Perl, Java, Python, C, PHP, C #, etc. Here we use C # (https://github.com/maxmind/geoip-api-csharp2), this library is written using mono, download the package to Visual Studio.
Related Materials
AWStats display country-region plug-in geoip Installation