java.lang.Object
com.maxmind.geoip.Location
Represents geographical location data including coordinates and address information.
Field Summary
Modifier and TypeFieldDescriptionintTelephone area code of the queried address.City name of the queried address.Two-letter ISO country code of the queried address.Country name of the queried address.intDesignated market area code of the queried address.private static final doubleEarth's diameter, in km, for the distance formula.floatLatitude of the queried address, in degrees.floatLongitude of the queried address, in degrees.intMetro area code of the queried address.private static final doublePi, to the precision the formula needs.Postal code of the queried address.private static final doubleMultiplies degrees to get radians.State, province or region name of the queried address.Constructor Summary
ConstructorsConstructorDescriptionLocation()Constructs an empty record; LookupService fills the public fields directly from the database bytes, so the defaults are only a starting point.Method Summary
All Methods
Field Details
countryCode
Two-letter ISO country code of the queried address.countryName
Country name of the queried address.region
State, province or region name of the queried address.city
City name of the queried address.postalCode
Postal code of the queried address.latitude
public float latitudeLatitude of the queried address, in degrees.longitude
public float longitudeLongitude of the queried address, in degrees.dma_code
public int dma_codeDesignated market area code of the queried address.area_code
public int area_codeTelephone area code of the queried address.metro_code
public int metro_codeMetro area code of the queried address.EARTH_DIAMETER
private static final double EARTH_DIAMETEREarth's diameter, in km, for the distance formula.- See Also:
PI
RAD_CONVERT
private static final double RAD_CONVERTMultiplies degrees to get radians.- See Also:
Constructor Details
Location
public Location()Constructs an empty record; LookupService fills the public fields directly from the database bytes, so the defaults are only a starting point.
Method Details
distance
Great-circle distance from this location to another.- Parameters:
loc- the other endpoint, supplying the latitude and longitude the- Returns:
- approximate great-circle distance in km