Ironholds / rgeolocate

Generalised IP geolocation through R
https://cran.r-project.org/web/packages/rgeolocate/index.html
Other
66 stars 22 forks source link

Unable to extract 'organization' field from GeoLite2-ASN.mmdb #49

Closed PingTrip closed 6 years ago

PingTrip commented 6 years ago

Example:

> maxmind("1.128.0.0", "GeoLite2-ASN.mmdb", c("asn", "organization"))
   asn  organization
1 1221 <NA>

A quick check of the MMDB with Python verifies the Org data exisits:

>>> import geoip2.database
>>> geoip2.database.Reader('GeoLite2-ASN.mmdb').asn('1.128.0.0')
geoip2.models.ASN({'ip_address': '1.128.0.0', u'autonomous_system_organization': u'Telstra Pty Ltd', u'autonomous_system_number': 1221L})
PingTrip commented 6 years ago

The answer was staring me in the face... I realized I was referencing the incorrect data mapping ("organization" vs "aso") for the ASN database.

maxmind("1.128.0.0", "GeoLite2-ASN.mmdb", c("asn", "aso"))
   asn             aso
1 1221 Telstra Pty Ltd