public class OpenStreetMapSimpleImporter extends AbstractSimpleImporterProcessor
Modifier and Type | Field and Description |
---|---|
static Pattern |
ALTERNATENAMES_EXTRACTION_PATTERN |
static String |
ALTERNATENAMES_EXTRACTION_REGEXP |
protected ICityDao |
cityDao |
static int |
DISTANCE |
protected IIdGenerator |
idGenerator |
protected static org.slf4j.Logger |
logger |
protected IMunicipalityDetector |
municipalityDetector |
protected IOpenStreetMapDao |
openStreetMapDao |
protected ISolRSynchroniser |
solRSynchroniser |
COMMENT_START, currentFile, importerConfig, in, internationalisationService, readFileLine, status, statusMessage, totalReadLine, transactionManager, txDefinition, txStatus
Constructor and Description |
---|
OpenStreetMapSimpleImporter() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkNumberOfColumn(String[] fields)
overidded because alternatenames can be null so number of fields can differ
|
protected void |
flushAndClear()
Should flush and clear all the Daos that are used by the processor.
|
protected String |
getDeeperAdmName(City city) |
protected File[] |
getFiles() |
protected City |
getNearestCity(com.vividsolutions.jts.geom.Point location,
String countryCode,
boolean filterMunicipality) |
protected int |
getNumberOfColumns() |
protected String |
pplxToPPL(String cityName)
tests if city is a paris district, if so it is
probably a pplx that is newly considered as ppl
http://forum.geonames.org/gforum/posts/list/2063.page
|
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 |
setCityDao(ICityDao cityDao) |
protected void |
setCommitFlushMode()
Will flush after every commit
|
void |
setIdGenerator(IIdGenerator idGenerator) |
protected void |
setIsInFields(OpenStreetMap street) |
void |
setMunicipalityDetector(IMunicipalityDetector municipalityDetector) |
void |
setOpenStreetMapDao(IOpenStreetMapDao openStreetMapDao) |
void |
setSolRSynchroniser(ISolRSynchroniser solRSynchroniser) |
protected void |
setup()
Template method that can be override.
|
boolean |
shouldBeSkipped() |
protected boolean |
shouldFillIsInField() |
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.
|
commit, countLines, decrementReadedFileLine, dumpFields, getCurrentFileName, getMaxInsertsBeforeFlush, getNumberOfLinesToProcess, getReadFileLine, getStatus, getStatusMessage, getTotalReadLine, incrementReadedFileLine, isEmptyField, isEndOfDocument, needCommit, onFileProcessed, process, processError, readLineAndProcessData, resetStatus, rollbackTransaction, setImporterConfig, setInternationalisationService, setTransactionManager, startTransaction
protected static final org.slf4j.Logger logger
public static final int DISTANCE
@Autowired protected IIdGenerator idGenerator
@Autowired protected IOpenStreetMapDao openStreetMapDao
@Autowired protected ISolRSynchroniser solRSynchroniser
@Autowired protected IMunicipalityDetector municipalityDetector
@Autowired protected ICityDao cityDao
public static final String ALTERNATENAMES_EXTRACTION_REGEXP
public static final Pattern ALTERNATENAMES_EXTRACTION_PATTERN
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 void setIsInFields(OpenStreetMap street)
protected City getNearestCity(com.vividsolutions.jts.geom.Point location, String countryCode, boolean filterMunicipality)
protected String pplxToPPL(String cityName)
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
protected void checkNumberOfColumn(String[] fields)
checkNumberOfColumn
in class AbstractSimpleImporterProcessor
fields
- The array to checkgetNumberOfColumns()
protected boolean shouldFillIsInField()
public void setOpenStreetMapDao(IOpenStreetMapDao openStreetMapDao)
public void setSolRSynchroniser(ISolRSynchroniser solRSynchroniser)
public void setIdGenerator(IIdGenerator idGenerator)
public void setMunicipalityDetector(IMunicipalityDetector municipalityDetector)
public void setCityDao(ICityDao cityDao)
Copyright © 2015. All rights reserved.