semanticwfs  Version 0.1.0.0
GeoJSONFormatter Class Reference

Formats a query result to GeoJSON. More...

Inheritance diagram for GeoJSONFormatter:
Collaboration diagram for GeoJSONFormatter:

Public Member Functions

 GeoJSONFormatter ()
 Constructor for this class. More...
 
 GeoJSONFormatter (ResultStyleFormatter styleformatter)
 Constructor for this class receiving a customized style formatter. More...
 
String formatJSONObject (ResultSet results, String startingElement, String featuretype, String propertytype, String typeColumn, Boolean onlyproperty, Boolean onlyhits, String srsName, String indvar, String epsg, List< String > eligiblenamespaces, List< String > noteligiblenamespaces, StyleObject mapstyle, Boolean alternativeFormat, Boolean invertXY, Boolean coverage, Writer out)
 
JsonGenerator formatJSONStreaming (ResultSet results, String startingElement, String featuretype, String propertytype, String typeColumn, Boolean onlyproperty, Boolean onlyhits, String srsName, String indvar, String epsg, List< String > eligiblenamespaces, List< String > noteligiblenamespaces, StyleObject mapstyle, Boolean alternativeFormat, Boolean invertXY, Boolean coverage, Writer out, Boolean writeEnclosingObject) throws IOException
 
JsonGenerator formatter (ResultSet results, String startingElement, String featuretype, String propertytype, String typeColumn, Boolean onlyproperty, Boolean onlyhits, String srsName, String indvar, String epsg, List< String > eligiblenamespaces, List< String > noteligiblenamespaces, StyleObject mapstyle, Boolean alternativeFormat, Boolean invertXY, Boolean coverage, Writer out, Boolean internal) throws IOException
 
String formatter (ResultSet results, String startingElement, String featuretype, String propertytype, String typeColumn, Boolean onlyproperty, Boolean onlyhits, String srsName, String indvar, String epsg, List< String > eligiblenamespaces, List< String > noteligiblenamespaces, StyleObject mapstyle, Boolean alternativeFormat, Boolean invertXY, Boolean coverage, Writer out) throws IOException
 
void writeAsStream (JSONObject properties, JSONObject style, JSONObject geom, JsonGenerator jGenerator) throws IOException
 
void relToMap (String keyPath)
 
void addKeyValList (JSONObject properties, Collection< String > rell, Collection< String > vall)
 Adds a list of key and values to a JSONObject. More...
 
void addKeyVal (JSONObject properties, String rel, String val)
 Adds a key/value pair to a JSONObject, creates a JSONArray if neccessary. More...
 
String parseCoverageLiteral (String literalValue, String literalType, String epsg, String srsName)
 
String formatter (Model results, String startingElement, String featuretype, String propertytype, String typeColumn, Boolean onlyproperty, Boolean onlyhits, String srsName, String indvar, String epsg, List< String > eligiblenamespaces, List< String > noteligiblenamespaces, StyleObject mapstyle, Boolean alternativeFormat, Boolean invertXY, Boolean coverage, Writer out) throws XMLStreamException, IOException
 
Geometry parseVectorLiteral (String literalValue, String literalType, String epsg, String srsName)
 
Object parseLiteral (String literalValue, String literalType, String epsg, String srsName)
 

Static Public Member Functions

static ResultFormatter getFormatter (String formatString)
 

Public Attributes

Integer lastQueriedElemCount =0
 
String mimeType ="text/plain"
 
String exposedType ="application/vnd.geojson"
 
String urlformat ="json"
 
String label ="JSON"
 
String definition =""
 
String fileextension ="json"
 
Boolean constructQuery =false
 
Map< String, String > contextMapper =new TreeMap<>()
 
ResultStyleFormatter styleformatter
 
WKTReader wktreader =new WKTReader()
 
WKBReader wkbreader =new WKBReader()
 
KMLReader kmlreader =new KMLReader()
 
GeoJSONReader geojsonreader =new GeoJSONReader()
 

Static Public Attributes

static final String WKTLiteral ="http://www.opengis.net/ont/geosparql#wktLiteral"
 
static Map< String, ResultFormatterresultMap =new TreeMap<String, ResultFormatter>()
 
static Map< String, String > labelMap =new TreeMap<>()
 
static Set< String > vectorLiteralMap =new TreeSet<>()
 
static Set< String > coverageLiteralMap =new TreeSet<>()
 
static final Integer FLUSHTHRESHOLD =20
 
static final String[] mediatypes
 

Static Package Functions

static void addToMaps (String key, ResultFormatter format)
 
 [static initializer]
 

Package Attributes

String featureType =""
 

Detailed Description

Formats a query result to GeoJSON.

Constructor & Destructor Documentation

◆ GeoJSONFormatter() [1/2]

Constructor for this class.

40  {
41  this.mimeType="application/json";
42  this.exposedType="application/geojson";
43  this.urlformat="json";
44  this.label="GeoJSON";
45  this.styleformatter=new GeoJSONCSSFormatter();
46  this.fileextension="geojson";
47  this.definition="https://geojson.org";
48  }
String mimeType
Definition: ResultFormatter.java:89
String definition
Definition: ResultFormatter.java:97
ResultStyleFormatter styleformatter
Definition: ResultFormatter.java:105
String fileextension
Definition: ResultFormatter.java:99
String exposedType
Definition: ResultFormatter.java:91
String urlformat
Definition: ResultFormatter.java:93
String label
Definition: ResultFormatter.java:95

References ResultFormatter.definition, ResultFormatter.exposedType, ResultFormatter.fileextension, ResultFormatter.label, ResultFormatter.mimeType, ResultFormatter.styleformatter, and ResultFormatter.urlformat.

◆ GeoJSONFormatter() [2/2]

Constructor for this class receiving a customized style formatter.

53  {
54  this.mimeType="application/json";
55  this.exposedType="application/geojson";
57  }

References ResultFormatter.exposedType, ResultFormatter.mimeType, and ResultFormatter.styleformatter.

Member Function Documentation

◆ [static initializer]()

[static initializer]
staticpackageinherited

◆ addKeyVal()

void addKeyVal ( JSONObject  properties,
String  rel,
String  val 
)

Adds a key/value pair to a JSONObject, creates a JSONArray if neccessary.

Parameters
propertiesthe JSONObject
relRelation to add
valValue to add
916  {
917  if(!this.contextMapper.containsKey(rel)) {
918  this.relToMap(rel);
919  }
920  if(properties.has(rel)) {
921  try {
922  properties.getJSONArray(rel).put(val);
923  }catch(JSONException e) {
924  String oldval=properties.getString(rel);
925  properties.put(rel,new JSONArray());
926  properties.getJSONArray(rel).put(oldval);
927  properties.getJSONArray(rel).put(val);
928  }
929  }else {
930  properties.put(rel, val);
931  }
932  }
Map< String, String > contextMapper
Definition: ResultFormatter.java:103
void relToMap(String keyPath)
Definition: GeoJSONFormatter.java:828

References ResultFormatter.contextMapper, and GeoJSONFormatter.relToMap().

Referenced by GeoJSONFormatter.formatJSONObject(), and GeoJSONFormatter.formatJSONStreaming().

◆ addKeyValList()

void addKeyValList ( JSONObject  properties,
Collection< String >  rell,
Collection< String >  vall 
)

Adds a list of key and values to a JSONObject.

Parameters
propertiesthe JSONObject
rellthe list of relations
vallthe list of values
861  {
862  //System.out.println("AddKeyValList");
863  //System.out.println(rell.toString());
864  //System.out.println(vall.toString());
865  Iterator<String> reliter=rell.iterator();
866  Iterator<String> valiter=vall.iterator();
867  String lastval="";
868  while(valiter.hasNext()) {
869  lastval=valiter.next();
870  }
871  //System.out.println(properties);
872  while(reliter.hasNext()) {
873  String rel=reliter.next();
874  if(properties.has(rel)) {
875  if(reliter.hasNext()) {
876  properties=properties.getJSONObject(rel);
877  continue;
878  }
879  try {
880  properties.getJSONArray(rel).put(lastval);
881  }catch(JSONException e) {
882  String oldval=properties.getString(rel);
883  if(!this.contextMapper.containsKey(rel)) {
884  this.relToMap(rel);
885  }
886  properties.put(rel,new JSONArray());
887  properties.getJSONArray(rel).put(oldval);
888  properties.getJSONArray(rel).put(lastval);
889  }
890  }else {
891  if(reliter.hasNext()) {
892  if(!this.contextMapper.containsKey(rel)) {
893  this.relToMap(rel);
894  }
895  properties.put(rel, new JSONObject());
896  properties=properties.getJSONObject(rel);
897  continue;
898  }else {
899  if(!this.contextMapper.containsKey(rel)) {
900  this.relToMap(rel);
901  }
902  properties.put(rel, lastval);
903  }
904  }
905  //properties=properties.getJSONObject(rel);
906  }
907 
908  }

References ResultFormatter.contextMapper, and GeoJSONFormatter.relToMap().

Referenced by GeoJSONFormatter.formatJSONObject(), and GeoJSONFormatter.formatJSONStreaming().

◆ addToMaps()

static void addToMaps ( String  key,
ResultFormatter  format 
)
staticpackageinherited
288  {
289  resultMap.put(key, format);
290  labelMap.put(key,format.label);
291  resultMap.put(format.mimeType, format);
292  }
static Map< String, String > labelMap
Definition: ResultFormatter.java:115
static Map< String, ResultFormatter > resultMap
Definition: ResultFormatter.java:85

References ResultFormatter.label, ResultFormatter.labelMap, ResultFormatter.mimeType, and ResultFormatter.resultMap.

◆ formatJSONObject()

