public class OsmXmlToRdf
extends org.xml.sax.helpers.DefaultHandler
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 |
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 java.util.Map<java.lang.String,com.vividsolutions.jts.geom.Geometry> |
tmpNodeIndex |
private java.util.Map<java.lang.String,com.vividsolutions.jts.geom.Geometry> |
tmpRelationIndex |
private java.util.Map<java.lang.String,com.vividsolutions.jts.geom.Geometry> |
tmpWayIndex |
private OSMWay |
wayTmp |
Constructor and Description |
---|
OsmXmlToRdf(Configuration config,
java.lang.String inFile,
java.lang.String outFile,
int sourceSRID,
int targetSRID)
Constructor for the transformation process from OpenStreetMap XML file to RDF.
|
Modifier and Type | Method and Description |
---|---|
void |
apply()
Applies transformation according to the configuration settings.
|
void |
endElement(java.lang.String s,
java.lang.String s1,
java.lang.String element)
Concludes processing of an OSM element (node, way, or relation) once it has been parsed completely.
|
void |
parseDocument()
Calls Saxon transformation to parse the input XML file.
|
void |
startElement(java.lang.String s,
java.lang.String s1,
java.lang.String elementName,
org.xml.sax.Attributes attributes)
Starts parsing of a new 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
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 java.util.Map<java.lang.String,com.vividsolutions.jts.geom.Geometry> tmpNodeIndex
private java.util.Map<java.lang.String,com.vividsolutions.jts.geom.Geometry> tmpWayIndex
private java.util.Map<java.lang.String,com.vividsolutions.jts.geom.Geometry> tmpRelationIndex
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 OsmXmlToRdf(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()
public void startElement(java.lang.String s, java.lang.String s1, java.lang.String elementName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
s
- The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.s1
- The local name (without prefix), or the empty string if Namespace processing is not being performed.elementName
- The qualified name (with prefix), or the empty string if qualified names are not available.attributes
- The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.org.xml.sax.SAXException
public void endElement(java.lang.String s, java.lang.String s1, java.lang.String element)
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
s
- The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.sl
- The local name (without prefix), or the empty string if Namespace processing is not being performed.element
- The qualified name (with prefix), or the empty string if qualified names are not available.public void apply()