Package com.luciad.format.csv
Class TLcdCSVDataSource
java.lang.Object
com.luciad.format.csv.TLcdCSVDataSource
- All Implemented Interfaces:
ILcdDataSource
An
ILcdDataSource
describing the structure of a character separated data file, which can be passed to the
TLcdCSVModelDecoder
to decode the data.
New instances can be created through a TLcdCSVDataSource.Builder
(see newBuilder()
).- Since:
- 2018.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Builder class for aTLcdCSVDataSource
instance.static enum
The different column types which can be defined in a.csvt
file. -
Method Summary
Modifier and TypeMethodDescriptionReturns a newBuilder
instance initialised with the values of this data source.boolean
Returns a string description of the data source.Returns the encoding of the data fileint
Returns the index of the GeoJson encoded geometry, or -1 when no such column exists.int
Returns the index of the column specifying the unique ID of each element, or -1 when no such column exists.int
Returns the number of rows to skip from the data file.Returns the separator used in the data fileReturns the source name of the data file.getTypes()
Return the types of the different columns, ornull
when the types are not specified.int
Returns the index of the WKT encoded geometry, or -1 when no such column exists.int
Returns the index of the X coordinate column, or -1 when no such column exists.int
Returns the index of the Y coordinate column, or -1 when no such column exists.int
Returns the index of the Z coordinate column, or -1 when no such column exists.int
hashCode()
boolean
Returnstrue
when the first row of the data file contains the names of each column.static TLcdCSVDataSource.Builder
Creates a newBuilder
instance initialized with default values.toString()
-
Method Details
-
getSource
Returns the source name of the data file.- Returns:
- the source name of the data file, never
null
-
getEncoding
Returns the encoding of the data file- Returns:
- the encoding of the data file, never
null
-
getSeparator
Returns the separator used in the data file- Returns:
- the separator used in the data file, never
null
-
isFirstRowContainsNames
public boolean isFirstRowContainsNames()Returnstrue
when the first row of the data file contains the names of each column. The first row is considered to be the first row in the data file after skipping the firstgetRowsToSkip()
number of rows.- Returns:
true
when the first row of the data file contains the names of each column,false
otherwise.
-
getRowsToSkip
public int getRowsToSkip()Returns the number of rows to skip from the data file. This allows to for example ignore a header in the file.- Returns:
- the number of rows to skip from the data file.
-
getColumnNames
- Returns:
- the column names, or
null
whenisFirstRowContainsNames()
returnstrue
-
getIDColumn
public int getIDColumn()Returns the index of the column specifying the unique ID of each element, or -1 when no such column exists.- Returns:
- the index of the column specifying the unique ID of each element, or -1 when no such column exists.
-
getTypes
Return the types of the different columns, ornull
when the types are not specified.- Returns:
- The types of the different columns, or
null
when the types are not specified.
-
getWKTGeometryColumn
public int getWKTGeometryColumn()Returns the index of the WKT encoded geometry, or -1 when no such column exists.- Returns:
- the index of the WKT encoded geometry, or -1 when no such column exists.
-
getGeoJsonGeometryColumn
public int getGeoJsonGeometryColumn()Returns the index of the GeoJson encoded geometry, or -1 when no such column exists.- Returns:
- the index of the GeoJson encoded geometry, or -1 when no such column exists.
- Since:
- 2019.1
-
getXPointColumn
public int getXPointColumn()Returns the index of the X coordinate column, or -1 when no such column exists.- Returns:
- the index of the X coordinate column, or -1 when no such column exists.
-
getYPointColumn
public int getYPointColumn()Returns the index of the Y coordinate column, or -1 when no such column exists.- Returns:
- the index of the Y coordinate column, or -1 when no such column exists.
-
getZPointColumn
public int getZPointColumn()Returns the index of the Z coordinate column, or -1 when no such column exists.- Returns:
- the index of the Z coordinate column, or -1 when no such column exists.
-
getDescription
Description copied from interface:ILcdDataSource
Returns a string description of the data source. This will typically be used in a GUI, or in error and warning messages.- Specified by:
getDescription
in interfaceILcdDataSource
- Returns:
- a String describing the data source.
-
asBuilder
Returns a newBuilder
instance initialised with the values of this data source.- Returns:
- a new
Builder
instance initialised with the values of this data source.
-
equals
-
hashCode
public int hashCode() -
toString
-
newBuilder
Creates a newBuilder
instance initialized with default values.- Returns:
- a new
Builder
instance initialized with default values
-