String formatJSONObject ( ResultSet  results,
String  startingElement,
String  featuretype,
String  propertytype,
String  typeColumn,
Boolean  onlyproperty,
Boolean  onlyhits,
String  srsName,
String  indvar,
String  epsg,
List< String >  eligiblenamespaces,
List< String >  noteligiblenamespaces,
StyleObject  mapstyle,
Boolean  alternativeFormat,
Boolean  invertXY,
Boolean  coverage,
Writer  out 
)
66  {
68  this.contextMapper.clear();
69  JSONObject geojsonresults = new JSONObject();
70  List<JSONArray> allfeatures = new LinkedList<JSONArray>();
71  JSONObject result = new JSONObject();
72  JSONArray obj = new JSONArray();
73  Boolean first = true;
74  String geomvarname = "";
75  String relationName = "";
76  String lastgeom = "";
77  Integer counter = 0;
78  Boolean newobject = true;
79  geojsonresults.put("type", "FeatureCollection");
80  geojsonresults.put("name", featuretype);
81  //TODO Write GeoJSON styles
82  JSONArray features = new JSONArray();
83  allfeatures.add(features);
84  geojsonresults.put("features", features);
85  List<String> latlist=new LinkedList<String>();
86  List<String> lonlist=new LinkedList<String>();
87  Map<String,String> rel = new TreeMap<String,String>();
88  Map<String,String> val=new TreeMap<String,String>();
89  String lastInd = "",lat="",lon="";
90  JSONObject jsonobj = new JSONObject();
91  JSONObject properties = new JSONObject();
92  JSONObject style = new JSONObject();
93  List<JSONObject> geoms = new LinkedList<JSONObject>();
94  while (results.hasNext()) {
95  // System.out.println(i);
96  QuerySolution solu = results.next();
97  Iterator<String> varnames = solu.varNames();
98  int geomvars = 0;
99  //System.out.println(solu.get(featuretype.toLowerCase()).toString() + " - " + lastInd);
100  if (!solu.get(indvar).toString().equals(lastInd) || lastInd.isEmpty()) {
101  //System.out.println("NEW OBJECT!");
102  //System.out.println("HasStyle??? - "+mapstyle);
103  //System.out.println(latlist+" - "+lonlist);
104  if(!latlist.isEmpty() && !lonlist.isEmpty()) {
105  if(latlist.size()==1 && lonlist.size()==1) {
106  Coordinate coord=ReprojectionUtils.reproject(Double.valueOf(lonlist.get(0)), Double.valueOf(latlist.get(0)), epsg,srsName);
107  JSONObject geomobj=new JSONObject("{\"type\":\"Point\",\"coordinates\":["+coord.x+","+coord.y+"]}");
108  geoms.add(geomobj);
109  properties.put("lon",coord.x);
110  properties.put("lat", coord.y);
111  if(mapstyle!=null) {
112  JSONObject geojsonstyle=new JSONObject(this.styleformatter.formatGeometry("Point", mapstyle));
113  System.out.println("Got style? - "+geojsonstyle);
114  for(String key:geojsonstyle.keySet()) {
115  style.put(key,geojsonstyle.get(key));
116  }
117  }
118  }else if(latlist.get(latlist.size()-1).equals(latlist.get(0))
119  && lonlist.get(lonlist.size()-1).equals(lonlist.get(0))) {
120  JSONObject geomobj=new JSONObject();
121  geomobj.put("type","Polygon");
122  JSONArray arr=new JSONArray();
123  JSONArray arr2=new JSONArray();
124  arr.put(arr2);
125  String lit="Polygon(";
126  geomobj.put("coordinates",arr);
127  for(int i=0;i<latlist.size();i++) {
128  JSONArray arr3=new JSONArray();
129  Coordinate coord=ReprojectionUtils.reproject(Double.valueOf(lonlist.get(i)), Double.valueOf(latlist.get(i)), epsg,srsName);
130  arr3.put(coord.x);
131  arr3.put(coord.y);
132  lit+=coord.x+" "+coord.y;//lonlist.get(i)+" "+latlist.get(i)+",";
133  //lit+=lonlist.get(i)+" "+latlist.get(i)+",";
134  arr2.put(arr3);
135  }
136  geoms.add(geomobj);
137  if(mapstyle!=null) {
138  JSONObject geojsonstyle=new JSONObject(this.styleformatter.formatGeometry("Polygon", mapstyle));
139  System.out.println("Got style? - "+geojsonstyle);
140  for(String key:geojsonstyle.keySet()) {
141  style.put(key,geojsonstyle.get(key));
142  }
143  }
144  properties.put("geometry", lit.substring(0,lit.length()-1)+")");
145  }else if(!latlist.get(latlist.size()-1).equals(latlist.get(0)) || !lonlist.get(lonlist.size()-1).equals(lonlist.get(0))) {
146  JSONObject geomobj=new JSONObject();
147  geomobj.put("type","LineString");
148  JSONArray arr=new JSONArray();
149  String lit="LineString(";
150  geomobj.put("coordinates",arr);
151  for(int i=0;i<latlist.size();i++) {
152  JSONArray arr2=new JSONArray();
153  Coordinate coord=ReprojectionUtils.reproject(Double.valueOf(lonlist.get(i)), Double.valueOf(latlist.get(i)), epsg,srsName);
154  arr2.put(coord.x);
155  arr2.put(coord.y);
156  lit+=coord.x+" "+coord.y;//lonlist.get(i)+" "+latlist.get(i)+",";
157  //lit+=lonlist.get(i)+" "+latlist.get(i)+",";
158  arr.put(arr2);
159  }
160  geoms.add(geomobj);
161  if(mapstyle!=null) {
162  JSONObject geojsonstyle=new JSONObject(this.styleformatter.formatGeometry("LineString", mapstyle));
163  System.out.println("Got style? - "+geojsonstyle);
164  for(String key:geojsonstyle.keySet()) {
165  style.put(key,geojsonstyle.get(key));
166  }
167  }
168  properties.put("geometry", lit.substring(0,lit.length()-1)+")");
169  }
170  latlist.clear();
171  lonlist.clear();
172  }
173  newobject = true;
174  } else {
175  newobject = false;
176  }
177  if (newobject) {
179  // System.out.println("Geomvars: "+geomvars);
180  if(!onlyproperty) {
181  int geomcounter = 0;
182  //System.out.println("CREATING NEW FEATURE!");
183  //System.out.println(geoms);
184  for (JSONObject geom : geoms) {
185  JSONObject geojsonobj = new JSONObject();
186  geojsonobj.put("type", "Feature");
187  geojsonobj.put("properties", properties);
188  geojsonobj.put("geometry", geom);
189  if(!style.isEmpty())
190  geojsonobj.put("style", style);
191  geojsonobj.put("id",lastInd);
192  //allfeatures.get(geomcounter).put(geojsonobj);
193  features.put(geojsonobj);
194 
195  //System.out.println(geojsonobj);
196  geomcounter++;
197  }
198  }else {
199  JSONObject geojsonobj = new JSONObject();
200  geojsonobj.put("type", "Feature");
201  geojsonobj.put("properties", properties);
202  if(!style.isEmpty()) {
203  if(this.styleformatter.styleAttribute.equalsIgnoreCase("properties")) {
204  for(String key:style.keySet()) {
205  properties.put(key, style.get(key));
206  }
207  }else if(this.styleformatter.styleAttribute.isEmpty()){
208  geojsonobj.put("style", style);
209  }else {
210  geojsonobj.put(this.styleformatter.styleAttribute, style);
211  }
212  }
213 
214  geojsonobj.put("id",lastInd);
215  if(!geoms.isEmpty())
216  geojsonobj.put("geometry",geoms.get(0));
217  //allfeatures.get(geomcounter).put(geojsonobj);
218  features.put(geojsonobj);
219  }
220  geomvars=0;
221  jsonobj = new JSONObject();
222  properties = new JSONObject();
223  style=new JSONObject();
224  geoms = new LinkedList<JSONObject>();
225  }
226  while (varnames.hasNext()) {
227  String name = varnames.next();
228  // System.out.println(name);
229  // if (newobject) {
230  if (name.endsWith("_geom")) {
231  // System.out.println("Geomvar: "+name);
232  geomvars++;
233  geomvarname = name;
234 
235  lastgeom = solu.get(name).toString();
236  Geometry geom=this.parseVectorLiteral(solu.get(name).toString().substring(0,solu.get(name).toString().indexOf("^^")),
237  solu.get(name).toString().substring(solu.get(name).toString().indexOf("^^")+2), epsg, srsName);
238  if(geom!=null) {
239  GeoJSONWriter writer = new GeoJSONWriter();
240  GeoJSON geomobj = writer.write(geom);
241  geoms.add(new JSONObject(geomobj.toString()));
242  if(mapstyle!=null) {
243  JSONObject geojsonstyle=new JSONObject(this.styleformatter.formatGeometry(geomobj.getType(), mapstyle));
244  System.out.println("Got style? - "+geojsonstyle);
245  for(String key:geojsonstyle.keySet()) {
246  style.put(key,geojsonstyle.get(key));
247  }
248  }
249  }
250  addKeyVal(properties, name, solu.get(name).toString());
251  }
252  if (name.endsWith("_rel") || name.equals("rel") || name.matches("rel[0-9]+$")) {
253  relationName = solu.get(name).toString();
254  rel.put(name,solu.get(name).toString());
255  }else if (name.endsWith("_val") || name.equals("val") || name.matches("val[0-9]+$")) {
256  val.put(name,solu.get(name).toString());
257  }else if (name.equals("lat")) {
258  lat = solu.get(name).toString();
259  }else if (name.equals("lon")) {
260  lon = solu.get(name).toString();
261  }else if (name.equalsIgnoreCase(indvar)) {
262  continue;
263  } else {
264  if (!relationName.isEmpty()) {
265  // System.out.println("Putting property: "+relationName+" - "+solu.get(name));
266  addKeyVal(properties, relationName, solu.get(name).toString());
267  } else {
268  addKeyVal(properties, name, solu.get(name).toString());
269  }
270  }
271  // System.out.println(relationName);
272  // System.out.println(name);
273  // System.out.println(solu.get(name));
274  // if(!geojsonout) {
275  jsonobj.put(name, solu.get(name));
276  // System.out.println(geojsonresults);
277  obj.put(jsonobj);
278  // }
279  }
280  if (!rel.isEmpty() && !val.isEmpty()) {
281  System.out.println("Rel: "+rel.toString());
282  System.out.println("Val: "+val.toString());
283  if(!rel.values().iterator().next().equals("http://www.opengis.net/ont/geosparql#hasGeometry") && rel.size()==1) {
284  addKeyVal(properties, rel.values().iterator().next(), val.values().iterator().next());
285  }else if(rel.size()>1) {
286  addKeyValList(properties, rel.values(), val.values());
287  }else {
288  addKeyVal(properties, rel.values().iterator().next(), val.values().iterator().next());
289  }
290 
291  rel.clear();
292  val.clear();
293  }
294  if(!lat.isEmpty() && !lon.isEmpty()) {
295  System.out.println("LatLon: "+lat+","+lon);
296  if(lat.contains("^^")) {
297  lat=lat.substring(0,lat.indexOf("^^"));
298  }
299  if(lon.contains("^^")) {
300  lon=lon.substring(0,lon.indexOf("^^"));
301  }
302  lonlist.add(lon);
303  latlist.add(lat);
304  lat="";
305  lon="";
306  }
307  first = false;
308  lastInd = solu.get(indvar).toString();
309  }
310  System.out.println("LastLat: "+latlist.toString()+" "+lonlist.toString());
311  if(!latlist.isEmpty() && !lonlist.isEmpty()) {
312  if(latlist.size()==1 && lonlist.size()==1) {
313  Coordinate coord=ReprojectionUtils.reproject(Double.valueOf(lonlist.get(0)), Double.valueOf(latlist.get(0)), epsg,srsName);
314  JSONObject geomobj=new JSONObject("{\"type\":\"Point\",\"coordinates\":["+coord.x+","+coord.y+"]}");
315  geoms.add(geomobj);
316  properties.put("lon",coord.x);
317  properties.put("lat", coord.y);
318  if(mapstyle!=null) {
319  JSONObject geojsonstyle=new JSONObject(this.styleformatter.formatGeometry("Point", mapstyle));
320  System.out.println("Got style? - "+geojsonstyle);
321  for(String key:geojsonstyle.keySet()) {
322  style.put(key,geojsonstyle.get(key));
323  }
324  }
325  }else if(latlist.get(latlist.size()-1).equals(latlist.get(0)) && lonlist.get(lonlist.size()-1).equals(lonlist.get(0))) {
326  JSONObject geomobj=new JSONObject();
327  geomobj.put("type","Polygon");
328  JSONArray arr=new JSONArray();
329  JSONArray arr2=new JSONArray();
330  arr.put(arr2);
331  String lit="Polygon(";
332  geomobj.put("coordinates",arr);
333  for(int i=0;i<latlist.size();i++) {
334  JSONArray arr3=new JSONArray();
335  Coordinate coord=ReprojectionUtils.reproject(Double.valueOf(lonlist.get(i)), Double.valueOf(latlist.get(i)), epsg,srsName);
336  arr3.put(coord.x);
337  arr3.put(coord.y);
338  //arr3.put(lonlist.get(i));
339  //arr3.put(latlist.get(i));
340  lit+=coord.x+" "+coord.y;//lonlist.get(i)+" "+latlist.get(i)+",";
341  arr2.put(arr3);
342  }
343  geoms.add(geomobj);
344  if(mapstyle!=null) {
345  JSONObject geojsonstyle=new JSONObject(this.styleformatter.formatGeometry("Polygon", mapstyle));
346  System.out.println("Got style? - "+geojsonstyle);
347  for(String key:geojsonstyle.keySet()) {
348  style.put(key,geojsonstyle.get(key));
349  }
350  }
351  properties.put("geometry", lit.substring(0,lit.length()-1)+")");
352  }else if(!latlist.get(latlist.size()-1).equals(latlist.get(0)) || !lonlist.get(lonlist.size()-1).equals(lonlist.get(0))) {
353  JSONObject geomobj=new JSONObject();
354  geomobj.put("type","LineString");
355  JSONArray arr=new JSONArray();
356  String lit="LineString(";
357  geomobj.put("coordinates",arr);
358  for(int i=0;i<latlist.size();i++) {
359  JSONArray arr2=new JSONArray();
360  Coordinate coord=ReprojectionUtils.reproject(Double.valueOf(lonlist.get(i)), Double.valueOf(latlist.get(i)), epsg,srsName);
361  arr2.put(coord.x);
362  arr2.put(coord.y);
363  //arr2.put(lonlist.get(i));
364  //arr2.put(latlist.get(i));
365  lit+=coord.x+" "+coord.y;//lonlist.get(i)+" "+latlist.get(i)+",";
366  //lit+=lonlist.get(i)+" "+latlist.get(i)+",";
367  arr.put(arr2);
368  }
369  geoms.add(geomobj);
370  if(mapstyle!=null) {
371  JSONObject geojsonstyle=new JSONObject(this.styleformatter.formatGeometry("LineString", mapstyle));
372  System.out.println("Got style? - "+geojsonstyle);
373  for(String key:geojsonstyle.keySet()) {
374  style.put(key,geojsonstyle.get(key));
375  }
376  }
377  properties.put("geometry", lit.substring(0,lit.length()-1)+")");
378  }
379  latlist.clear();
380  lonlist.clear();
381  }
382  if(!onlyproperty) {
383  for (JSONObject geom : geoms) {
384  JSONObject geojsonobj = new JSONObject();
385  geojsonobj.put("type", "Feature");
386  geojsonobj.put("properties", properties);
387  if(!style.isEmpty())
388  geojsonobj.put("style", style);
389  geojsonobj.put("geometry", geom);
390  geojsonobj.put("id",lastInd);
391  //allfeatures.get(geomcounter).put(geojsonobj);
392  features.put(geojsonobj);
393  //System.out.println(geojsonobj);
394  }
395  }else {
396  JSONObject geojsonobj = new JSONObject();
397  geojsonobj.put("type", "Feature");
398  if(!style.isEmpty())
399  geojsonobj.put("style", style);
400  geojsonobj.put("properties", properties);
401  geojsonobj.put("id",lastInd);
402  if(!geoms.isEmpty())
403  geojsonobj.put("geometry",geoms.get(0));
404  //allfeatures.get(geomcounter).put(geojsonobj);
405  features.put(geojsonobj);
406  }
407  //System.out.println(obj);
408  //System.out.println(geojsonresults.toString(2));
409  return geojsonresults.toString(2);
410 
411  }
Integer lastQueriedElemCount
Definition: ResultFormatter.java:87
Geometry parseVectorLiteral(String literalValue, String literalType, String epsg, String srsName)
Definition: ResultFormatter.java:368
void addKeyVal(JSONObject properties, String rel, String val)
Adds a key/value pair to a JSONObject, creates a JSONArray if neccessary.
Definition: GeoJSONFormatter.java:916
void addKeyValList(JSONObject properties, Collection< String > rell, Collection< String > vall)
Adds a list of key and values to a JSONObject.
Definition: GeoJSONFormatter.java:861
abstract String formatGeometry(String geometrytype, StyleObject styleobj)
Formats a geometry according to a given geometrytype using information from a given styleobj.
String styleAttribute
Definition: ResultStyleFormatter.java:24

