primaryLangID
When lang ID will do. see primaryLanguage() if Language object is desired.
- Parameters:
cc
- Country code- Returns:
- Lang ID
protected void
static int
approximateLongitudeForUTCOffset(int utc)
countriesInDSTOffset(double dst)
countriesInUTCOffset(double utc)
countriesSpeaking(String lang)
boolean
countrySpeaks(String lang,
String cc)
getAdmin1Place(String cc,
String adm1)
getAdmin1PlaceByHASC(String path)
getCountry(String isocode)
getCountryByFIPS(String fips)
getDefaultCountryName(String cc_iso2)
static String
getFeatureDesignation(String cls,
String code)
getFeatureName(String cls,
String code)
static String
static String
protected static String
getProvince(String cc,
String adm1)
static boolean
isAbbreviation(char name_type)
static boolean
static boolean
static boolean
static boolean
static boolean
isAdministrative(String featClass)
static boolean
isAdministrative(String featClass,
String featCode)
static boolean
isCode(char name_type)
static boolean
static boolean
static boolean
static boolean
static boolean
isName(char name_type)
static boolean
isNationalCapital(String featCode)
static boolean
static boolean
isPoliticalEntity(String featCode)
static boolean
static boolean
isPopulated(String featClass)
static boolean
static boolean
boolean
isPrimaryLanguage(String lang,
String cc)
static boolean
static boolean
isUpperAdminLevel(String featCode)
static boolean
void
loadMajorCities(InputStream strm)
loadMajorCities(String resourcePath)
void
void
mapMajorCityIDs(List<Place> cities)
mapPopulationByLocation(List<Place> cities)
mapPopulationByLocation(List<Place> cities,
int ghResolution)
static String
static String
primaryLangID(String cc)
IOException
- if metadata files are not found or do not load.c
- country namecls
- feature class, e.g., Pcode
- feature code, e.g., PPLutc
- UTC offsettz
- TZ nameutc
- offset in decimal hoursdst
- DST offsetresourcePath
- CLASSPATH location of a resource.IOException
- if resource file is not foundcities
- arra of Place objectscities
- list of major citiescities
- list of major citiesghResolution
- number of geohash chars in prefix, for keys in map.
Higher resolution means
finer geohash gridSchema: http://download.geonames.org/export/dump/ pass in the files formatted in geonames.org format, and named citiesNNNN.zip (.txt) where NNNN is the population threshold.
strm
- input stream for geonames.org cities fileIOException
- if parsing goes wrong.IOException
- if geonames.org table cannot be found in classpathcc
- ISO country codeadm1
- ISO province codegetAdmin1Place(String, String)
cc
- country codeadm1
- ADM level 1 codepath
- hierarchical pathTODO: This is mildly informed by geonames.org, however even there we are still missing a mapping between ADM1 FIPS/ISO codes for a state and the Postal codes/abbreviations. Aliases for the same US province: "US.25" = "MA" = "US.MA" = "Massachussetts" = "the Bay State" Easily mapping the coded data (e.g., 'MA' = '25') worldwide would be helpful. TODO: Make use of geonames.org or other sources for ADM1 postal code listings at top level.
IOException
- if CSV file not found in classpathcc_iso2
- country code.isocode
- ISO codecc
- country code from any standard.fips
- FIPS codefips
- FIPS codev
- admin codeCC.ADM1.ADM2.ADM3... etc. for example: 'US.48.201' ... some county in Texas.
c
- country codeadm1
- ADM1 codenm
- country namename_type
- codename_type
- OpenSextant codefeatCode
- feat code or designationfeatCode
- featCode
- feature codefeatCode
- featCode
- feature codep
- placep
- placep
- Placep
- placep
- placefeatClass
- feature type in questionfeatClass
- featCode
- featClass
- geonames feature class, e.g., A, P, H, L, V, T, Rlang
- mixed case langID or langID+Locale.cc
- UPPERCASE country code.lang
- Lang IDcc
- Country codecc
- Country codecc
- Country codelang
- lang IDcc
- UPPERCASE country code.IOException
- if geonames.org resource file is not foundlangOrLocale
- lang codecc
- country codelangid
- lang ID