public class OsmPbfToRdf
extends java.lang.Object
implements org.openstreetmap.osmosis.core.task.v0_6.Sink
Modifier and Type | Field and Description |
---|---|
(package private) Classification |
classification |
private static org.opengis.referencing.crs.CRSAuthorityFactory |
crsFactory |
private Configuration |
currentConfig |
private com.vividsolutions.jts.geom.GeometryFactory |
geometryFactory |
private boolean |
inNode |
private java.lang.String |
inputFile |
private boolean |
inRelation |
private boolean |
inWay |
private boolean |
keepIndexed |
(package private) Assistant |
myAssistant |
(package private) ValueChecker |
myChecker |
(package private) Converter |
myConverter |
private OSMNode |
nodeTmp |
(package private) long |
numNamedEntities |
(package private) long |
numNodes |
(package private) long |
numRelations |
(package private) long |
numWays |
private java.lang.String |
outputFile |
(package private) crosby.binary.osmosis.OsmosisReader |
reader |
private OSMRecordBuilder |
recBuilder |
private OSMRelation |
relationTmp |
private org.opengis.referencing.operation.MathTransform |
reproject |
private boolean |
rescanRelations |
private boolean |
scanRelations |
private boolean |
scanWays |
(package private) int |
sourceSRID |
private java.util.Set<java.lang.String> |
tags |
(package private) int |
targetSRID |
private OSMWay |
wayTmp |
Constructor and Description |
---|
OsmPbfToRdf(Configuration config,
java.lang.String inFile,
java.lang.String outFile,
int sourceSRID,
int targetSRID)
Constructor for the transformation process from OpenStreetMap PBF file to RDF.
|
Modifier and Type | Method and Description |
---|---|
void |
apply()
Applies transformation according to the configuration settings.
|
void |
close()
Closes the parsing process.
|
void |
complete()
Completes the parsing process.
|
void |
initialize(java.util.Map<java.lang.String,java.lang.Object> metaData)
Initializes the Osmosis object.
|
private void |
parse()
Instantiates and calls an Osmosis parser to identify OSM elements.
|
void |
parseDocument()
Calls Osmosis to parse the input PBF file.
|
void |
process(org.openstreetmap.osmosis.core.container.v0_6.EntityContainer entityContainer)
Processes an OSM element (node, way, or relation).
|
Converter myConverter
Assistant myAssistant
ValueChecker myChecker
private org.opengis.referencing.operation.MathTransform reproject
int sourceSRID
int targetSRID
private Configuration currentConfig
private java.lang.String inputFile
private java.lang.String outputFile
crosby.binary.osmosis.OsmosisReader reader
Classification classification
private static final org.opengis.referencing.crs.CRSAuthorityFactory crsFactory
long numNodes
long numWays
long numRelations
long numNamedEntities
private com.vividsolutions.jts.geom.GeometryFactory geometryFactory
private OSMRecordBuilder recBuilder
private OSMNode nodeTmp
private OSMWay wayTmp
private OSMRelation relationTmp
private java.util.Set<java.lang.String> tags
private boolean inWay
private boolean inNode
private boolean inRelation
private boolean scanWays
private boolean scanRelations
private boolean rescanRelations
private boolean keepIndexed
public OsmPbfToRdf(Configuration config, java.lang.String inFile, java.lang.String outFile, int sourceSRID, int targetSRID)
config
- Parameters to configure the transformation.inFile
- Path to input OSM XML file.outFile
- Path to the output file that collects RDF triples.sourceSRID
- Spatial reference system (EPSG code) of the input OSM XML file.targetSRID
- Spatial reference system (EPSG code) of geometries in the output RDF triples.public void parseDocument()
private void parse()
public void initialize(java.util.Map<java.lang.String,java.lang.Object> metaData)
initialize
in interface org.openstreetmap.osmosis.core.task.v0_6.Initializable
metaData
- Meta data applicable to this pipeline invocation.public void process(org.openstreetmap.osmosis.core.container.v0_6.EntityContainer entityContainer)
process
in interface org.openstreetmap.osmosis.core.task.v0_6.Sink
entityContainer
- Container of an OSM node, way, or relation.public void complete()
complete
in interface org.openstreetmap.osmosis.core.lifecycle.Completable
public void close()
close
in interface java.lang.AutoCloseable
close
in interface org.openstreetmap.osmosis.core.lifecycle.Closeable
public void apply()