public class OpenStreetMapCitiesSimpleImporter extends AbstractSimpleImporterProcessor
| Modifier and Type | Field and Description |
|---|---|
protected IAdmDao |
admDao |
static Pattern |
ALTERNATENAMES_EXTRACTION_PATTERN |
static String |
ALTERNATENAMES_EXTRACTION_REGEXP |
protected ICityDao |
cityDao |
protected CitySubdivisionDao |
citySubdivisionDao |
protected com.gisgraphy.fulltext.IFullTextSearchEngine |
fullTextSearchEngine |
protected IIdGenerator |
idGenerator |
protected static org.slf4j.Logger |
logger |
static com.gisgraphy.domain.valueobject.Output |
MINIMUM_OUTPUT_STYLE |
protected IMunicipalityDetector |
municipalityDetector |
static int |
SCORE_LIMIT |
protected ISolRSynchroniser |
solRSynchroniser |
COMMENT_START, currentFile, importerConfig, in, internationalisationService, readFileLine, status, statusMessage, totalReadLine, transactionManager, txDefinition, txStatus| Constructor and Description |
|---|
OpenStreetMapCitiesSimpleImporter() |
| Modifier and Type | Method and Description |
|---|---|
protected static String |
dumpFields(String[] fields) |
protected void |
flushAndClear()
Should flush and clear all the Daos that are used by the processor.
|
protected com.gisgraphy.fulltext.SolrResponseDto |
getAdm(String name,
String countryCode) |
protected File[] |
getFiles() |
protected com.gisgraphy.fulltext.SolrResponseDto |
getNearestCity(com.vividsolutions.jts.geom.Point location,
String name,
String countryCode,
Class[] placetypes) |
protected int |
getNumberOfColumns() |
protected void |
populateZip(String zipAsString,
GisFeature city) |
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) |
void |
setCitySubdivisionDao(CitySubdivisionDao citySubdivisionDao) |
protected void |
setCommitFlushMode()
Will flush after every commit
|
void |
setFullTextSearchEngine(com.gisgraphy.fulltext.IFullTextSearchEngine fullTextSearchEngine) |
void |
setIdGenerator(IIdGenerator idGenerator) |
void |
setMunicipalityDetector(IMunicipalityDetector municipalityDetector) |
void |
setSolRSynchroniser(ISolRSynchroniser solRSynchroniser) |
protected void |
setup()
Template method that can be override.
|
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.
|
checkNumberOfColumn, commit, countLines, decrementReadedFileLine, getCurrentFileName, getMaxInsertsBeforeFlush, getNumberOfLinesToProcess, getReadFileLine, getStatus, getStatusMessage, getTotalReadLine, incrementReadedFileLine, isEmptyField, isEndOfDocument, needCommit, onFileProcessed, process, processError, readLineAndProcessData, resetStatus, rollbackTransaction, setImporterConfig, setInternationalisationService, setTransactionManager, startTransactionpublic static final int SCORE_LIMIT
protected static final org.slf4j.Logger logger
public static final com.gisgraphy.domain.valueobject.Output MINIMUM_OUTPUT_STYLE
public static final String ALTERNATENAMES_EXTRACTION_REGEXP
public static final Pattern ALTERNATENAMES_EXTRACTION_PATTERN
protected IIdGenerator idGenerator
protected ICityDao cityDao
protected CitySubdivisionDao citySubdivisionDao
protected IAdmDao admDao
protected ISolRSynchroniser solRSynchroniser
protected com.gisgraphy.fulltext.IFullTextSearchEngine fullTextSearchEngine
protected IMunicipalityDetector municipalityDetector
protected void flushAndClear()
AbstractSimpleImporterProcessorflushAndClear in class AbstractSimpleImporterProcessorprotected void setup()
AbstractSimpleImporterProcessorsetup in class AbstractSimpleImporterProcessorprotected File[] getFiles()
getFiles in class AbstractSimpleImporterProcessorImporterHelperprotected int getNumberOfColumns()
getNumberOfColumns in class AbstractSimpleImporterProcessorprotected void processData(String line) throws ImporterException
AbstractSimpleImporterProcessorprocessData in class AbstractSimpleImporterProcessorline - the line to processImporterExceptionprotected static String dumpFields(String[] fields)
fields - The array to processprotected void populateZip(String zipAsString, GisFeature city)
protected com.gisgraphy.fulltext.SolrResponseDto getNearestCity(com.vividsolutions.jts.geom.Point location,
String name,
String countryCode,
Class[] placetypes)
public boolean shouldBeSkipped()
shouldBeSkipped in interface IImporterProcessorshouldBeSkipped in class AbstractSimpleImporterProcessorprotected void setCommitFlushMode()
AbstractSimpleImporterProcessorsetCommitFlushMode in class AbstractSimpleImporterProcessorAbstractSimpleImporterProcessor.flushAndClear()protected boolean shouldIgnoreComments()
AbstractSimpleImporterProcessorshouldIgnoreComments in class AbstractSimpleImporterProcessorAbstractSimpleImporterProcessor.COMMENT_STARTprotected boolean shouldIgnoreFirstLine()
AbstractSimpleImporterProcessorshouldIgnoreFirstLine in class AbstractSimpleImporterProcessorpublic List<NameValueDTO<Integer>> rollback()
IImporterProcessorprotected void tearDown()
AbstractSimpleImporterProcessortearDown in class AbstractSimpleImporterProcessorpublic void setSolRSynchroniser(ISolRSynchroniser solRSynchroniser)
public void setIdGenerator(IIdGenerator idGenerator)
public void setCityDao(ICityDao cityDao)
public void setFullTextSearchEngine(com.gisgraphy.fulltext.IFullTextSearchEngine fullTextSearchEngine)
public void setAdmDao(IAdmDao admDao)
public void setMunicipalityDetector(IMunicipalityDetector municipalityDetector)
public void setCitySubdivisionDao(CitySubdivisionDao citySubdivisionDao)
Copyright © 2015. All rights reserved.