References GeoJSONFormatter.addKeyVal(), GeoJSONFormatter.addKeyValList(), ResultFormatter.contextMapper, ResultStyleFormatter.formatGeometry(), ResultFormatter.lastQueriedElemCount, ResultFormatter.parseVectorLiteral(), ReprojectionUtils.reproject(), ResultStyleFormatter.styleAttribute, and ResultFormatter.styleformatter.

Referenced by GeoJSONFormatter.formatter().

◆ formatJSONStreaming()

JsonGenerator formatJSONStreaming ( ResultSet  results,
String  startingElement,
String  featuretype,
String  propertytype,
String  typeColumn,
Boolean  onlyproperty,
Boolean  onlyhits,
String  srsName,
String  indvar,
String  epsg,
List< String >  eligiblenamespaces,
List< String >  noteligiblenamespaces,
StyleObject  mapstyle,
Boolean  alternativeFormat,
Boolean  invertXY,
Boolean  coverage,
Writer  out,
Boolean  writeEnclosingObject 
) throws IOException
419  {
421  this.contextMapper.clear();
422  JsonFactory jfactory = new JsonFactory();
423  JsonGenerator jGenerator = jfactory.createGenerator(out);
424  jGenerator.writeStartObject();
425  jGenerator.writeStringField("type", "FeatureCollection");
426  jGenerator.writeStringField("name", featuretype);
427  jGenerator.writeArrayFieldStart("features");
428  JSONObject geojsonresults = new JSONObject();
429  List<JSONArray> allfeatures = new LinkedList<JSONArray>();
430  JSONObject result = new JSONObject();
431  JSONArray obj = new JSONArray();
432  Boolean first = true;
433  String geomvarname = "";
434  String relationName = "";
435  String lastgeom = "";
436  Integer counter = 0;
437  Boolean newobject = true;
438  geojsonresults.put("type", "FeatureCollection");
439  geojsonresults.put("name", featuretype);
440  //TODO Write GeoJSON styles
441  JSONArray features = new JSONArray();
442  allfeatures.add(features);
443  geojsonresults.put("features", features);
444  List<String> latlist=new LinkedList<String>();
445  List<String> lonlist=new LinkedList<String>();
446  Map<String,String> rel = new TreeMap<String,String>();
447  Map<String,String> val=new TreeMap<String,String>();
448  String lastInd = "",lat="",lon="";
449  JSONObject jsonobj = new JSONObject();
450  JSONObject properties = new JSONObject();
451  JSONObject style = new JSONObject();
452  List<JSONObject> geoms = new LinkedList<JSONObject>();
453  while (results.hasNext()) {
454  // System.out.println(i);
455  QuerySolution solu = results.next();
456  Iterator<String> varnames = solu.varNames();
457  int geomvars = 0;
458  //System.out.println(solu.get(featuretype.toLowerCase()).toString() + " - " + lastInd);
459  if (!solu.get(indvar).toString().equals(lastInd) || lastInd.isEmpty()) {
460  //System.out.println("NEW OBJECT!");
461  //System.out.println("HasStyle??? - "+mapstyle);
462  //System.out.println(latlist+" - "+lonlist);
463  if(!latlist.isEmpty() && !lonlist.isEmpty()) {
464  if(latlist.size()==1 && lonlist.size()==1) {
465  Coordinate coord=ReprojectionUtils.reproject(Double.valueOf(lonlist.get(0)), Double.valueOf(latlist.get(0)), epsg,srsName);
466  JSONObject geomobj=new JSONObject("{\"type\":\"Point\",\"coordinates\":["+coord.x+","+coord.y+"]}");
467  geoms.add(geomobj);
468  properties.put("lon",coord.x);
469  properties.put("lat", coord.y);
470  if(mapstyle!=null) {
471  JSONObject geojsonstyle=new JSONObject(this.styleformatter.formatGeometry("Point", mapstyle));
472  System.out.println("Got style? - "+geojsonstyle);
473  for(String key:geojsonstyle.keySet()) {
474  style.put(key,geojsonstyle.get(key));
475  }
476  }
477  }else if(latlist.get(latlist.size()-1).equals(latlist.get(0))
478  && lonlist.get(lonlist.size()-1).equals(lonlist.get(0))) {
479  JSONObject geomobj=new JSONObject();
480  geomobj.put("type","Polygon");
481  JSONArray arr=new JSONArray();
482  JSONArray arr2=new JSONArray();
483  arr.put(arr2);
484  String lit="Polygon(";
485  geomobj.put("coordinates",arr);
486  for(int i=0;i<latlist.size();i++) {
487  JSONArray arr3=new JSONArray();
488  Coordinate coord=ReprojectionUtils.reproject(Double.valueOf(lonlist.get(i)), Double.valueOf(latlist.get(i)), epsg,srsName);
489  arr3.put(coord.x);
490  arr3.put(coord.y);
491  lit+=coord.x+" "+coord.y;//lonlist.get(i)+" "+latlist.get(i)+",";
492  //lit+=lonlist.get(i)+" "+latlist.get(i)+",";
493  arr2.put(arr3);
494  }
495  geoms.add(geomobj);
496  if(mapstyle!=null) {
497  JSONObject geojsonstyle=new JSONObject(this.styleformatter.formatGeometry("Polygon", mapstyle));
498  System.out.println("Got style? - "+geojsonstyle);
499  for(String key:geojsonstyle.keySet()) {
500  style.put(key,geojsonstyle.get(key));
501  }
502  }
503  properties.put("geometry", lit.substring(0,lit.length()-1)+")");
504  }else if(!latlist.get(latlist.size()-1).equals(latlist.get(0)) || !lonlist.get(lonlist.size()-1).equals(lonlist.get(0))) {
505  JSONObject geomobj=new JSONObject();
506  geomobj.put("type","LineString");
507  JSONArray arr=new JSONArray();
508  String lit="LineString(";
509  geomobj.put("coordinates",arr);
510  for(int i=0;i<latlist.size();i++) {
511  JSONArray arr2=new JSONArray();
512  Coordinate coord=ReprojectionUtils.reproject(Double.valueOf(lonlist.get(i)), Double.valueOf(latlist.get(i)), epsg,srsName);
513  arr2.put(coord.x);
514  arr2.put(coord.y);
515  lit+=coord.x+" "+coord.y;//lonlist.get(i)+" "+latlist.get(i)+",";
516  //lit+=lonlist.get(i)+" "+latlist.get(i)+",";
517  arr.put(arr2);
518  }
519  geoms.add(geomobj);
520  if(mapstyle!=null) {
521  JSONObject geojsonstyle=new JSONObject(this.styleformatter.formatGeometry("LineString", mapstyle));
522  System.out.println("Got style? - "+geojsonstyle);
523  for(String key:geojsonstyle.keySet()) {
524  style.put(key,geojsonstyle.get(key));
525  }
526  }
527  properties.put("geometry", lit.substring(0,lit.length()-1)+")");
528  }
529  latlist.clear();
530  lonlist.clear();
531  }
532  newobject = true;
533  } else {
534  newobject = false;
535  }
536  if (newobject) {
538  // System.out.println("Geomvars: "+geomvars);
539  if(!onlyproperty) {
540  int geomcounter = 0;
541  //System.out.println("CREATING NEW FEATURE!");
542  //System.out.println(geoms);
543  for (JSONObject geom : geoms) {
544  JSONObject geojsonobj = new JSONObject();
545  geojsonobj.put("type", "Feature");
546  geojsonobj.put("properties", properties);
547  geojsonobj.put("geometry", geom);
548  if(!style.isEmpty())
549  geojsonobj.put("style", style);
550  geojsonobj.put("id",lastInd);
551  //allfeatures.get(geomcounter).put(geojsonobj);
552  writeAsStream(properties, style, geom, jGenerator);
553  //features.put(geojsonobj);
554  //System.out.println(geojsonobj);
555  geomcounter++;
556  }
557  }else {
558  JSONObject geojsonobj = new JSONObject();
559  geojsonobj.put("type", "Feature");
560  geojsonobj.put("properties", properties);
561  if(!style.isEmpty()) {
562  if(this.styleformatter.styleAttribute.equalsIgnoreCase("properties")) {
563  for(String key:style.keySet()) {
564  properties.put(key, style.get(key));
565  }
566  }else if(this.styleformatter.styleAttribute.isEmpty()){
567  geojsonobj.put("style", style);
568  }else {
569  geojsonobj.put(this.styleformatter.styleAttribute, style);
570  }
571  }
572 
573  geojsonobj.put("id",lastInd);
574  if(!geoms.isEmpty())
575  geojsonobj.put("geometry",geoms.get(0));
576  //allfeatures.get(geomcounter).put(geojsonobj);
577  writeAsStream(properties, style, geoms.get(0), jGenerator);
578  features.put(geojsonobj);
579  }
580  geomvars=0;
581  jsonobj = new JSONObject();
582  properties = new JSONObject();
583  style=new JSONObject();
584  geoms = new LinkedList<JSONObject>();
585  }
586  while (varnames.hasNext()) {
587  String name = varnames.next();
588  // System.out.println(name);
589  // if (newobject) {
590  if (name.endsWith("_geom")) {
591  // System.out.println("Geomvar: "+name);
592  geomvars++;
593  geomvarname = name;
594 
595  lastgeom = solu.get(name).toString();
596  Geometry geom=this.parseVectorLiteral(solu.get(name).toString().substring(0,solu.get(name).toString().indexOf("^^")),
597  solu.get(name).toString().substring(solu.get(name).toString().indexOf("^^")+2), epsg, srsName);
598  if(geom!=null) {
599  GeoJSONWriter writer = new GeoJSONWriter();
600  GeoJSON geomobj = writer.write(geom);
601  geoms.add(new JSONObject(geomobj.toString()));
602  if(mapstyle!=null) {
603  JSONObject geojsonstyle=new JSONObject(this.styleformatter.formatGeometry(geomobj.getType(), mapstyle));
604  System.out.println("Got style? - "+geojsonstyle);
605  for(String key:geojsonstyle.keySet()) {
606  style.put(key,geojsonstyle.get(key));
607  }
608  }
609  }
610  addKeyVal(properties, name, solu.get(name).toString());
611  }
612  if (name.endsWith("_rel") || name.equals("rel") || name.matches("rel[0-9]+$")) {
613  relationName = solu.get(name).toString();
614  rel.put(name,solu.get(name).toString());
615  }else if (name.endsWith("_val") || name.equals("val") || name.matches("val[0-9]+$")) {
616  val.put(name,solu.get(name).toString());
617  }else if (name.equals("lat")) {
618  lat = solu.get(name).toString();
619  }else if (name.equals("lon")) {
620  lon = solu.get(name).toString();
621  }else if (name.equalsIgnoreCase(indvar)) {
622  continue;
623  } else {
624  if (!relationName.isEmpty()) {
625  // System.out.println("Putting property: "+relationName+" - "+solu.get(name));
626  addKeyVal(properties, relationName, solu.get(name).toString());
627  } else {
628  addKeyVal(properties, name, solu.get(name).toString());
629  }
630  }
631  // System.out.println(relationName);
632  // System.out.println(name);
633  // System.out.println(solu.get(name));
634  // if(!geojsonout) {
635  jsonobj.put(name, solu.get(name));
636  // System.out.println(geojsonresults);
637  obj.put(jsonobj);
638  // }
639  }
640  if (!rel.isEmpty() && !val.isEmpty()) {
641  System.out.println("Rel: "+rel.toString());
642  System.out.println("Val: "+val.toString());
643  if(!rel.values().iterator().next().equals("http://www.opengis.net/ont/geosparql#hasGeometry") && rel.size()==1) {
644  addKeyVal(properties, rel.values().iterator().next(), val.values().iterator().next());
645  }else if(rel.size()>1) {
646  addKeyValList(properties, rel.values(), val.values());
647  }else {
648  addKeyVal(properties, rel.values().iterator().next(), val.values().iterator().next());
649  }
650 
651  rel.clear();
652  val.clear();
653  }
654  if(!lat.isEmpty() && !lon.isEmpty()) {
655  System.out.println("LatLon: "+lat+","+lon);
656  if(lat.contains("^^")) {
657  lat=lat.substring(0,lat.indexOf("^^"));
658  }
659  if(lon.contains("^^")) {
660  lon=lon.substring(0,lon.indexOf("^^"));
661  }
662  lonlist.add(lon);
663  latlist.add(lat);
664  lat="";
665  lon="";
666  }
667  first = false;
668  lastInd = solu.get(indvar).toString();
669  }
670  System.out.println("LastLat: "+latlist.toString()+" "+lonlist.toString());
671  if(!latlist.isEmpty() && !lonlist.isEmpty()) {
672  if(latlist.size()==1 && lonlist.size()==1) {
673  Coordinate coord=ReprojectionUtils.reproject(Double.valueOf(lonlist.get(0)), Double.valueOf(latlist.get(0)), epsg,srsName);
674  JSONObject geomobj=new JSONObject("{\"type\":\"Point\",\"coordinates\":["+coord.x+","+coord.y+"]}");
675  geoms.add(geomobj);
676  properties.put("lon",coord.x);
677  properties.put("lat", coord.y);
678  if(mapstyle!=null) {
679  JSONObject geojsonstyle=new JSONObject(this.styleformatter.formatGeometry("Point", mapstyle));
680  System.out.println("Got style? - "+geojsonstyle);
681  for(String key:geojsonstyle.keySet()) {
682  style.put(key,geojsonstyle.get(key));
683  }
684  }
685  }else if(latlist.get(latlist.size()-1).equals(latlist.get(0)) && lonlist.get(lonlist.size()-1).equals(lonlist.get(0))) {
686  JSONObject geomobj=new JSONObject();
687  geomobj.put("type","Polygon");
688  JSONArray arr=new JSONArray();
689  JSONArray arr2=new JSONArray();
690  arr.put(arr2);
691  String lit="Polygon(";
692  geomobj.put("coordinates",arr);
693  for(int i=0;i<latlist.size();i++) {
694  JSONArray arr3=new JSONArray();
695  Coordinate coord=ReprojectionUtils.reproject(Double.valueOf(lonlist.get(i)), Double.valueOf(latlist.get(i)), epsg,srsName);
696  arr3.put(coord.x);
697  arr3.put(coord.y);
698  //arr3.put(lonlist.get(i));
699  //arr3.put(latlist.get(i));
700  lit+=coord.x+" "+coord.y;//lonlist.get(i)+" "+latlist.get(i)+",";
701  arr2.put(arr3);
702  }
703  geoms.add(geomobj);
704  if(mapstyle!=null) {
705  JSONObject geojsonstyle=new JSONObject(this.styleformatter.formatGeometry("Polygon", mapstyle));
706  System.out.println("Got style? - "+geojsonstyle);
707  for(String key:geojsonstyle.keySet()) {
708  style.put(key,geojsonstyle.get(key));
709  }
710  }
711  properties.put("geometry", lit.substring(0,lit.length()-1)+")");
712  }else if(!latlist.get(latlist.size()-1).equals(latlist.get(0)) || !lonlist.get(lonlist.size()-1).equals(lonlist.get(0))) {
713  JSONObject geomobj=new JSONObject();
714  geomobj.put("type","LineString");
715  JSONArray arr=new JSONArray();
716  String lit="LineString(";
717  geomobj.put("coordinates",arr);
718  for(int i=0;i<latlist.size();i++) {
719  JSONArray arr2=new JSONArray();
720  Coordinate coord=ReprojectionUtils.reproject(Double.valueOf(lonlist.get(i)), Double.valueOf(latlist.get(i)), epsg,srsName);
721  arr2.put(coord.x);
722  arr2.put(coord.y);
723  //arr2.put(lonlist.get(i));
724  //arr2.put(latlist.get(i));
725  lit+=coord.x+" "+coord.y;//lonlist.get(i)+" "+latlist.get(i)+",";
726  //lit+=lonlist.get(i)+" "+latlist.get(i)+",";
727  arr.put(arr2);
728  }
729  geoms.add(geomobj);
730  if(mapstyle!=null) {
731  JSONObject geojsonstyle=new JSONObject(this.styleformatter.formatGeometry("LineString", mapstyle));
732  System.out.println("Got style? - "+geojsonstyle);
733  for(String key:geojsonstyle.keySet()) {
734  style.put(key,geojsonstyle.get(key));
735  }
736  }
737  properties.put("geometry", lit.substring(0,lit.length()-1)+")");
738  }
739  latlist.clear();
740  lonlist.clear();
741  }
742  if(!onlyproperty) {
743  for (JSONObject geom : geoms) {
744  JSONObject geojsonobj = new JSONObject();
745  geojsonobj.put("type", "Feature");
746  geojsonobj.put("properties", properties);
747  if(!style.isEmpty())
748  geojsonobj.put("style", style);
749  geojsonobj.put("geometry", geom);
750  geojsonobj.put("id",lastInd);
751  //allfeatures.get(geomcounter).put(geojsonobj);
752  writeAsStream(properties, style, geom, jGenerator);
753  //features.put(geojsonobj);
754  //System.out.println(geojsonobj);
755  }
756  }else {
757  JSONObject geojsonobj = new JSONObject();
758  geojsonobj.put("type", "Feature");
759  if(!style.isEmpty())
760  geojsonobj.put("style", style);
761  geojsonobj.put("properties", properties);
762  geojsonobj.put("id",lastInd);
763  if(!geoms.isEmpty())
764  geojsonobj.put("geometry",geoms.get(0));
765  //allfeatures.get(geomcounter).put(geojsonobj);
766  writeAsStream(properties, style, geoms.get(0), jGenerator);
767  //features.put(geojsonobj);
768  }
769  jGenerator.writeEndArray();
770  if(writeEnclosingObject) {
771  jGenerator.writeNumberField("amount", this.lastQueriedElemCount);
772  jGenerator.writeEndObject();
773  jGenerator.close();
774  return null;
775  }
776  return jGenerator;
777  }
void writeAsStream(JSONObject properties, JSONObject style, JSONObject geom, JsonGenerator jGenerator)
Definition: GeoJSONFormatter.java:805

