public class FeatureToJson extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_FEATURES |
| Constructor and Description |
|---|
FeatureToJson(boolean arrays,
boolean edit) |
FeatureToJson(boolean arrays,
boolean edit,
boolean graph,
boolean aliases,
boolean returnNullval,
List<Long> attributesToInclude) |
FeatureToJson(boolean arrays,
boolean edit,
boolean graph,
boolean aliases,
boolean returnNullval,
List<Long> attributesToInclude,
boolean ordered) |
FeatureToJson(boolean arrays,
boolean edit,
boolean graph,
boolean aliases,
List<Long> attributesToInclude) |
FeatureToJson(boolean arrays,
boolean edit,
boolean graph,
List<Long> attributesToInclude) |
| Modifier and Type | Method and Description |
|---|---|
org.json.JSONArray |
getJSONFeatures(ApplicationLayer al,
SimpleFeatureType ft,
org.geotools.data.FeatureSource fs,
org.geotools.data.Query q)
Get the features, unsorted, as JSONArray with the given params.
|
org.json.JSONArray |
getJSONFeatures(ApplicationLayer al,
SimpleFeatureType ft,
org.geotools.data.FeatureSource fs,
org.geotools.data.Query q,
String sort,
String dir)
Get the features, optionally sorted, as JSONArray with the given params.
|
static org.opengis.filter.Filter |
reformatFilter(org.opengis.filter.Filter filter,
SimpleFeatureType ft)
Optimze and reformat filter.
|
static org.opengis.filter.Filter |
reformatFilter(org.opengis.filter.Filter filter,
SimpleFeatureType ft,
boolean includeRelations)
Optimze and reformat filter.
|
public static final int MAX_FEATURES
public FeatureToJson(boolean arrays,
boolean edit)
public FeatureToJson(boolean arrays,
boolean edit,
boolean graph,
List<Long> attributesToInclude)
public FeatureToJson(boolean arrays,
boolean edit,
boolean graph,
boolean aliases,
List<Long> attributesToInclude)
public FeatureToJson(boolean arrays,
boolean edit,
boolean graph,
boolean aliases,
boolean returnNullval,
List<Long> attributesToInclude)
public FeatureToJson(boolean arrays,
boolean edit,
boolean graph,
boolean aliases,
boolean returnNullval,
List<Long> attributesToInclude,
boolean ordered)
aliases - true to return aliases in the responsereturnNullval - true to return empty string for null valueattributesToInclude - List of attributes to return in the responseordered - true to return an JSONArray with attributes per
feature instead of JSONObject to maintain order of attributespublic org.json.JSONArray getJSONFeatures(ApplicationLayer al, SimpleFeatureType ft, org.geotools.data.FeatureSource fs, org.geotools.data.Query q) throws IOException, org.json.JSONException, Exception
al - The application layer(if there is a application layer)ft - The featuretype that must be used to get the featuresfs - The featureSourceq - The queryIOException - if anyorg.json.JSONException - if transforming to json failsException - if anygetJSONFeatures(nl.b3p.viewer.config.app.ApplicationLayer,
nl.b3p.viewer.config.services.SimpleFeatureType,
org.geotools.data.FeatureSource, org.geotools.data.Query,
java.lang.String, java.lang.String)public org.json.JSONArray getJSONFeatures(ApplicationLayer al, SimpleFeatureType ft, org.geotools.data.FeatureSource fs, org.geotools.data.Query q, String sort, String dir) throws IOException, org.json.JSONException, Exception
al - The application layer(if there is a application layer)ft - The featuretype that must be used to get the featuresfs - The featureSourceq - The querysort - The attribute name that is used to sortdir - Sort direction (DESC or ASC)IOException - if anyorg.json.JSONException - if transforming to json failsException - if anypublic static org.opengis.filter.Filter reformatFilter(org.opengis.filter.Filter filter,
SimpleFeatureType ft)
throws Exception
reformatFilter(org.opengis.filter.Filter, nl.b3p.viewer.config.services.SimpleFeatureType, boolean)
with the includeRelations set to true.filter - the filter to processft - featuretype to apply filterException - if anyreformatFilter(org.opengis.filter.Filter,
nl.b3p.viewer.config.services.SimpleFeatureType, boolean)public static org.opengis.filter.Filter reformatFilter(org.opengis.filter.Filter filter,
SimpleFeatureType ft,
boolean includeRelations)
throws Exception
filter - the filter to processft - featuretype to apply filterincludeRelations - whether to include related (joined) dataException - if anyCopyright © 2018. All rights reserved.