GithubHelp home page GithubHelp logo

imclab / processinggeoip Goto Github PK

View Code? Open in Web Editor NEW

This project forked from frederickk/processinggeoip

0.0 1.0 0.0 60 KB

A Processing GeoIP Java API library

License: GNU Lesser General Public License v2.1

processinggeoip's Introduction

ProcessingGeoIP

This is a processing compatible library based on GeoIP Java API (v 1.2.8) and was put into a processing friendly library

Ken Frederick [email protected]

http://cargocollective.com/kenfrederick/ http://kenfrederick.blogspot.com/

https://github.com/frederickk/ProcessingGeoIP http://www.maxmind.com/app/java

As of version 1.1.4 this API is fully thread safe.

/** not all examples work properly in processing some modifications may be required to get them working **/

To get started for GeoIP Country, look at the code in CountryLookupTest.pde.

CityLookupTest.pde contains an example for the MaxMind GeoIP City database. OrgLookupTest.pde contains examples for the GeoIP Organization and ISP databases. RegionLookupTest.pde contains an example for the MaxMind GeoIP Region database. NetspeedLookupTest.pde contains an example for the MaxMind GeoIP Netspeed database.

BenchmarkGeoIP.pde contains benchmarks for various databases using various options.

Getting Started

Note that CountryLookupTest assumes that you have the GeoIP Country database installed at /usr/local/share/GeoIP/GeoIP.dat

A free GeoLite Country database is available from: http://www.maxmind.com/app/geoip_country

A free GeoLite City database is available from: http://www.maxmind.com/app/geolitecity

MaxMind GeoIP Country offers greater accuracy over the free database. MaxMind GeoIP Country, Region, City, ISP, and Organization are available for purchase from here: http://www.maxmind.com/app/products

Please send any comments to [email protected]

Memory Caching & Other Options

The following options can be passed as the second parameter to the LookupService constructor:

GEOIP_STANDARD - read database from filesystem, uses least memory.

GEOIP_MEMORY_CACHE - load database into memory, faster performance but uses more memory

GEOIP_CHECK_CACHE - check for updated database. If database has been updated, reload filehandle and/or memory cache.

GEOIP_INDEX_CACHE - just cache the most frequently accessed index portion of the database, resulting in faster lookups than GEOIP_STANDARD, but less memory usage than GEOIP_MEMORY_CACHE - useful for larger databases such as GeoIP Organization and GeoIP City. Note, for GeoIP Country, Region and Netspeed databases, GEOIP_INDEX_CACHE is equivalent to GEOIP_MEMORY_CACHE

Note the options can be combined, for example: LookupService cl = new LookupService(dbfile, LookupService.GEOIP_MEMORY_CACHE | LookupService.GEOIP_CHECK_CACHE);

processinggeoip's People

Contributors

frederickk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.