References GeoJSONFormatter.addKeyVal(), GeoJSONFormatter.addKeyValList(), ResultFormatter.contextMapper, ResultStyleFormatter.formatGeometry(), ResultFormatter.lastQueriedElemCount, ResultFormatter.parseVectorLiteral(), ReprojectionUtils.reproject(), ResultStyleFormatter.styleAttribute, ResultFormatter.styleformatter, and GeoJSONFormatter.writeAsStream().

Referenced by GeoJSONFormatter.formatter().

◆ formatter() [1/3]

String formatter ( Model  results,
String  startingElement,
String  featuretype,
String  propertytype,
String  typeColumn,
Boolean  onlyproperty,
Boolean  onlyhits,
String  srsName,
String  indvar,
String  epsg,
List< String >  eligiblenamespaces,
List< String >  noteligiblenamespaces,
StyleObject  mapstyle,
Boolean  alternativeFormat,
Boolean  invertXY,
Boolean  coverage,
Writer  out 
) throws XMLStreamException, IOException
inherited

◆ formatter() [2/3]

String formatter ( ResultSet  results,
String  startingElement,
String  featuretype,
String  propertytype,
String  typeColumn,
Boolean  onlyproperty,
Boolean  onlyhits,
String  srsName,
String  indvar,
String  epsg,
List< String >  eligiblenamespaces,
List< String >  noteligiblenamespaces,
StyleObject  mapstyle,
Boolean  alternativeFormat,
Boolean  invertXY,
Boolean  coverage,
Writer  out 
) throws IOException

