Package org.opensextant.output
Class GISDataFormatter
- java.lang.Object
-
- org.opensextant.output.AbstractFormatter
-
- org.opensextant.output.GISDataFormatter
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,MatchInterpreter
,ResultsFormatter
- Direct Known Subclasses:
GDBFormatter
,GeoCSVFormatter
,KMLFormatter
,ShapefileFormatter
,WKTFormatter
public abstract class GISDataFormatter extends AbstractFormatter implements java.io.Closeable
This is the base class for classes that convert document annotations to GISCore features. Subclasses differ chiefly by choice of text string for the description field. For some types of documents (e.g., news articles) the sentence containing the annotation is a good choice, but for other types (e.g., spreadsheets) sentence splitting may not be successful and the line of text containing the annotation is a better choice.- Author:
- Rich Markeloff, MITRE Corp. Initial version created on Dec 20, 2011, Marc C. Ubaldino, MITRE Corp. Refactored, redesigned package using GISCore, 2013.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
allowNonGeo
protected org.opensextant.giscore.DocumentType
doc_type
protected GISDataModel
gisDataModel
protected boolean
groupByDocument
protected org.opensextant.giscore.output.IGISOutputStream
os
protected boolean
useFileHyperlink
-
Fields inherited from class org.opensextant.output.AbstractFormatter
debug, geoInterpreter, includeCoordinate, includeOffsets, log, outputExtension, outputParams, outputType, overwrite, TEXT_WIDTH
-
-
Constructor Summary
Constructors Constructor Description GISDataFormatter()
-
Method Summary
Modifier and Type Method Description void
addField(java.lang.String fld)
void
close()
protected java.io.File
createTempFolder(java.lang.String key)
protected boolean
filterOut(TextMatch geo)
This helps you figure out what to put in the GIS products.void
finish()
void
removeField(java.lang.String fld)
void
setGisDataModel()
Use Default GIS Data Model based on current state of formattervoid
setGisDataModel(GISDataModel gisDataModel)
void
start(java.lang.String containerName)
Start output.void
writeGeocodingResult(ExtractionResult rowdata)
Implementation of adding info extraction/geocoding restults to GIS outputs.-
Methods inherited from class org.opensextant.output.AbstractFormatter
checkOverwrite, createOutputFileName, createOutputStreams, deleteOutput, formatResults, getGeocoding, getJobName, getOutputFilepath, getOutputType, setMatchInterpeter, setOutputDir, setOutputFilename, setParameters
-
-
-
-
Field Detail
-
doc_type
protected org.opensextant.giscore.DocumentType doc_type
-
os
protected org.opensextant.giscore.output.IGISOutputStream os
-
groupByDocument
protected boolean groupByDocument
-
gisDataModel
protected GISDataModel gisDataModel
-
allowNonGeo
protected boolean allowNonGeo
-
useFileHyperlink
protected boolean useFileHyperlink
-
-
Method Detail
-
setGisDataModel
public void setGisDataModel(GISDataModel gisDataModel)
-
setGisDataModel
public void setGisDataModel()
Use Default GIS Data Model based on current state of formatter
-
start
public void start(java.lang.String containerName) throws ProcessingException
Start output.- Specified by:
start
in interfaceResultsFormatter
- Specified by:
start
in classAbstractFormatter
- Throws:
ProcessingException
-
finish
public void finish()
- Specified by:
finish
in interfaceResultsFormatter
- Specified by:
finish
in classAbstractFormatter
-
createTempFolder
protected java.io.File createTempFolder(java.lang.String key)
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in classAbstractFormatter
- Throws:
java.io.IOException
-
filterOut
protected boolean filterOut(TextMatch geo)
This helps you figure out what to put in the GIS products.
-
writeGeocodingResult
public void writeGeocodingResult(ExtractionResult rowdata)
Implementation of adding info extraction/geocoding restults to GIS outputs.- Specified by:
writeGeocodingResult
in classAbstractFormatter
- Parameters:
rowdata
- the data to write out
-
addField
public void addField(java.lang.String fld) throws ConfigException
- Specified by:
addField
in interfaceResultsFormatter
- Parameters:
fld
- field- Throws:
ConfigException
- if not consistent with schema
-
removeField
public void removeField(java.lang.String fld) throws ConfigException
- Specified by:
removeField
in interfaceResultsFormatter
- Parameters:
fld
- field- Throws:
ConfigException
- if not consistent with schema
-
-