public class RdfToGeoJson extends java.lang.Object implements ReverseConverter
Modifier and Type | Field and Description |
---|---|
(package private) java.lang.String |
attrGeom |
private static org.opengis.referencing.crs.CRSAuthorityFactory |
crsFactory |
private ReverseConfiguration |
currentConfig |
private java.lang.String |
encoding |
(package private) org.geotools.feature.simple.SimpleFeatureBuilder |
featureBuilder |
(package private) org.geotools.geojson.feature.FeatureJSON |
fJSON |
(package private) java.lang.String |
geomType |
(package private) Assistant |
myAssistant |
(package private) int |
numRecs |
private java.lang.String |
outputFile |
(package private) com.vividsolutions.jts.io.WKTReader |
reader |
private org.opengis.referencing.operation.MathTransform |
reproject |
(package private) int |
sourceSRID |
(package private) int |
targetSRID |
(package private) java.lang.String |
typeName |
private java.io.BufferedWriter |
writer |
Constructor and Description |
---|
RdfToGeoJson(ReverseConfiguration config,
java.lang.String outFile,
int sourceSRID,
int targetSRID)
Constructor for the reverse transformation process from RDF to GeoJson.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes output file, once all results have been written.
|
boolean |
createSchema(java.util.List<java.lang.String> attrList,
org.apache.jena.query.QuerySolution sol)
Determine schema with all attribute names and their data types.
|
com.vividsolutions.jts.geom.Geometry |
getGeometry(java.lang.String g)
Cleans up geometry literals and generates its internal representation.
|
java.lang.String |
getGeometrySpec(org.apache.jena.rdf.model.Literal g)
Identifies SRID (EPSG code) and geometry type from a WKT literal.
|
java.lang.String |
getGeometrySpec(java.lang.String g)
Identifies SRID (EPSG code) and geometry type from a WKT string.
|
java.lang.Integer |
store(java.util.List<java.lang.String> attrList,
java.util.List<java.util.List<java.lang.String>> results)
Creates a feature collection from current batch of records and writes them into the output GeoJson file.
|
Assistant myAssistant
private org.opengis.referencing.operation.MathTransform reproject
com.vividsolutions.jts.io.WKTReader reader
int sourceSRID
int targetSRID
private ReverseConfiguration currentConfig
private java.lang.String outputFile
private java.lang.String encoding
private java.io.BufferedWriter writer
org.geotools.geojson.feature.FeatureJSON fJSON
org.geotools.feature.simple.SimpleFeatureBuilder featureBuilder
java.lang.String geomType
java.lang.String typeName
java.lang.String attrGeom
int numRecs
private static final org.opengis.referencing.crs.CRSAuthorityFactory crsFactory
public RdfToGeoJson(ReverseConfiguration config, java.lang.String outFile, int sourceSRID, int targetSRID)
config
- Parameters for Reverse Transformation.outFile
- Path to the output GeoJson file.sourceSRID
- Spatial reference system (EPSG code) of geometries in the input RDF triplestargetSRID
- Spatial reference system (EPSG code) of the output GeoJson filepublic void close()
close
in interface ReverseConverter
public boolean createSchema(java.util.List<java.lang.String> attrList, org.apache.jena.query.QuerySolution sol)
createSchema
in interface ReverseConverter
attrList
- List of attribute names. Attributes in the schema will be created in the same order as specified in the SELECT query that fetches results from the RDF graph.sol
- A single result (record) from a SELECT query in SPARQL.public com.vividsolutions.jts.geom.Geometry getGeometry(java.lang.String g)
getGeometry
in interface ReverseConverter
g
- A geometry WKT string.public java.lang.Integer store(java.util.List<java.lang.String> attrList, java.util.List<java.util.List<java.lang.String>> results)
store
in interface ReverseConverter
attrList
- List of attribute names.results
- Collection of records in the current batch.public java.lang.String getGeometrySpec(org.apache.jena.rdf.model.Literal g)
ReverseConverter
getGeometrySpec
in interface ReverseConverter
g
- A geometry WKT literal.public java.lang.String getGeometrySpec(java.lang.String g)
ReverseConverter
getGeometrySpec
in interface ReverseConverter
g
- A geometry WKT string.