Reimplemented from ResultFormatter.

797  {
798  if(out!=null) {
799  this.formatJSONStreaming(results, startingElement, featuretype, propertytype, typeColumn, onlyproperty, onlyhits, srsName, indvar, epsg, eligiblenamespaces, noteligiblenamespaces, mapstyle, alternativeFormat, invertXY, coverage, out,true);
800  return "";
801  }
802  return this.formatJSONObject(results, startingElement, featuretype, propertytype, typeColumn, onlyproperty, onlyhits, srsName, indvar, epsg, eligiblenamespaces, noteligiblenamespaces, mapstyle, alternativeFormat, invertXY, coverage, out);
803  }
JsonGenerator formatJSONStreaming(ResultSet results, String startingElement, String featuretype, String propertytype, String typeColumn, Boolean onlyproperty, Boolean onlyhits, String srsName, String indvar, String epsg, List< String > eligiblenamespaces, List< String > noteligiblenamespaces, StyleObject mapstyle, Boolean alternativeFormat, Boolean invertXY, Boolean coverage, Writer out, Boolean writeEnclosingObject)
Definition: GeoJSONFormatter.java:413
String formatJSONObject(ResultSet results, String startingElement, String featuretype, String propertytype, String typeColumn, Boolean onlyproperty, Boolean onlyhits, String srsName, String indvar, String epsg, List< String > eligiblenamespaces, List< String > noteligiblenamespaces, StyleObject mapstyle, Boolean alternativeFormat, Boolean invertXY, Boolean coverage, Writer out)
Definition: GeoJSONFormatter.java:60

References GeoJSONFormatter.formatJSONObject(), and GeoJSONFormatter.formatJSONStreaming().

◆ formatter() [3/3]

JsonGenerator formatter ( ResultSet  results,
String  startingElement,
String  featuretype,
String  propertytype,
String  typeColumn,
Boolean  onlyproperty,
Boolean  onlyhits,
String  srsName,
String  indvar,
String  epsg,
List< String >  eligiblenamespaces,
List< String >  noteligiblenamespaces,
StyleObject  mapstyle,
Boolean  alternativeFormat,
Boolean  invertXY,
Boolean  coverage,
Writer  out,
Boolean  internal 
) throws IOException
785  {
786  return this.formatJSONStreaming(results, startingElement, featuretype, propertytype, typeColumn, onlyproperty, onlyhits, srsName, indvar, epsg, eligiblenamespaces, noteligiblenamespaces, mapstyle, alternativeFormat, invertXY, coverage, out,false);
787  }

References GeoJSONFormatter.formatJSONStreaming().

Referenced by TripleStoreConnector.executeQuery().

◆ getFormatter()

static ResultFormatter getFormatter ( String  formatString)
staticinherited
130  {
131  formatString=formatString.toLowerCase();
132  if(resultMap.containsKey(formatString)) {
133  return resultMap.get(formatString);
134  }
135  if(formatString.contains("geojsonseq")) {
136  return resultMap.get("geojsonseq");
137  }
138  if(formatString.equals("application/vnd.geo+json+ld") || formatString.contains("geojsonld") || formatString.contains("geo+json+ld")) {
139  return resultMap.get("geojsonld");
140  }
141  if(formatString.equals("application/geojson") || formatString.contains("geojson") || formatString.contains("geo+json")) {
142  return resultMap.get("geojson");
143  }
144  if(formatString.contains("gml")) {
145  return resultMap.get("gml");
146  }
147  if(formatString.contains("html")) {
148  return resultMap.get("html");
149  }
150  if(formatString.contains("csv")) {
151  return resultMap.get("csv");
152  }
153  if(formatString.contains("ldapi")) {
154  return resultMap.get("ldapi");
155  }
156  if(formatString.contains("gpx")) {
157  return resultMap.get("gpx");
158  }
159  if(formatString.contains("svg")) {
160  return resultMap.get("svg");
161  }
162  if(formatString.contains("cypher")) {
163  return resultMap.get("cypher");
164  }
165  if(formatString.contains("osmlink")) {
166  return resultMap.get("osmlink");
167  }
168  if(formatString.contains("osm")) {
169  return resultMap.get("osm");
170  }
171  if(formatString.contains("ttl")) {
172  return resultMap.get("ttl");
173  }
174  if(formatString.contains("rdfjson")) {
175  return resultMap.get("rdfjson");
176  }
177  if(formatString.contains("rdf")) {
178  return resultMap.get("rdf");
179  }
180  if(formatString.contains("n3")) {
181  return resultMap.get("n3");
182  }
183  if(formatString.contains("jsonp")) {
184  return resultMap.get("jsonp");
185  }
186  if(formatString.contains("jsonn")) {
187  return resultMap.get("jsonn");
188  }
189  if(formatString.contains("nt")) {
190  return resultMap.get("nt");
191  }
192  if(formatString.contains("olc")) {
193  return resultMap.get("olc");
194  }
195  if(formatString.contains("rt")) {
196  return resultMap.get("rt");
197  }
198  if(formatString.contains("nq")) {
199  return resultMap.get("nq");
200  }
201  if(formatString.contains("trig")) {
202  return resultMap.get("trig");
203  }
204  if(formatString.contains("trix")) {
205  return resultMap.get("trix");
206  }
207  if(formatString.contains("geohash")) {
208  return resultMap.get("geohash");
209  }
210  if(formatString.contains("topojson")) {
211  return resultMap.get("topojson");
212  }
213  if(formatString.contains("covjson")) {
214  return resultMap.get("covjson");
215  }
216  if(formatString.contains("jsonseq")) {
217  return resultMap.get("jsonseq");
218  }
219  if(formatString.contains("jsonld")) {
220  return resultMap.get("jsonld");
221  }
222  if(formatString.contains("json")) {
223  return resultMap.get("geojson");
224  }
225  if(formatString.contains("kml")) {
226  return resultMap.get("kml");
227  }
228  if(formatString.contains("hdt")) {
229  return resultMap.get("hdt");
230  }
231  if(formatString.contains("ewkt")) {
232  return resultMap.get("ewkt");
233  }
234  if(formatString.contains("wkt")) {
235  return resultMap.get("wkt");
236  }
237  if(formatString.contains("mvt")) {
238  return resultMap.get("mvt");
239  }
240  if(formatString.contains("latlon")) {
241  return resultMap.get("latlon");
242  }
243  if(formatString.contains("wkb")) {
244  return resultMap.get("wkb");
245  }
246  if(formatString.contains("geouri")) {
247  return resultMap.get("geouri");
248  }
249  if(formatString.contains("mapml")) {
250  return resultMap.get("mapml");
251  }
252  if(formatString.contains("geohash")) {
253  return resultMap.get("geohash");
254  }
255  if(formatString.contains("geotiff")) {
256  return resultMap.get("geotiff");
257  }
258  if(formatString.contains("xlsx")) {
259  return resultMap.get("xlsx");
260  }
261  if(formatString.contains("xls")) {
262  return resultMap.get("xls");
263  }
264  if(formatString.contains("xyz")) {
265  return resultMap.get("xyz");
266  }
267  if(formatString.contains("gxl")) {
268  return resultMap.get("gxl");
269  }
270  if(formatString.contains("gexf")) {
271  return resultMap.get("gexf");
272  }
273  if(formatString.contains("covjson")) {
274  return resultMap.get("covjson");
275  }
276  if(formatString.contains("tgf")) {
277  return resultMap.get("tgf");
278  }
279  if(formatString.contains("polyshape")) {
280  return resultMap.get("polyshape");
281  }
282  if(formatString.contains("hextuples")) {
283  return resultMap.get("hextuples");
284  }
285  return resultMap.get("html");
286  }

