|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gisgraphy.importer.AbstractSimpleImporterProcessor
com.gisgraphy.importer.GeonamesZipCodeSimpleImporter
public class GeonamesZipCodeSimpleImporter
Import the zipcode from a Geonames dump file.
Field Summary | |
---|---|
protected int[] |
accuracyToDistance
|
protected IAdmDao |
admDao
|
protected ICityDao |
cityDao
|
protected com.gisgraphy.fulltext.IFullTextSearchEngine |
fullTextSearchEngine
|
protected IGisFeatureDao |
gisFeatureDao
|
protected IIdGenerator |
IdGenerator
|
protected ISolRSynchroniser |
solRSynchroniser
|
protected IZipCodeDao |
zipCodeDao
|
Fields inherited from class com.gisgraphy.importer.AbstractSimpleImporterProcessor |
---|
COMMENT_START, currentFile, importerConfig, in, internationalisationService, logger, readFileLine, status, statusMessage, totalReadLine, transactionManager, txDefinition, txStatus |
Constructor Summary | |
---|---|
GeonamesZipCodeSimpleImporter()
|
Method Summary | |
---|---|
protected GisFeature |
addAndSaveZipCodeToFeature(String code,
Long featureId)
|
protected GisFeature |
addNewEntityAndZip(String[] fields)
|
protected com.gisgraphy.fulltext.FulltextResultsDto |
doAFulltextSearch(String query,
String countryCode)
|
protected Long |
findFeature(String[] fields,
com.vividsolutions.jts.geom.Point zipPoint,
int maxDistance)
|
protected Long |
findNearest(com.vividsolutions.jts.geom.Point zipPoint,
int maxDistance,
com.gisgraphy.fulltext.FulltextResultsDto results)
|
protected void |
flushAndClear()
Should flush and clear all the Daos that are used by the processor. |
protected int |
getAccurateDistance(int accuracyLevel)
|
protected File[] |
getFiles()
|
protected int |
getNumberOfColumns()
|
protected void |
processData(String line)
Process a read line of the geonames file, must be implemented by the concrete class |
List<NameValueDTO<Integer>> |
rollback()
/! |
void |
setAdmDao(IAdmDao admDao)
|
void |
setCityDao(ICityDao cityDao)
|
protected void |
setCommitFlushMode()
Will flush after every commit |
void |
setFullTextSearchEngine(com.gisgraphy.fulltext.IFullTextSearchEngine fullTextSearchEngine)
|
void |
setGisFeatureDao(IGisFeatureDao gisFeatureDao)
|
void |
setIdGenerator(IIdGenerator idGenerator)
|
void |
setSolRSynchroniser(ISolRSynchroniser solRSynchroniser)
|
protected void |
setup()
Template method that can be override. |
void |
setZipCodeDao(IZipCodeDao zipCodeDao)
|
boolean |
shouldBeSkipped()
|
protected boolean |
shouldIgnoreComments()
Whether the filter should ignore the comments (i.e. lines starting with #) |
protected boolean |
shouldIgnoreFirstLine()
Template Method : Whether the processor should ignore the first line of the input |
protected void |
tearDown()
Template method that can be override. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected IGisFeatureDao gisFeatureDao
protected IAdmDao admDao
protected com.gisgraphy.fulltext.IFullTextSearchEngine fullTextSearchEngine
protected ISolRSynchroniser solRSynchroniser
protected ICityDao cityDao
protected IZipCodeDao zipCodeDao
protected IIdGenerator IdGenerator
protected int[] accuracyToDistance
Constructor Detail |
---|
public GeonamesZipCodeSimpleImporter()
Method Detail |
---|
protected void processData(String line)
AbstractSimpleImporterProcessor
processData
in class AbstractSimpleImporterProcessor
line
- the line to processprotected Long findFeature(String[] fields, com.vividsolutions.jts.geom.Point zipPoint, int maxDistance)
protected Long findNearest(com.vividsolutions.jts.geom.Point zipPoint, int maxDistance, com.gisgraphy.fulltext.FulltextResultsDto results)
protected int getAccurateDistance(int accuracyLevel)
protected GisFeature addNewEntityAndZip(String[] fields)
protected GisFeature addAndSaveZipCodeToFeature(String code, Long featureId)
protected com.gisgraphy.fulltext.FulltextResultsDto doAFulltextSearch(String query, String countryCode)
public boolean shouldBeSkipped()
shouldBeSkipped
in interface IImporterProcessor
shouldBeSkipped
in class AbstractSimpleImporterProcessor
protected boolean shouldIgnoreFirstLine()
AbstractSimpleImporterProcessor
shouldIgnoreFirstLine
in class AbstractSimpleImporterProcessor
protected boolean shouldIgnoreComments()
AbstractSimpleImporterProcessor
shouldIgnoreComments
in class AbstractSimpleImporterProcessor
AbstractSimpleImporterProcessor.COMMENT_START
protected void setCommitFlushMode()
AbstractSimpleImporterProcessor
setCommitFlushMode
in class AbstractSimpleImporterProcessor
AbstractSimpleImporterProcessor.flushAndClear()
protected void flushAndClear()
AbstractSimpleImporterProcessor
flushAndClear
in class AbstractSimpleImporterProcessor
protected int getNumberOfColumns()
getNumberOfColumns
in class AbstractSimpleImporterProcessor
public void setCityDao(ICityDao cityDao)
cityDao
- The CityDao to setpublic void setGisFeatureDao(IGisFeatureDao gisFeatureDao)
gisFeatureDao
- The GisFeatureDao to setpublic void setAdmDao(IAdmDao admDao)
admDao
- the admDao to setprotected void setup()
AbstractSimpleImporterProcessor
setup
in class AbstractSimpleImporterProcessor
protected void tearDown()
AbstractSimpleImporterProcessor
tearDown
in class AbstractSimpleImporterProcessor
protected File[] getFiles()
getFiles
in class AbstractSimpleImporterProcessor
ImporterHelper
public void setSolRSynchroniser(ISolRSynchroniser solRSynchroniser)
solRSynchroniser
- the solRSynchroniser to setpublic List<NameValueDTO<Integer>> rollback()
IImporterProcessor
public void setZipCodeDao(IZipCodeDao zipCodeDao)
public void setFullTextSearchEngine(com.gisgraphy.fulltext.IFullTextSearchEngine fullTextSearchEngine)
public void setIdGenerator(IIdGenerator idGenerator)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |