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, startTransaction
public 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()
AbstractSimpleImporterProcessor
flushAndClear
in class AbstractSimpleImporterProcessor
protected void setup()
AbstractSimpleImporterProcessor
setup
in class AbstractSimpleImporterProcessor
protected File[] getFiles()
getFiles
in class AbstractSimpleImporterProcessor
ImporterHelper
protected int getNumberOfColumns()
getNumberOfColumns
in class AbstractSimpleImporterProcessor
protected void processData(String line) throws ImporterException
AbstractSimpleImporterProcessor
processData
in class AbstractSimpleImporterProcessor
line
- the line to processImporterException
protected 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 IImporterProcessor
shouldBeSkipped
in class AbstractSimpleImporterProcessor
protected void setCommitFlushMode()
AbstractSimpleImporterProcessor
setCommitFlushMode
in class AbstractSimpleImporterProcessor
AbstractSimpleImporterProcessor.flushAndClear()
protected boolean shouldIgnoreComments()
AbstractSimpleImporterProcessor
shouldIgnoreComments
in class AbstractSimpleImporterProcessor
AbstractSimpleImporterProcessor.COMMENT_START
protected boolean shouldIgnoreFirstLine()
AbstractSimpleImporterProcessor
shouldIgnoreFirstLine
in class AbstractSimpleImporterProcessor
public List<NameValueDTO<Integer>> rollback()
IImporterProcessor
protected void tearDown()
AbstractSimpleImporterProcessor
tearDown
in class AbstractSimpleImporterProcessor
public 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.