References ResultFormatter.resultMap.

Referenced by WebService.collectionInformation(), WebService.collectionItems(), WebService.collections(), WebService.docCollectionItemJSON(), WebService.docCollectionJSON(), TripleStoreConnector.executeLDAPIQuery(), TripleStoreConnector.executePropertyValueQuery(), TripleStoreConnector.executeQuery(), and WebService.queryables().

◆ parseCoverageLiteral()

String parseCoverageLiteral ( String  literalValue,
String  literalType,
String  epsg,
String  srsName 
)
inherited

Reimplemented from ResultFormatter.

12  {
13  return null;
14  }

◆ parseLiteral()

Object parseLiteral ( String  literalValue,
String  literalType,
String  epsg,
String  srsName 
)
inherited
424  {
425  Geometry geom=parseVectorLiteral(literalValue, literalType, epsg, srsName);
426  if(geom!=null) {
427  return geom;
428  }
429  String cov=parseCoverageLiteral(literalValue, literalType, epsg, srsName);
430  if(cov!=null) {
431  return cov;
432  }
433  return null;
434  }
String parseCoverageLiteral(String literalValue, String literalType, String epsg, String srsName)
Definition: ResultFormatter.java:413

References ResultFormatter.parseCoverageLiteral(), and ResultFormatter.parseVectorLiteral().

Referenced by RasterWKBFormatter.formatter(), XYZASCIIFormatter.formatter(), HexTuplesFormatter.formatter(), and TTLFormatter.formatter().

◆ parseVectorLiteral()

Geometry parseVectorLiteral ( String  literalValue,
String  literalType,
String  epsg,
String  srsName 
)
inherited
368  {
369  Geometry geom=null;
370  if(literalType.toLowerCase().contains("wkt")) {
371  if(literalValue.trim().startsWith("<http")) {
372  try {
373  geom=this.wktreader.read(literalValue.substring(literalValue.lastIndexOf(">")+1));
374  epsg=literalValue.substring(literalValue.indexOf("<")+1,literalValue.lastIndexOf(">"));
375  Integer srid=Integer.valueOf(epsg.substring(epsg.lastIndexOf("/")+1));
376  geom.setSRID(srid);
377  epsg="EPSG:"+srid;
378  } catch (ParseException e) {
379  return null;
380  }
381  }else {
382  try {
383  geom=this.wktreader.read(literalValue);
384  } catch (ParseException e) {
385  return null;
386  }
387  }
388  }
389  else if(literalType.toLowerCase().contains("geojson")) {
390  geom=this.geojsonreader.read(literalValue);
391  }
392  else if(literalType.toLowerCase().contains("kml")) {
393  try {
394  geom=this.kmlreader.read(literalValue);
395  } catch (ParseException e) {
396  // TODO Auto-generated catch block
397  e.printStackTrace();
398  }
399  }
400  else if(literalType.toLowerCase().contains("wkb")) {
401  try {
402  geom=this.wkbreader.read(WKBReader.hexToBytes(literalValue));
403  } catch (ParseException e) {
404  return null;
405  }
406  }
407  if(geom!=null) {
408  geom=ReprojectionUtils.reproject(geom, epsg,srsName);
409  return geom;
410  }
411  return null;
412  }
WKBReader wkbreader
Definition: ResultFormatter.java:109
KMLReader kmlreader
Definition: ResultFormatter.java:111
GeoJSONReader geojsonreader
Definition: ResultFormatter.java:113
WKTReader wktreader
Definition: ResultFormatter.java:107

References ReprojectionUtils.reproject().

Referenced by GeoJSONFormatter.formatJSONObject(), GeoJSONFormatter.formatJSONStreaming(), RasterWKBFormatter.formatter(), XYZASCIIFormatter.formatter(), HexTuplesFormatter.formatter(), TTLFormatter.formatter(), CSVFormatter.formatter(), EWKTFormatter.formatter(), GeoURIFormatter.formatter(), HexWKBFormatter.formatter(), LatLonTextFormatter.formatter(), ODSFormatter.formatter(), OpenLocationCodeFormatter.formatter(), OSMLinkFormatter.formatter(), PostgreSQLFormatter.formatter(), TWKBFormatter.formatter(), WKBFormatter.formatter(), WKTFormatter.formatter(), XLSFormatter.formatter(), XLSXFormatter.formatter(), and ResultFormatter.parseLiteral().

◆ relToMap()

void relToMap ( String  keyPath)
828  {
829  if(keyPath.equalsIgnoreCase("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")) {
830  return;
831  }
832  if(!keyPath.contains(";")) {
833  if (keyPath.contains("#")) {
834  this.contextMapper.put(keyPath,keyPath.substring(keyPath.lastIndexOf('#') + 1));
835  } else {
836  this.contextMapper.put(keyPath,keyPath.substring(keyPath.lastIndexOf('/') + 1));
837  }
838  }
839  String result="";
840  String[] splitted=keyPath.split(";");
841  int i=0;
842  for(i=0;i<splitted.length;i++) {
843  if (splitted[i].contains("#")) {
844  result+=splitted[i].substring(splitted[i].lastIndexOf('#') + 1);
845  } else {
846  result+=splitted[i].substring(splitted[i].lastIndexOf('/') + 1);
847  }
848  if(i<splitted.length-1) {
849  result+=".";
850  }
851  }
852  this.contextMapper.put(keyPath,result);
853  }

References ResultFormatter.contextMapper.

Referenced by GeoJSONFormatter.addKeyVal(), and GeoJSONFormatter.addKeyValList().

◆ writeAsStream()

void writeAsStream ( JSONObject  properties,
JSONObject  style,
JSONObject  geom,
JsonGenerator  jGenerator 
) throws IOException
805  {
806  jGenerator.writeStartObject();
807  jGenerator.writeStringField("type", "Feature");
808  jGenerator.writeObjectFieldStart("properties");
809  for(String key:properties.keySet()) {
810  jGenerator.writeStringField(key, properties.get(key).toString());
811  }
812  jGenerator.writeEndObject();
813  if(!style.isEmpty()) {
814  jGenerator.writeObjectFieldStart("style");
815  for(String key:style.keySet()) {
816  jGenerator.writeStringField(key, style.get(key).toString());
817  }
818  jGenerator.writeEndObject();
819  }
820  jGenerator.writeObjectFieldStart("geometry");
821  jGenerator.writeStringField("type", geom.getString("type"));
822  jGenerator.writeFieldName("coordinates");
823  jGenerator.writeRaw(":"+geom.getJSONArray("coordinates").toString());
824  jGenerator.writeEndObject();
825  jGenerator.writeEndObject();
826  }

Referenced by GeoJSONFormatter.formatJSONStreaming().

Member Data Documentation

◆ constructQuery

◆ contextMapper

◆ coverageLiteralMap

Set<String> coverageLiteralMap =new TreeSet<>()
staticinherited

◆ definition

String definition =""
inherited

Referenced by ASCIIGridFormatter.ASCIIGridFormatter(), BSONFormatter.BSONFormatter(), WebService.collectionInformation(), CovJSONFormatter.CovJSONFormatter(), CSVFormatter.CSVFormatter(), CypherFormatter.CypherFormatter(), EWKTFormatter.EWKTFormatter(), GDFFormatter.GDFFormatter(), GeoHashFormatter.GeoHashFormatter(), GeoJSONFormatter.GeoJSONFormatter(), GeoJSONLDFormatter.GeoJSONLDFormatter(), GeoJSONSeqFormatter.GeoJSONSeqFormatter(), GeoRSSFormatter.GeoRSSFormatter(), GeoTIFFFormatter.GeoTIFFFormatter(), GeoURIFormatter.GeoURIFormatter(), GEXFFormatter.GEXFFormatter(), GMLFormatter.GMLFormatter(), GPXFormatter.GPXFormatter(), GraphMLFormatter.GraphMLFormatter(), GXLFormatter.GXLFormatter(), HDTFormatter.HDTFormatter(), HexTuplesFormatter.HexTuplesFormatter(), HexWKBFormatter.HexWKBFormatter(), HTMLFormatter.HTMLFormatter(), JSONLDFormatter.JSONLDFormatter(), JSONPFormatter.JSONPFormatter(), JSONSeqFormatter.JSONSeqFormatter(), KMLFormatter.KMLFormatter(), LDAPIJSONFormatter.LDAPIJSONFormatter(), MapMLFormatter.MapMLFormatter(), MVTFormatter.MVTFormatter(), N3Formatter.N3Formatter(), NQuadsFormatter.NQuadsFormatter(), NTFormatter.NTFormatter(), ODSFormatter.ODSFormatter(), OpenLocationCodeFormatter.OpenLocationCodeFormatter(), OSMFormatter.OSMFormatter(), PostgreSQLFormatter.PostgreSQLFormatter(), RDFEXIFormatter.RDFEXIFormatter(), RDFFormatter.RDFFormatter(), RDFJSONFormatter.RDFJSONFormatter(), RDFThriftFormatter.RDFThriftFormatter(), SVGFormatter.SVGFormatter(), TGFFormatter.TGFFormatter(), TLPFormatter.TLPFormatter(), TopoJSONFormatter.TopoJSONFormatter(), TrigFormatter.TrigFormatter(), TrixFormatter.TrixFormatter(), TTLFormatter.TTLFormatter(), TWKBFormatter.TWKBFormatter(), WKBFormatter.WKBFormatter(), WKTFormatter.WKTFormatter(), X3DFormatter.X3DFormatter(), XLSFormatter.XLSFormatter(), XLSXFormatter.XLSXFormatter(), XYZASCIIFormatter.XYZASCIIFormatter(), and YAMLFormatter.YAMLFormatter().

