| Constructor and Description |
|---|
LuceneGazetteer(File indexDir)
Builds a
LuceneGazetteer by loading a pre-built Lucene
index from disk and setting configuration parameters for
resolving location names to GeoName objects. |
| Modifier and Type | Method and Description |
|---|---|
List<ResolvedLocation> |
getClosestLocations(GazetteerQuery query)
Execute a query against the Lucene gazetteer index using the provided configuration,
returning the top matches as
ResolvedLocations. |
GeoName |
getGeoName(int geonameId)
Retrieves the GeoName with the provided ID, lazily loading its ancestry.
|
GeoName |
getGeoName(int geonameId,
AncestryMode ancestryMode)
Retrieves the GeoName with the provided ID, resolving ancestry according
to the provided method.
|
void |
loadAncestry(Collection<GeoName> geoNames)
Retrieve the full ancestry for the provided GeoNames.
|
void |
loadAncestry(GeoName... geoNames)
Retrieve the full ancestry for the provided GeoNames.
|
public LuceneGazetteer(File indexDir) throws ClavinException
LuceneGazetteer by loading a pre-built Lucene
index from disk and setting configuration parameters for
resolving location names to GeoName objects.indexDir - Lucene index directory to be loadedClavinException - if an error occurs opening the indexpublic List<ResolvedLocation> getClosestLocations(GazetteerQuery query) throws ClavinException
ResolvedLocations.getClosestLocations in interface Gazetteerquery - the configuration parameters for the queryClavinException - if an error occurspublic GeoName getGeoName(int geonameId) throws ClavinException
GazetteergetGeoName in interface GazetteergeonameId - the ID of the requested GeoNamenull if not foundClavinException - if an error occurspublic GeoName getGeoName(int geonameId, AncestryMode ancestryMode) throws ClavinException
GazetteergetGeoName in interface GazetteergeonameId - the ID of the requested GeoNameancestryMode - the mode used to load ancestry for the GeoNamenull if not foundClavinException - if an error occurspublic void loadAncestry(GeoName... geoNames) throws ClavinException
GazetteerloadAncestry in interface GazetteergeoNames - the GeoNames whose ancestry will be loadedClavinException - if an error occurspublic void loadAncestry(Collection<GeoName> geoNames) throws ClavinException
GazetteerloadAncestry in interface GazetteergeoNames - the GeoNames whose ancestry will be loadedClavinException - if an error occursCopyright © 2012–2016 Berico Technologies. All rights reserved.