Strabon

changeset 358:ef3b1a05b95b

renamed package sparqljson to geojson
author Babis Nikolaou <charnik@di.uoa.gr>
date Mon Jun 25 20:16:38 2012 +0300 (2012-06-25)
parents 28025a51cab6
children 10dcd779521e
files resultio/src/main/java/org/openrdf/query/resultio/sparqlgeojson/stSPARQLResultsGeoJSONWriter.java resultio/src/main/java/org/openrdf/query/resultio/sparqlgeojson/stSPARQLResultsGeoJSONWriterFactory.java resultio/src/main/java/org/openrdf/query/resultio/sparqljson/stSPARQLResultsGeoJSONWriter.java resultio/src/main/java/org/openrdf/query/resultio/sparqljson/stSPARQLResultsGeoJSONWriterFactory.java
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/resultio/src/main/java/org/openrdf/query/resultio/sparqlgeojson/stSPARQLResultsGeoJSONWriter.java	Mon Jun 25 20:16:38 2012 +0300
     1.3 @@ -0,0 +1,223 @@
     1.4 +package org.openrdf.query.resultio.sparqlgeojson;
     1.5 +
     1.6 +import java.io.IOException;
     1.7 +import java.io.OutputStream;
     1.8 +import java.nio.charset.Charset;
     1.9 +import java.util.ArrayList;
    1.10 +import java.util.List;
    1.11 +
    1.12 +import org.geotools.data.simple.SimpleFeatureCollection;
    1.13 +import org.geotools.feature.FeatureCollections;
    1.14 +import org.geotools.feature.simple.SimpleFeatureBuilder;
    1.15 +import org.geotools.feature.simple.SimpleFeatureTypeBuilder;
    1.16 +import org.geotools.geojson.feature.FeatureJSON;
    1.17 +import org.geotools.referencing.CRS;
    1.18 +import org.opengis.feature.simple.SimpleFeature;
    1.19 +import org.opengis.feature.simple.SimpleFeatureType;
    1.20 +import org.openrdf.model.Literal;
    1.21 +import org.openrdf.model.Value;
    1.22 +import org.openrdf.query.Binding;
    1.23 +import org.openrdf.query.BindingSet;
    1.24 +import org.openrdf.query.TupleQueryResultHandlerException;
    1.25 +import org.openrdf.query.algebra.evaluation.function.spatial.WKTHelper;
    1.26 +import org.openrdf.query.algebra.evaluation.util.JTSWrapper;
    1.27 +import org.openrdf.query.resultio.TupleQueryResultFormat;
    1.28 +import org.openrdf.query.resultio.TupleQueryResultWriter;
    1.29 +import org.openrdf.query.resultio.stSPARQLQueryResultFormat;
    1.30 +import org.openrdf.sail.generaldb.model.GeneralDBPolyhedron;
    1.31 +import org.openrdf.sail.generaldb.model.XMLGSDatatypeUtil;
    1.32 +import org.slf4j.Logger;
    1.33 +import org.slf4j.LoggerFactory;
    1.34 +
    1.35 +import com.vividsolutions.jts.geom.Geometry;
    1.36 +
    1.37 +/**
    1.38 + * A TupleQueryResultWriter that writes query results in the <a
    1.39 + * href="http://www.geojson.org/geojson-spec.html/">GeoJSON Format</a>.
    1.40 + * 
    1.41 + * @author Manos Karpathiotakis <mk@di.uoa.gr>
    1.42 + * @author Charalampos Nikolaou <charnik@di.uoa.gr>
    1.43 + */
    1.44 +public class stSPARQLResultsGeoJSONWriter implements TupleQueryResultWriter {
    1.45 +
    1.46 +	private static final Logger logger = LoggerFactory.getLogger(org.openrdf.query.resultio.sparqlgeojson.stSPARQLResultsGeoJSONWriter.class);
    1.47 +	
    1.48 +	/**
    1.49 +	 * The underlying output stream to write
    1.50 +	 */
    1.51 +	private OutputStream out;
    1.52 +	
    1.53 +	/**
    1.54 +	 * Set a Feature Collection
    1.55 +	 */
    1.56 +	private SimpleFeatureCollection sfCollection;
    1.57 +	
    1.58 +	/**
    1.59 +	 * The wrapper of JTS library
    1.60 +	 */
    1.61 +	private JTSWrapper jts;
    1.62 +	
    1.63 +	/**
    1.64 +	 * Keep track of the number of results
    1.65 +	 */
    1.66 +	private int nresults;
    1.67 +	
    1.68 +	/**
    1.69 +	 * The class to use for serializing to GeoJSON
    1.70 +	 */
    1.71 +	private FeatureJSON fjson;
    1.72 +	
    1.73 +	/**
    1.74 +	 * Keep track of the number of features
    1.75 +	 */
    1.76 +	private int nfeatures;
    1.77 +	
    1.78 +	public stSPARQLResultsGeoJSONWriter(OutputStream out) {
    1.79 +		this.out = out;
    1.80 +		
    1.81 +		// set the feature collection
    1.82 +		sfCollection = FeatureCollections.newCollection("geomOutput");
    1.83 +		
    1.84 +		// get the instance of JTSWrapper
    1.85 +		jts = JTSWrapper.getInstance();
    1.86 +		
    1.87 +		// initialize results/features
    1.88 +		nresults = 0;
    1.89 +		nfeatures = 0;
    1.90 +	}
    1.91 +
    1.92 +	@Override
    1.93 +	public void startQueryResult(List<String> bindingNames) throws TupleQueryResultHandlerException {
    1.94 +		fjson = new FeatureJSON();
    1.95 +		fjson.setEncodeFeatureCRS(true);
    1.96 +	}
    1.97 +
    1.98 +	@Override
    1.99 +	public void endQueryResult() throws TupleQueryResultHandlerException {
   1.100 +		try {
   1.101 +			fjson.writeFeatureCollection(sfCollection, out);
   1.102 +			out.write("\n".getBytes(Charset.defaultCharset()));
   1.103 +			
   1.104 +			// write a warning when there are no features in the answer
   1.105 +			if (nfeatures < nresults) {
   1.106 +				logger.warn("[Strabon.GeoJSONWriter] No spatial binding found in the result, hence the result is empty eventhough query evaluation produced {} results. GeoJSON requires that at least one binding maps to a geometry.", nresults);
   1.107 +				
   1.108 +			}
   1.109 +		} catch (IOException e) {
   1.110 +			throw new TupleQueryResultHandlerException(e);
   1.111 +		}
   1.112 +	}
   1.113 +
   1.114 +	@Override
   1.115 +	public void handleSolution(BindingSet bindingSet) throws TupleQueryResultHandlerException {
   1.116 +		try {
   1.117 +			nresults++;
   1.118 +			
   1.119 +			// list keeping binding names that are not binded to geometries
   1.120 +			ArrayList<String> properties = new ArrayList<String>();
   1.121 +			
   1.122 +			// list keeping values for binding names
   1.123 +			ArrayList<Value> values = new ArrayList<Value>();
   1.124 +			
   1.125 +			// list keeping the features of the result
   1.126 +			ArrayList<SimpleFeatureTypeBuilder> features = new ArrayList<SimpleFeatureTypeBuilder>();
   1.127 +			
   1.128 +			// list keeping the geometries of features
   1.129 +			ArrayList<Geometry> geometries = new ArrayList<Geometry>();
   1.130 +			
   1.131 +			// parse binding set
   1.132 +			for (Binding binding : bindingSet) {
   1.133 +				Value value = binding.getValue();
   1.134 +				
   1.135 +				if (XMLGSDatatypeUtil.isGeometryValue(value)) {
   1.136 +					// it's a spatial value
   1.137 +					if (logger.isDebugEnabled()) {
   1.138 +						logger.debug("[Strabon.GeoJSON] Found geometry: {}", value);
   1.139 +					}
   1.140 +					
   1.141 +					nfeatures++;
   1.142 +					
   1.143 +					// we need the geometry and the SRID 
   1.144 +					Geometry geom = null;
   1.145 +					int srid = -1;
   1.146 +					
   1.147 +					if (value instanceof GeneralDBPolyhedron) {
   1.148 +						GeneralDBPolyhedron dbpolyhedron = (GeneralDBPolyhedron) value;
   1.149 +						
   1.150 +						geom = dbpolyhedron.getPolyhedron().getGeometry();
   1.151 +						srid = dbpolyhedron.getPolyhedron().getGeometry().getSRID();
   1.152 +						
   1.153 +					} else { // spatial literal WKT or GML
   1.154 +						
   1.155 +						if (XMLGSDatatypeUtil.isWKTLiteral((Literal) value)) {// WKT
   1.156 +							// get the WKT as it is present in the result
   1.157 +							String wkt = value.stringValue();
   1.158 +							
   1.159 +							// get its geometry
   1.160 +							geom = jts.WKTread(WKTHelper.getWithoutSRID(wkt));
   1.161 +							
   1.162 +							// get its SRID
   1.163 +							srid = WKTHelper.getSRID(wkt);
   1.164 +							
   1.165 +						} else { // TODO GML
   1.166 +							logger.warn("[Strabon.GeoJSON] GML is not supported yet.");
   1.167 +						}
   1.168 +					}
   1.169 +					
   1.170 +					SimpleFeatureTypeBuilder sftb = new SimpleFeatureTypeBuilder();
   1.171 +					sftb.setName("Feature_" + nresults + "_" + nfeatures);
   1.172 +					sftb.setCRS(CRS.decode("EPSG:" + srid));
   1.173 +					sftb.setSRS("EPSG:" + srid);
   1.174 +					sftb.add("geometry", Geometry.class);
   1.175 +					
   1.176 +					// add the feature in the list of features
   1.177 +					features.add(sftb);
   1.178 +					
   1.179 +					// add the geometry of the feature in the list of geometries
   1.180 +					geometries.add(geom);
   1.181 +					
   1.182 +				} else { // URI, BlankNode, or Literal other than geometry
   1.183 +					if (logger.isDebugEnabled()) {
   1.184 +						logger.debug("[Strabon.GeoJSON] Found resource: {}", value);
   1.185 +					}
   1.186 +					
   1.187 +					properties.add(binding.getName());
   1.188 +					values.add(value);
   1.189 +				}
   1.190 +			}
   1.191 +			
   1.192 +			// construct the feature of the result
   1.193 +			for (int i = 0; i < features.size(); i++) {
   1.194 +				SimpleFeatureTypeBuilder sftb = features.get(i);
   1.195 +				
   1.196 +				// add the properties
   1.197 +				for (int p = 0; p < properties.size(); p++) {
   1.198 +					sftb.add(properties.get(p), String.class);
   1.199 +				}
   1.200 +				
   1.201 +				SimpleFeatureType featureType = sftb.buildFeatureType();
   1.202 +				SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(featureType);				
   1.203 +				
   1.204 +				// add the geometry to the builder of the feature
   1.205 +				featureBuilder.add(geometries.get(i));
   1.206 +				
   1.207 +				// add the values to the builder of the feature
   1.208 +				for (int v = 0; v < values.size(); v++) {
   1.209 +					featureBuilder.add(values.get(v));
   1.210 +				}
   1.211 +				
   1.212 +				SimpleFeature feature = featureBuilder.buildFeature(null);
   1.213 +				sfCollection.add(feature);	
   1.214 +			}
   1.215 +			
   1.216 +		} catch (Exception e) {
   1.217 +			throw new TupleQueryResultHandlerException(e);
   1.218 +		}
   1.219 +					
   1.220 +	}
   1.221 +
   1.222 +	@Override
   1.223 +	public TupleQueryResultFormat getTupleQueryResultFormat() {
   1.224 +		return stSPARQLQueryResultFormat.GEOJSON;
   1.225 +	}
   1.226 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/resultio/src/main/java/org/openrdf/query/resultio/sparqlgeojson/stSPARQLResultsGeoJSONWriterFactory.java	Mon Jun 25 20:16:38 2012 +0300
     2.3 @@ -0,0 +1,26 @@
     2.4 +package org.openrdf.query.resultio.sparqlgeojson;
     2.5 +
     2.6 +import java.io.OutputStream;
     2.7 +
     2.8 +import org.openrdf.query.resultio.TupleQueryResultFormat;
     2.9 +import org.openrdf.query.resultio.TupleQueryResultWriter;
    2.10 +import org.openrdf.query.resultio.TupleQueryResultWriterFactory;
    2.11 +import org.openrdf.query.resultio.stSPARQLQueryResultFormat;
    2.12 +
    2.13 +/**
    2.14 + * @author Charalampos Nikolaou <charnik@di.uoa.gr>
    2.15 + *
    2.16 + */
    2.17 +public class stSPARQLResultsGeoJSONWriterFactory implements TupleQueryResultWriterFactory {
    2.18 +
    2.19 +	@Override
    2.20 +	public TupleQueryResultFormat getTupleQueryResultFormat() {
    2.21 +		return stSPARQLQueryResultFormat.GEOJSON;
    2.22 +	}
    2.23 +
    2.24 +	@Override
    2.25 +	public TupleQueryResultWriter getWriter(OutputStream out) {
    2.26 +		return new stSPARQLResultsGeoJSONWriter(out);
    2.27 +	}
    2.28 +
    2.29 +}
     3.1 --- a/resultio/src/main/java/org/openrdf/query/resultio/sparqljson/stSPARQLResultsGeoJSONWriter.java	Mon Jun 25 20:03:10 2012 +0300
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,231 +0,0 @@
     3.4 -package org.openrdf.query.resultio.sparqljson;
     3.5 -
     3.6 -import java.io.IOException;
     3.7 -import java.io.OutputStream;
     3.8 -import java.nio.charset.Charset;
     3.9 -import java.util.ArrayList;
    3.10 -import java.util.List;
    3.11 -
    3.12 -import org.geotools.data.simple.SimpleFeatureCollection;
    3.13 -import org.geotools.feature.FeatureCollections;
    3.14 -import org.geotools.feature.simple.SimpleFeatureBuilder;
    3.15 -import org.geotools.feature.simple.SimpleFeatureTypeBuilder;
    3.16 -import org.geotools.geojson.feature.FeatureJSON;
    3.17 -import org.geotools.referencing.CRS;
    3.18 -import org.opengis.feature.simple.SimpleFeature;
    3.19 -import org.opengis.feature.simple.SimpleFeatureType;
    3.20 -import org.openrdf.model.Literal;
    3.21 -import org.openrdf.model.Value;
    3.22 -import org.openrdf.query.Binding;
    3.23 -import org.openrdf.query.BindingSet;
    3.24 -import org.openrdf.query.TupleQueryResultHandlerException;
    3.25 -import org.openrdf.query.algebra.evaluation.function.spatial.WKTHelper;
    3.26 -import org.openrdf.query.algebra.evaluation.util.JTSWrapper;
    3.27 -import org.openrdf.query.resultio.TupleQueryResultFormat;
    3.28 -import org.openrdf.query.resultio.TupleQueryResultWriter;
    3.29 -import org.openrdf.query.resultio.stSPARQLQueryResultFormat;
    3.30 -import org.openrdf.sail.generaldb.model.GeneralDBPolyhedron;
    3.31 -import org.openrdf.sail.generaldb.model.XMLGSDatatypeUtil;
    3.32 -import org.slf4j.Logger;
    3.33 -import org.slf4j.LoggerFactory;
    3.34 -
    3.35 -import com.vividsolutions.jts.geom.Geometry;
    3.36 -
    3.37 -/**
    3.38 - * A TupleQueryResultWriter that writes query results in the <a
    3.39 - * href="http://www.geojson.org/geojson-spec.html/">GeoJSON Format</a>.
    3.40 - * 
    3.41 - * @author Manos Karpathiotakis <mk@di.uoa.gr>
    3.42 - * @author Charalampos Nikolaou <charnik@di.uoa.gr>
    3.43 - */
    3.44 -public class stSPARQLResultsGeoJSONWriter implements TupleQueryResultWriter {
    3.45 -
    3.46 -	private static final Logger logger = LoggerFactory.getLogger(org.openrdf.query.resultio.sparqljson.stSPARQLResultsGeoJSONWriter.class);
    3.47 -	
    3.48 -	/**
    3.49 -	 * The underlying output stream to write
    3.50 -	 */
    3.51 -	private OutputStream out;
    3.52 -	
    3.53 -	/**
    3.54 -	 * Set a Feature Collection
    3.55 -	 */
    3.56 -	private SimpleFeatureCollection sfCollection;
    3.57 -	
    3.58 -	/**
    3.59 -	 * The wrapper of JTS library
    3.60 -	 */
    3.61 -	private JTSWrapper jts;
    3.62 -	
    3.63 -	/**
    3.64 -	 * Keep track of the number of results
    3.65 -	 */
    3.66 -	private int nresults;
    3.67 -	
    3.68 -	/**
    3.69 -	 * The class to use for serializing to GeoJSON
    3.70 -	 */
    3.71 -	private FeatureJSON fjson;
    3.72 -	
    3.73 -	/**
    3.74 -	 * True to write a warning when there are no features
    3.75 -	 * in the answer
    3.76 -	 */
    3.77 -	private boolean warn;
    3.78 -	
    3.79 -	public stSPARQLResultsGeoJSONWriter(OutputStream out) {
    3.80 -		this.out = out;
    3.81 -		
    3.82 -		// set the feature collection
    3.83 -		sfCollection = FeatureCollections.newCollection("geomOutput");
    3.84 -		
    3.85 -		// get the instance of JTSWrapper
    3.86 -		jts = JTSWrapper.getInstance();
    3.87 -		
    3.88 -		// initialize results
    3.89 -		nresults = 0;
    3.90 -		
    3.91 -		warn = false;
    3.92 -	}
    3.93 -
    3.94 -	@Override
    3.95 -	public void startQueryResult(List<String> bindingNames) throws TupleQueryResultHandlerException {
    3.96 -		fjson = new FeatureJSON();
    3.97 -		fjson.setEncodeFeatureCRS(true);
    3.98 -	}
    3.99 -
   3.100 -	@Override
   3.101 -	public void endQueryResult() throws TupleQueryResultHandlerException {
   3.102 -		try {
   3.103 -			fjson.writeFeatureCollection(sfCollection, out);
   3.104 -			out.write("\n".getBytes(Charset.defaultCharset()));
   3.105 -			
   3.106 -			if (warn) {
   3.107 -				logger.warn("[Strabon.GeoJSONWriter] No spatial binding found in the result, hence the result is empty eventhough query evaluation produced {} results. GeoJSON requires that at least one binding maps to a geometry.", nresults);
   3.108 -				
   3.109 -			}
   3.110 -		} catch (IOException e) {
   3.111 -			throw new TupleQueryResultHandlerException(e);
   3.112 -		}
   3.113 -	}
   3.114 -
   3.115 -	@Override
   3.116 -	public void handleSolution(BindingSet bindingSet) throws TupleQueryResultHandlerException {
   3.117 -		try {
   3.118 -			// we might have more than one feature in the result, so we count them
   3.119 -			int nfeatures = 0;
   3.120 -			
   3.121 -			nresults++;
   3.122 -			
   3.123 -			// list keeping binding names that are not binded to geometries
   3.124 -			ArrayList<String> properties = new ArrayList<String>();
   3.125 -			
   3.126 -			// list keeping values for binding names
   3.127 -			ArrayList<Value> values = new ArrayList<Value>();
   3.128 -			
   3.129 -			// list keeping the features of the result
   3.130 -			ArrayList<SimpleFeatureTypeBuilder> features = new ArrayList<SimpleFeatureTypeBuilder>();
   3.131 -			
   3.132 -			// list keeping the geometries of features
   3.133 -			ArrayList<Geometry> geometries = new ArrayList<Geometry>();
   3.134 -			
   3.135 -			// parse binding set
   3.136 -			for (Binding binding : bindingSet) {
   3.137 -				Value value = binding.getValue();
   3.138 -				
   3.139 -				if (XMLGSDatatypeUtil.isGeometryValue(value)) {
   3.140 -					// it's a spatial value
   3.141 -					if (logger.isDebugEnabled()) {
   3.142 -						logger.debug("[Strabon.GeoJSON] Found geometry: {}", value);
   3.143 -					}
   3.144 -					
   3.145 -					nfeatures++;
   3.146 -					
   3.147 -					// we need the geometry and the SRID 
   3.148 -					Geometry geom = null;
   3.149 -					int srid = -1;
   3.150 -					
   3.151 -					if (value instanceof GeneralDBPolyhedron) {
   3.152 -						GeneralDBPolyhedron dbpolyhedron = (GeneralDBPolyhedron) value;
   3.153 -						
   3.154 -						geom = dbpolyhedron.getPolyhedron().getGeometry();
   3.155 -						srid = dbpolyhedron.getPolyhedron().getGeometry().getSRID();
   3.156 -						
   3.157 -					} else { // spatial literal WKT or GML
   3.158 -						
   3.159 -						if (XMLGSDatatypeUtil.isWKTLiteral((Literal) value)) {// WKT
   3.160 -							// get the WKT as it is present in the result
   3.161 -							String wkt = value.stringValue();
   3.162 -							
   3.163 -							// get its geometry
   3.164 -							geom = jts.WKTread(WKTHelper.getWithoutSRID(wkt));
   3.165 -							
   3.166 -							// get its SRID
   3.167 -							srid = WKTHelper.getSRID(wkt);
   3.168 -							
   3.169 -						} else { // TODO GML
   3.170 -							logger.warn("[Strabon.GeoJSON] GML is not supported yet.");
   3.171 -						}
   3.172 -					}
   3.173 -					
   3.174 -					SimpleFeatureTypeBuilder sftb = new SimpleFeatureTypeBuilder();
   3.175 -					sftb.setName("Feature_" + nresults + "_" + nfeatures);
   3.176 -					sftb.setCRS(CRS.decode("EPSG:" + srid));
   3.177 -					sftb.setSRS("EPSG:" + srid);
   3.178 -					sftb.add("geometry", Geometry.class);
   3.179 -					
   3.180 -					// add the feature in the list of features
   3.181 -					features.add(sftb);
   3.182 -					
   3.183 -					// add the geometry of the feature in the list of geometries
   3.184 -					geometries.add(geom);
   3.185 -					
   3.186 -				} else { // URI, BlankNode, or Literal other than geometry
   3.187 -					if (logger.isDebugEnabled()) {
   3.188 -						logger.debug("[Strabon.GeoJSON] Found resource: {}", value);
   3.189 -					}
   3.190 -					
   3.191 -					properties.add(binding.getName());
   3.192 -					values.add(value);
   3.193 -				}
   3.194 -			}
   3.195 -			
   3.196 -			// construct the feature of the result
   3.197 -			for (int i = 0; i < features.size(); i++) {
   3.198 -				SimpleFeatureTypeBuilder sftb = features.get(i);
   3.199 -				
   3.200 -				// add the properties
   3.201 -				for (int p = 0; p < properties.size(); p++) {
   3.202 -					sftb.add(properties.get(p), String.class);
   3.203 -				}
   3.204 -				
   3.205 -				SimpleFeatureType featureType = sftb.buildFeatureType();
   3.206 -				SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(featureType);				
   3.207 -				
   3.208 -				// add the geometry to the builder of the feature
   3.209 -				featureBuilder.add(geometries.get(i));
   3.210 -				
   3.211 -				// add the values to the builder of the feature
   3.212 -				for (int v = 0; v < values.size(); v++) {
   3.213 -					featureBuilder.add(values.get(v));
   3.214 -				}
   3.215 -				
   3.216 -				SimpleFeature feature = featureBuilder.buildFeature(null);
   3.217 -				sfCollection.add(feature);	
   3.218 -			}
   3.219 -			
   3.220 -			if (nfeatures == 0) {
   3.221 -				warn = true;
   3.222 -			}
   3.223 -			
   3.224 -		} catch (Exception e) {
   3.225 -			throw new TupleQueryResultHandlerException(e);
   3.226 -		}
   3.227 -					
   3.228 -	}
   3.229 -
   3.230 -	@Override
   3.231 -	public TupleQueryResultFormat getTupleQueryResultFormat() {
   3.232 -		return stSPARQLQueryResultFormat.GEOJSON;
   3.233 -	}
   3.234 -}
     4.1 --- a/resultio/src/main/java/org/openrdf/query/resultio/sparqljson/stSPARQLResultsGeoJSONWriterFactory.java	Mon Jun 25 20:03:10 2012 +0300
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,26 +0,0 @@
     4.4 -package org.openrdf.query.resultio.sparqljson;
     4.5 -
     4.6 -import java.io.OutputStream;
     4.7 -
     4.8 -import org.openrdf.query.resultio.TupleQueryResultFormat;
     4.9 -import org.openrdf.query.resultio.TupleQueryResultWriter;
    4.10 -import org.openrdf.query.resultio.TupleQueryResultWriterFactory;
    4.11 -import org.openrdf.query.resultio.stSPARQLQueryResultFormat;
    4.12 -
    4.13 -/**
    4.14 - * @author Charalampos Nikolaou <charnik@di.uoa.gr>
    4.15 - *
    4.16 - */
    4.17 -public class stSPARQLResultsGeoJSONWriterFactory implements TupleQueryResultWriterFactory {
    4.18 -
    4.19 -	@Override
    4.20 -	public TupleQueryResultFormat getTupleQueryResultFormat() {
    4.21 -		return stSPARQLQueryResultFormat.GEOJSON;
    4.22 -	}
    4.23 -
    4.24 -	@Override
    4.25 -	public TupleQueryResultWriter getWriter(OutputStream out) {
    4.26 -		return new stSPARQLResultsGeoJSONWriter(out);
    4.27 -	}
    4.28 -
    4.29 -}