◆ exposedType

String exposedType ="application/vnd.geojson"
inherited

Referenced by ASCIIGridFormatter.ASCIIGridFormatter(), BSONFormatter.BSONFormatter(), CovJSONFormatter.CovJSONFormatter(), CSVFormatter.CSVFormatter(), CypherFormatter.CypherFormatter(), EWKTFormatter.EWKTFormatter(), GDFFormatter.GDFFormatter(), GeoHashFormatter.GeoHashFormatter(), GeoJSONFormatter.GeoJSONFormatter(), GeoJSONLDFormatter.GeoJSONLDFormatter(), GeoJSONSeqFormatter.GeoJSONSeqFormatter(), GeoRSSFormatter.GeoRSSFormatter(), GeoTIFFFormatter.GeoTIFFFormatter(), GeoURIFormatter.GeoURIFormatter(), GEXFFormatter.GEXFFormatter(), GMLCOVFormatter.GMLCOVFormatter(), GMLFormatter.GMLFormatter(), GPXFormatter.GPXFormatter(), GraphMLFormatter.GraphMLFormatter(), GXFFormatter.GXFFormatter(), GXLFormatter.GXLFormatter(), HDTFormatter.HDTFormatter(), HexRasterWKBFormatter.HexRasterWKBFormatter(), HexTuplesFormatter.HexTuplesFormatter(), HexWKBFormatter.HexWKBFormatter(), HTMLFormatter.HTMLFormatter(), JSONFormatter.JSONFormatter(), JSONLDFormatter.JSONLDFormatter(), JSONPFormatter.JSONPFormatter(), JSONSeqFormatter.JSONSeqFormatter(), KMLFormatter.KMLFormatter(), LatLonTextFormatter.LatLonTextFormatter(), LDAPIJSONFormatter.LDAPIJSONFormatter(), MapMLFormatter.MapMLFormatter(), MVTFormatter.MVTFormatter(), N3Formatter.N3Formatter(), NQuadsFormatter.NQuadsFormatter(), NTFormatter.NTFormatter(), ODSFormatter.ODSFormatter(), OpenLocationCodeFormatter.OpenLocationCodeFormatter(), OSMFormatter.OSMFormatter(), OSMLinkFormatter.OSMLinkFormatter(), PolyshapeFormatter.PolyshapeFormatter(), PostgreSQLFormatter.PostgreSQLFormatter(), RasterWKBFormatter.RasterWKBFormatter(), RDFEXIFormatter.RDFEXIFormatter(), RDFFormatter.RDFFormatter(), RDFJSONFormatter.RDFJSONFormatter(), RDFThriftFormatter.RDFThriftFormatter(), SVGFormatter.SVGFormatter(), TGFFormatter.TGFFormatter(), TLPFormatter.TLPFormatter(), TopoJSONFormatter.TopoJSONFormatter(), TrigFormatter.TrigFormatter(), TrixFormatter.TrixFormatter(), TTLFormatter.TTLFormatter(), TWKBFormatter.TWKBFormatter(), WKBFormatter.WKBFormatter(), WKTFormatter.WKTFormatter(), X3DFormatter.X3DFormatter(), XLSFormatter.XLSFormatter(), XLSXFormatter.XLSXFormatter(), XYZASCIIFormatter.XYZASCIIFormatter(), and YAMLFormatter.YAMLFormatter().

◆ featureType

String featureType =""
packageinherited

◆ fileextension

String fileextension ="json"
inherited

Referenced by ASCIIGridFormatter.ASCIIGridFormatter(), BSONFormatter.BSONFormatter(), WebService.collectionItems(), CovJSONFormatter.CovJSONFormatter(), CSVFormatter.CSVFormatter(), CypherFormatter.CypherFormatter(), WebService.docCollectionItemJSON(), WebService.docCollectionJSON(), EWKTFormatter.EWKTFormatter(), GDFFormatter.GDFFormatter(), GeoHashFormatter.GeoHashFormatter(), GeoJSONFormatter.GeoJSONFormatter(), GeoJSONLDFormatter.GeoJSONLDFormatter(), GeoJSONSeqFormatter.GeoJSONSeqFormatter(), GeoRSSFormatter.GeoRSSFormatter(), GeoTIFFFormatter.GeoTIFFFormatter(), GeoURIFormatter.GeoURIFormatter(), GEXFFormatter.GEXFFormatter(), GMLCOVFormatter.GMLCOVFormatter(), GMLFormatter.GMLFormatter(), GPXFormatter.GPXFormatter(), GraphMLFormatter.GraphMLFormatter(), GXFFormatter.GXFFormatter(), GXLFormatter.GXLFormatter(), HDTFormatter.HDTFormatter(), HexRasterWKBFormatter.HexRasterWKBFormatter(), HexTuplesFormatter.HexTuplesFormatter(), HexWKBFormatter.HexWKBFormatter(), HTMLFormatter.HTMLFormatter(), JSONFormatter.JSONFormatter(), JSONLDFormatter.JSONLDFormatter(), JSONPFormatter.JSONPFormatter(), JSONSeqFormatter.JSONSeqFormatter(), KMLFormatter.KMLFormatter(), LatLonTextFormatter.LatLonTextFormatter(), LDAPIJSONFormatter.LDAPIJSONFormatter(), MapMLFormatter.MapMLFormatter(), MVTFormatter.MVTFormatter(), N3Formatter.N3Formatter(), NQuadsFormatter.NQuadsFormatter(), NTFormatter.NTFormatter(), ODSFormatter.ODSFormatter(), OpenLocationCodeFormatter.OpenLocationCodeFormatter(), OSMFormatter.OSMFormatter(), OSMLinkFormatter.OSMLinkFormatter(), PolyshapeFormatter.PolyshapeFormatter(), PostgreSQLFormatter.PostgreSQLFormatter(), RasterWKBFormatter.RasterWKBFormatter(), RDFEXIFormatter.RDFEXIFormatter(), RDFFormatter.RDFFormatter(), RDFJSONFormatter.RDFJSONFormatter(), RDFThriftFormatter.RDFThriftFormatter(), SVGFormatter.SVGFormatter(), TGFFormatter.TGFFormatter(), TLPFormatter.TLPFormatter(), TopoJSONFormatter.TopoJSONFormatter(), TrigFormatter.TrigFormatter(), TrixFormatter.TrixFormatter(), TTLFormatter.TTLFormatter(), TWKBFormatter.TWKBFormatter(), WKBFormatter.WKBFormatter(), WKTFormatter.WKTFormatter(), X3DFormatter.X3DFormatter(), XLSFormatter.XLSFormatter(), XLSXFormatter.XLSXFormatter(), XYZASCIIFormatter.XYZASCIIFormatter(), and YAMLFormatter.YAMLFormatter().

◆ FLUSHTHRESHOLD

◆ geojsonreader

GeoJSONReader geojsonreader =new GeoJSONReader()
inherited

◆ kmlreader

KMLReader kmlreader =new KMLReader()
inherited

◆ label

String label ="JSON"
inherited

Referenced by ResultFormatter.addToMaps(), ASCIIGridFormatter.ASCIIGridFormatter(), BSONFormatter.BSONFormatter(), HTMLFormatter.collectColumns(), CovJSONFormatter.CovJSONFormatter(), CSVFormatter.CSVFormatter(), CypherFormatter.CypherFormatter(), EWKTFormatter.EWKTFormatter(), GDFFormatter.GDFFormatter(), GeoHashFormatter.GeoHashFormatter(), GeoJSONFormatter.GeoJSONFormatter(), GeoJSONLDFormatter.GeoJSONLDFormatter(), GeoJSONSeqFormatter.GeoJSONSeqFormatter(), GeoRSSFormatter.GeoRSSFormatter(), GeoTIFFFormatter.GeoTIFFFormatter(), GeoURIFormatter.GeoURIFormatter(), GEXFFormatter.GEXFFormatter(), GMLCOVFormatter.GMLCOVFormatter(), GMLFormatter.GMLFormatter(), GPXFormatter.GPXFormatter(), GraphMLFormatter.GraphMLFormatter(), GXFFormatter.GXFFormatter(), GXLFormatter.GXLFormatter(), HDTFormatter.HDTFormatter(), HexRasterWKBFormatter.HexRasterWKBFormatter(), HexTuplesFormatter.HexTuplesFormatter(), HexWKBFormatter.HexWKBFormatter(), HTMLFormatter.HTMLFormatter(), JSONFormatter.JSONFormatter(), JSONLDFormatter.JSONLDFormatter(), JSONPFormatter.JSONPFormatter(), JSONSeqFormatter.JSONSeqFormatter(), KMLFormatter.KMLFormatter(), LatLonTextFormatter.LatLonTextFormatter(), LDAPIJSONFormatter.LDAPIJSONFormatter(), MapMLFormatter.MapMLFormatter(), MVTFormatter.MVTFormatter(), N3Formatter.N3Formatter(), NQuadsFormatter.NQuadsFormatter(), NTFormatter.NTFormatter(), ODSFormatter.ODSFormatter(), OpenLocationCodeFormatter.OpenLocationCodeFormatter(), OSMFormatter.OSMFormatter(), OSMLinkFormatter.OSMLinkFormatter(), PolyshapeFormatter.PolyshapeFormatter(), PostgreSQLFormatter.PostgreSQLFormatter(), RasterWKBFormatter.RasterWKBFormatter(), RDFEXIFormatter.RDFEXIFormatter(), RDFFormatter.RDFFormatter(), RDFJSONFormatter.RDFJSONFormatter(), RDFThriftFormatter.RDFThriftFormatter(), SVGFormatter.SVGFormatter(), TGFFormatter.TGFFormatter(), TLPFormatter.TLPFormatter(), TopoJSONFormatter.TopoJSONFormatter(), TrigFormatter.TrigFormatter(), TrixFormatter.TrixFormatter(), TTLFormatter.TTLFormatter(), TWKBFormatter.TWKBFormatter(), WKBFormatter.WKBFormatter(), WKTFormatter.WKTFormatter(), X3DFormatter.X3DFormatter(), XLSFormatter.XLSFormatter(), XLSXFormatter.XLSXFormatter(), XYZASCIIFormatter.XYZASCIIFormatter(), and YAMLFormatter.YAMLFormatter().

