public class GpxToRdf
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private Classification |
classification |
private Configuration |
currentConfig |
private java.lang.String |
inputFile |
(package private) Assistant |
myAssistant |
(package private) Converter |
myConverter |
private java.lang.String |
outputFile |
(package private) int |
sourceSRID |
(package private) int |
targetSRID |
Constructor and Description |
---|
GpxToRdf(Configuration config,
Classification classific,
java.lang.String inFile,
java.lang.String outFile,
int sourceSRID,
int targetSRID)
Constructor for the transformation process from GPX file to RDF.
|
Modifier and Type | Method and Description |
---|---|
private void |
addExtensionValues(java.util.Map<java.lang.String,java.lang.String> row,
java.util.List<java.lang.Object> ext)
Updates a dictionary with the values specified in custom GPX extensions (the name of the custom attribute is used as the key for the respective value)
|
private void |
addTagValue(java.util.Map<java.lang.String,java.lang.String> row,
java.lang.String tag,
java.lang.Object val)
Updates a dictionary with the given value for an attribute (its original name is used as tag)
|
void |
apply()
Applies transformation according to the configuration settings.
|
private static GpxType |
collectData(java.lang.String filePath)
Loads the GPX file from the configuration path and returns the GPX features (waypoints, tracks) identified according to the GPX schema.
|
private void |
parseDocument(GpxType gpx)
Parse each item (waypoint, track) from GPX document in order to create the necessary triples on disk (including geometric and non-spatial attributes).
|
Converter myConverter
Assistant myAssistant
int sourceSRID
int targetSRID
private Configuration currentConfig
private Classification classification
private java.lang.String inputFile
private java.lang.String outputFile
public GpxToRdf(Configuration config, Classification classific, java.lang.String inFile, java.lang.String outFile, int sourceSRID, int targetSRID) throws java.lang.ClassNotFoundException
config
- Parameters to configure the transformation.classific
- Instantiation of the classification scheme that assigns categories to input features.inFile
- Path to input GPX file.outFile
- Path to the output file that collects RDF triples.sourceSRID
- Spatial reference system (EPSG code) of the input GPX file.targetSRID
- Spatial reference system (EPSG code) of geometries in the output RDF triples.java.lang.ClassNotFoundException
public void apply()
private static GpxType collectData(java.lang.String filePath) throws java.io.IOException
filePath
- The path to the GPX file.java.io.IOException
private void parseDocument(GpxType gpx)
gpx
- The GPX document with waypoints and tracks.private void addTagValue(java.util.Map<java.lang.String,java.lang.String> row, java.lang.String tag, java.lang.Object val)
row
- Dictionary with (tag, value) pairstag
- Key to be found/added in the dictionaryval
- Value to be updated/added into the dictionaryprivate void addExtensionValues(java.util.Map<java.lang.String,java.lang.String> row, java.util.List<java.lang.Object> ext)
row
- Dictionary with (tag, value) pairsext
- The list of extensions specified for a GPX waypoint or track