◆ labelMap

Map<String,String> labelMap =new TreeMap<>()
staticinherited

◆ lastQueriedElemCount

Integer lastQueriedElemCount =0
inherited

Referenced by TripleStoreConnector.executePropertyValueQuery(), TripleStoreConnector.executeQuery(), GeoJSONFormatter.formatJSONObject(), GeoJSONFormatter.formatJSONStreaming(), GeoHashFormatter.formatter(), CovJSONFormatter.formatter(), RasterWKBFormatter.formatter(), XYZASCIIFormatter.formatter(), HTMLFormatter.formatter(), CypherFormatter.formatter(), GDFFormatter.formatter(), GEXFFormatter.formatter(), GraphMLFormatter.formatter(), GXLFormatter.formatter(), HDTFormatter.formatter(), HexTuplesFormatter.formatter(), LDAPIJSONFormatter.formatter(), N3Formatter.formatter(), NQuadsFormatter.formatter(), NTFormatter.formatter(), RDFEXIFormatter.formatter(), RDFFormatter.formatter(), RDFJSONFormatter.formatter(), RDFThriftFormatter.formatter(), TGFFormatter.formatter(), TrigFormatter.formatter(), TrixFormatter.formatter(), TTLFormatter.formatter(), BSONFormatter.formatter(), CSVFormatter.formatter(), EWKTFormatter.formatter(), GeoJSONLDFormatter.formatter(), GeoJSONSeqFormatter.formatter(), GeoURIFormatter.formatter(), GMLFormatter.formatter(), GPXFormatter.formatter(), HexWKBFormatter.formatter(), JSONFormatter.formatter(), JSONLDFormatter.formatter(), JSONPFormatter.formatter(), JSONSeqFormatter.formatter(), KMLFormatter.formatter(), LatLonTextFormatter.formatter(), MapMLFormatter.formatter(), MVTFormatter.formatter(), ODSFormatter.formatter(), OpenLocationCodeFormatter.formatter(), OSMFormatter.formatter(), OSMLinkFormatter.formatter(), PostgreSQLFormatter.formatter(), TWKBFormatter.formatter(), WKBFormatter.formatter(), WKTFormatter.formatter(), XLSFormatter.formatter(), XLSXFormatter.formatter(), YAMLFormatter.formatter(), and SVGFormatter.formatter().

◆ mediatypes

final String [] mediatypes
staticinherited
Initial value:
= {
MediaType.TEXT_PLAIN,
"application/vnd.geo+json+ld",
"text/csv",
}

◆ mimeType

String mimeType ="text/plain"
inherited

Referenced by ResultFormatter.addToMaps(), ASCIIGridFormatter.ASCIIGridFormatter(), BSONFormatter.BSONFormatter(), WebService.collectionItems(), WebService.collections(), CovJSONFormatter.CovJSONFormatter(), CSVFormatter.CSVFormatter(), CypherFormatter.CypherFormatter(), WebService.docCollectionItemJSON(), WebService.docCollectionJSON(), EWKTFormatter.EWKTFormatter(), GDFFormatter.GDFFormatter(), GeoHashFormatter.GeoHashFormatter(), GeoJSONFormatter.GeoJSONFormatter(), GeoJSONLDFormatter.GeoJSONLDFormatter(), GeoJSONSeqFormatter.GeoJSONSeqFormatter(), GeoRSSFormatter.GeoRSSFormatter(), GeoTIFFFormatter.GeoTIFFFormatter(), GeoURIFormatter.GeoURIFormatter(), GEXFFormatter.GEXFFormatter(), GMLCOVFormatter.GMLCOVFormatter(), GMLFormatter.GMLFormatter(), GPXFormatter.GPXFormatter(), GraphMLFormatter.GraphMLFormatter(), GXFFormatter.GXFFormatter(), GXLFormatter.GXLFormatter(), HDTFormatter.HDTFormatter(), HexRasterWKBFormatter.HexRasterWKBFormatter(), HexTuplesFormatter.HexTuplesFormatter(), HexWKBFormatter.HexWKBFormatter(), HTMLFormatter.HTMLFormatter(), JSONFormatter.JSONFormatter(), JSONLDFormatter.JSONLDFormatter(), JSONPFormatter.JSONPFormatter(), JSONSeqFormatter.JSONSeqFormatter(), KMLFormatter.KMLFormatter(), LatLonTextFormatter.LatLonTextFormatter(), LDAPIJSONFormatter.LDAPIJSONFormatter(), MapMLFormatter.MapMLFormatter(), MVTFormatter.MVTFormatter(), N3Formatter.N3Formatter(), NQuadsFormatter.NQuadsFormatter(), NTFormatter.NTFormatter(), ODSFormatter.ODSFormatter(), OpenLocationCodeFormatter.OpenLocationCodeFormatter(), OSMFormatter.OSMFormatter(), OSMLinkFormatter.OSMLinkFormatter(), PolyshapeFormatter.PolyshapeFormatter(), PostgreSQLFormatter.PostgreSQLFormatter(), RasterWKBFormatter.RasterWKBFormatter(), RDFEXIFormatter.RDFEXIFormatter(), RDFFormatter.RDFFormatter(), RDFJSONFormatter.RDFJSONFormatter(), RDFThriftFormatter.RDFThriftFormatter(), SVGFormatter.SVGFormatter(), TGFFormatter.TGFFormatter(), TLPFormatter.TLPFormatter(), TopoJSONFormatter.TopoJSONFormatter(), TrigFormatter.TrigFormatter(), TrixFormatter.TrixFormatter(), TTLFormatter.TTLFormatter(), TWKBFormatter.TWKBFormatter(), WKBFormatter.WKBFormatter(), WKTFormatter.WKTFormatter(), X3DFormatter.X3DFormatter(), XLSFormatter.XLSFormatter(), XLSXFormatter.XLSXFormatter(), XYZASCIIFormatter.XYZASCIIFormatter(), and YAMLFormatter.YAMLFormatter().

◆ resultMap

◆ styleformatter

◆ urlformat

String urlformat ="json"
inherited

Referenced by ASCIIGridFormatter.ASCIIGridFormatter(), BSONFormatter.BSONFormatter(), WebService.collectionInformation(), CovJSONFormatter.CovJSONFormatter(), CSVFormatter.CSVFormatter(), CypherFormatter.CypherFormatter(), EWKTFormatter.EWKTFormatter(), GDFFormatter.GDFFormatter(), GeoHashFormatter.GeoHashFormatter(), GeoJSONFormatter.GeoJSONFormatter(), GeoJSONLDFormatter.GeoJSONLDFormatter(), GeoJSONSeqFormatter.GeoJSONSeqFormatter(), GeoRSSFormatter.GeoRSSFormatter(), GeoTIFFFormatter.GeoTIFFFormatter(), GeoURIFormatter.GeoURIFormatter(), GEXFFormatter.GEXFFormatter(), GMLCOVFormatter.GMLCOVFormatter(), GMLFormatter.GMLFormatter(), GPXFormatter.GPXFormatter(), GraphMLFormatter.GraphMLFormatter(), GXFFormatter.GXFFormatter(), GXLFormatter.GXLFormatter(), HDTFormatter.HDTFormatter(), HexRasterWKBFormatter.HexRasterWKBFormatter(), HexTuplesFormatter.HexTuplesFormatter(), HexWKBFormatter.HexWKBFormatter(), HTMLFormatter.HTMLFormatter(), JSONFormatter.JSONFormatter(), JSONLDFormatter.JSONLDFormatter(), JSONPFormatter.JSONPFormatter(), JSONSeqFormatter.JSONSeqFormatter(), KMLFormatter.KMLFormatter(), LatLonTextFormatter.LatLonTextFormatter(), LDAPIJSONFormatter.LDAPIJSONFormatter(), MapMLFormatter.MapMLFormatter(), MVTFormatter.MVTFormatter(), N3Formatter.N3Formatter(), NQuadsFormatter.NQuadsFormatter(), NTFormatter.NTFormatter(), ODSFormatter.ODSFormatter(), OpenLocationCodeFormatter.OpenLocationCodeFormatter(), OSMFormatter.OSMFormatter(), OSMLinkFormatter.OSMLinkFormatter(), PolyshapeFormatter.PolyshapeFormatter(), PostgreSQLFormatter.PostgreSQLFormatter(), RasterWKBFormatter.RasterWKBFormatter(), RDFEXIFormatter.RDFEXIFormatter(), RDFFormatter.RDFFormatter(), RDFJSONFormatter.RDFJSONFormatter(), RDFThriftFormatter.RDFThriftFormatter(), SVGFormatter.SVGFormatter(), TGFFormatter.TGFFormatter(), TLPFormatter.TLPFormatter(), TopoJSONFormatter.TopoJSONFormatter(), TrigFormatter.TrigFormatter(), TrixFormatter.TrixFormatter(), TTLFormatter.TTLFormatter(), TWKBFormatter.TWKBFormatter(), WKBFormatter.WKBFormatter(), WKTFormatter.WKTFormatter(), X3DFormatter.X3DFormatter(), XLSFormatter.XLSFormatter(), XLSXFormatter.XLSXFormatter(), XYZASCIIFormatter.XYZASCIIFormatter(), and YAMLFormatter.YAMLFormatter().

◆ vectorLiteralMap

Set<String> vectorLiteralMap =new TreeSet<>()
staticinherited

◆ wkbreader

WKBReader wkbreader =new WKBReader()
inherited

◆ WKTLiteral

◆ wktreader

WKTReader wktreader =new WKTReader()
inherited