Class WFSDataProvider
- java.lang.Object
-
- com.supermap.services.providers.WFSDataProvider
-
- All Implemented Interfaces:
- DataProvider, ProviderContextAware
public class WFSDataProvider extends java.lang.Object implements DataProvider, ProviderContextAware
WFS data service provider.
WFSDataProvider provides services for getting SuperMap iServer data from the WFS services and encapsulates GIS functionalities related to SuperMap iServer data.
-
-
Constructor Summary
Constructors Constructor and Description WFSDataProvider()The default constructor.WFSDataProvider(java.lang.String serviceURL)Constructs a newWFSDataProviderobject according to WFS service root directory.WFSDataProvider(java.lang.String serviceURL, java.lang.String userName, java.lang.String password)Constructs a newWFSDataProviderobject according to WFS service root directory, user name and password.WFSDataProvider(java.lang.String serviceURL, java.lang.String userName, java.lang.String password, FeatureIDMapping idMapping)Constructs a newWFSDataProviderobject according to WFS service root directory, user name, password and FeatureID converter.
-
Method Summary
Methods Modifier and Type Method and Description EditResultaddFeatures(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<Feature> targetFeatures)WFSDataProvider currently does not support this method.booleanclearFeatures(java.lang.String datasourceName, java.lang.String datasetName)WFSDataProvider currently does not support this method.booleancontainsDataset(java.lang.String datasourceName, java.lang.String datasetName)WFSDataProvider currently does not support this method.booleancopyDataset(java.lang.String srcDatasourceName, java.lang.String srcDatasetName, java.lang.String destDatasourceName, java.lang.String destDatasetName)WFSDataProvider currently does not support this method.booleancreateDataset(java.lang.String datasourceName, DatasetInfo datasetInfo)WFSDataProvider currently does not support this method.booleandeleteDataset(java.lang.String datasourceName, java.lang.String datasetName)WFSDataProvider currently does not support this method.EditResultdeleteFeatures(java.lang.String datasourceName, QueryParameter parameters)Specifies the data source to remove the feature via sql.EditResultdeleteFeatures(java.lang.String datasourceName, java.lang.String datasetName, int[] ids)WFSDataProvider currently does not support this method.DatasetInfogetDatasetInfo(java.lang.String datasourceName, java.lang.String datasetName)Gets the specific dataset information in specific datasource in WFS service provider.java.util.List<DatasetInfo>getDatasetInfos(java.lang.String datasourceName)Gets information about all the datasets in a specified datasource.java.util.List<java.lang.String>getDatasetNames(java.lang.String datasourceName)Gets all dataset names for the current data source.DatasourceInfogetDatasourceInfo(java.lang.String datasourceName)Gets the datasource information of specific name in WFS service provider.java.util.List<DatasourceInfo>getDatasourceInfos()Gets information about all the datasources corresponding to the current WFS data service provider.java.util.List<DomainInfo>getDomainInfos(java.lang.String datasourceName, java.lang.String datasetName)Gets all the domain information for the specified datasetGetFeatureResultgetFeature(GetFeatureParameters parameters)Query and return the feature results.java.util.List<Feature>getFeature(java.lang.String datasourceName, QueryParameter queryParam)Gets features by a SQL query condition.java.util.List<Feature>getFeature(java.lang.String datasourceName, QueryParameter queryParam, int maxFeatures)WFSDataProvider currently does not support this method.java.util.List<Feature>getFeature(java.lang.String datasourceName, java.lang.String datasetName, Geometry geometry, double bufferDistance, java.lang.String attributeFilter, java.lang.String[] fields)Gets the features that fall within a buffer of a specified geometric object and meet a certain attribute filter condition.java.util.List<Feature>getFeature(java.lang.String datasourceName, java.lang.String datasetName, Geometry geometry, SpatialQueryMode spatialQueryMode, java.lang.String attributeFilter, java.lang.String[] fields)Gets features by performing spatial query.java.util.List<Feature>getFeature(java.lang.String datasourceName, java.lang.String datasetName, int[] ids, java.lang.String[] fields)Gets features by ID query.java.util.List<Feature>getFeature(java.lang.String datasourceName, java.lang.String datasetName, int[] ids, java.lang.String[] fields, int fromIndex, int toIndex)Gets the feature in the specified data set according to the specified feature ID in the way of supporting paging.java.util.List<Feature>getFeature(java.lang.String datasourceName, java.lang.String datasetName, Rectangle2D bounds, java.lang.String attributeFilter, java.lang.String[] fields)Gets the features that fall within a specified space and meet a certain attribute filter condition.java.util.List<FieldInfo>getFieldInfos(java.lang.String datasourceName, java.lang.String datasetName)Gets all the field information in the specific dataset in WFS service provider.booleanrenameDataset(java.lang.String datasourceName, java.lang.String oldName, java.lang.String newName)WFSDataProvider currently does not support this method.voidsetProviderContext(ProviderContext context)Sets the WFS service provider context.doublestatistic(java.lang.String datasourceName, java.lang.String datasetName, int fieldIndex, StatisticMode statisticMode)WFSDataProvider currently does not support this method.doublestatistic(java.lang.String datasourceName, java.lang.String datasetName, java.lang.String fieldName, StatisticMode statisticMode)WFSDataProvider currently does not support this method.voidupdateDatasetInfo(java.lang.String datasourceName, java.lang.String datasetName, DatasetInfo newDatasetInfo)WFSDataProvider currently does not support this method.voidupdateDatasourceInfo(java.lang.String datasourceName, DatasourceInfo newDatasourceInfo)WFSDataProvider currently does not support this method.EditResultupdateFeatures(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<Feature> targetFeatures)WFSDataProvider currently does not support this method.voidupdateFieldInfos(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<FieldInfo> newFieldInfos)WFSDataProvider currently does not support this method.
-
-
-
Constructor Detail
-
WFSDataProvider
public WFSDataProvider()
The default constructor.
-
WFSDataProvider
public WFSDataProvider(java.lang.String serviceURL, java.lang.String userName, java.lang.String password, FeatureIDMapping idMapping) throws WFSServiceExceptionConstructs a newWFSDataProviderobject according to WFS service root directory, user name, password and FeatureID converter.- Parameters:
serviceURL- The root directory of the WFS service.userName- User name.password- Password.idMapping- FeatureID converter, ie., converting the ID of feature from int to string, or from string to int.- Throws:
WFSServiceException- This exception will be thrown when accessing the wfs service fails.
-
WFSDataProvider
public WFSDataProvider(java.lang.String serviceURL, java.lang.String userName, java.lang.String password)Constructs a new
WFSDataProviderobject according to WFS service root directory, user name and password.The FeatureID’s converter is null in the WFS service provider.
- Parameters:
serviceURL- The root directory of the WFS service.userName- User name.password- Password.
-
WFSDataProvider
public WFSDataProvider(java.lang.String serviceURL)
Constructs a new
WFSDataProviderobject according to WFS service root directory.The user name, password, FeatureID’s converter are null in the WFS service provider.
- Parameters:
serviceURL- The root directory of the WFS service.
-
-
Method Detail
-
createDataset
public boolean createDataset(java.lang.String datasourceName, DatasetInfo datasetInfo)WFSDataProvider currently does not support this method.
Creates a new dataset in a specified datasource according to the dataset information.
- Specified by:
createDatasetin interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.datasetInfo- The dataset information.- Returns:
- true if the dataset is successfully created; false otherwise.
-
deleteDataset
public boolean deleteDataset(java.lang.String datasourceName, java.lang.String datasetName)WFSDataProvider currently does not support this method.
Removes the specified dataset in the specified datasource.
- Specified by:
deleteDatasetin interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.datasetName- The dataset name.- Returns:
- true if the dataset is successfully deleted; false otherwise.
-
containsDataset
public boolean containsDataset(java.lang.String datasourceName, java.lang.String datasetName)WFSDataProvider currently does not support this method.
Determines whether a specified datasource in WFS service provider contains a specified dataset.
- Specified by:
containsDatasetin interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.datasetName- The dataset name.- Returns:
- true if the given datasource contains the specified dataset; false otherwise.
-
renameDataset
public boolean renameDataset(java.lang.String datasourceName, java.lang.String oldName, java.lang.String newName)WFSDataProvider currently does not support this method.
Modifies the name of a specified dataset.
- Specified by:
renameDatasetin interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.oldName- The name of the dataset to be modified.newName- New name.- Returns:
- true if the dataset is successfully modified; false otherwise.
-
copyDataset
public boolean copyDataset(java.lang.String srcDatasourceName, java.lang.String srcDatasetName, java.lang.String destDatasourceName, java.lang.String destDatasetName)WFSDataProvider currently does not support this method.
Copies a replication of a specified dataset.
Copies a replication of a specified dataset from specified datasource to target datasource and saves it with a specified name.
- Specified by:
copyDatasetin interfaceDataProvider- Parameters:
srcDatasourceName- The name of the source datasource.srcDatasetName- The name of the source dataset.destDatasourceName- The target datasource name.destDatasetName- The target dataset name.- Returns:
- true if the dataset is successfully copied; false otherwise.
-
addFeatures
public EditResult addFeatures(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<Feature> targetFeatures)
WFSDataProvider currently does not support this method.
Adds elements of the same type in specific dataset in the WFS service provider, not supported currently.
- Specified by:
addFeaturesin interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.datasetName- The dataset name.targetFeatures- The list of features to be added. The features must be of the same type.- Returns:
- The edited result.
-
deleteFeatures
public EditResult deleteFeatures(java.lang.String datasourceName, java.lang.String datasetName, int[] ids)
WFSDataProvider currently does not support this method.
Deletes features from a specified dataset.
- Specified by:
deleteFeaturesin interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.datasetName- The dataset name.ids- The IDs of the features to be deleted.- Returns:
- The edited result.
-
getFeature
public java.util.List<Feature> getFeature(java.lang.String datasourceName, java.lang.String datasetName, Rectangle2D bounds, java.lang.String attributeFilter, java.lang.String[] fields)
Gets the features that fall within a specified space and meet a certain attribute filter condition.
- Specified by:
getFeaturein interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.datasetName- The dataset name.bounds- The specified query bounds.attributeFilter- The attribute filter condition. For example, fieldValue < 100, name like '%Hotel%'fields- The array of fields to be returned. All the fields are returned if this parameter is null.- Returns:
- The list of features.
-
updateFeatures
public EditResult updateFeatures(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<Feature> targetFeatures)
WFSDataProvider currently does not support this method.
Updates features in a specified dataset.
targetFeatures is used to set the expected features after update, of which the IDs should be identical with the IDs of the features to be updated. The update process is finding out the feature to be updated with the ID from the targetFeatures first, then updating the source feature with the targetFeature.
- Specified by:
updateFeaturesin interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.datasetName- The dataset name.targetFeatures- The list of new features whose IDs are the same with those of the features to be updated.- Returns:
- The edited result.
-
clearFeatures
public boolean clearFeatures(java.lang.String datasourceName, java.lang.String datasetName)WFSDataProvider currently does not support this method.
Clears the specific dataset information in specific datasource in WFS service provider, namely, deletes all the features in the dataset.
- Specified by:
clearFeaturesin interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.datasetName- The dataset name.- Returns:
- true if the features are successfully cleared; false otherwise.
-
getFeature
public java.util.List<Feature> getFeature(java.lang.String datasourceName, java.lang.String datasetName, int[] ids, java.lang.String[] fields)
Gets features by ID query.
Namely, getting features with specified IDs in a specified dataset.
- Specified by:
getFeaturein interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.datasetName- The dataset name.ids- The ID of the feature to get.fields- The array of fields to be returned. All the fields are returned if this parameter is null.- Returns:
- The list of features.
-
getFeature
public java.util.List<Feature> getFeature(java.lang.String datasourceName, java.lang.String datasetName, Geometry geometry, double bufferDistance, java.lang.String attributeFilter, java.lang.String[] fields)
Gets the features that fall within a buffer of a specified geometric object and meet a certain attribute filter condition.
- Specified by:
getFeaturein interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.datasetName- The dataset name.geometry- The geometric object.bufferDistance- The buffer distance and the unit is the coordUnit of current dataset.attributeFilter- The attribute filter condition. For example, fieldValue < 100, name like '%Hotel%'fields- The array of fields to be returned. All the fields are returned if this parameter is null.- Returns:
- The list of features.
-
getFeature
public java.util.List<Feature> getFeature(java.lang.String datasourceName, java.lang.String datasetName, Geometry geometry, SpatialQueryMode spatialQueryMode, java.lang.String attributeFilter, java.lang.String[] fields)
Gets features by performing spatial query.
That is., obtaining the features that have the specific spatial query mode with the specified geometry object and satisfy the specified attribute filter condition.
- Specified by:
getFeaturein interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.datasetName- The dataset name.geometry- The geometric object.spatialQueryMode- The spatial query mode.attributeFilter- The attribute filter condition. For example, fieldValue < 100, name like '%Hotel%'fields- The array of fields to be returned. All the fields are returned if this parameter is null.- Returns:
- The list of features.
-
getFeature
public java.util.List<Feature> getFeature(java.lang.String datasourceName, QueryParameter queryParam)
Gets features by a SQL query condition.
- Specified by:
getFeaturein interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.queryParam- Query parameter.- Returns:
- The list of features.
-
getFeature
public java.util.List<Feature> getFeature(java.lang.String datasourceName, QueryParameter queryParam, int maxFeatures)
WFSDataProvider currently does not support this method.
Gets features by a SQL query condition.
- Specified by:
getFeaturein interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.queryParam- Query parameter.maxFeatures-- Returns:
- The list of features.
-
getFeature
public GetFeatureResult getFeature(GetFeatureParameters parameters)
Description copied from interface:DataProviderQuery and return the feature results.
- Specified by:
getFeaturein interfaceDataProvider- Parameters:
parameters- Is the encapsulation of other getFeature parameters.- Returns:
-
getDatasourceInfos
public java.util.List<DatasourceInfo> getDatasourceInfos()
Gets information about all the datasources corresponding to the current WFS data service provider.
A WFS service provider corresponds to a datasource in SuperMap iServer, and the datasource in the service provider is converted by the WFS service providing capability. So the datasource in the WFS service provider is unique.
- Specified by:
getDatasourceInfosin interfaceDataProvider- Returns:
- The list of datasource information.
-
getDatasourceInfo
public DatasourceInfo getDatasourceInfo(java.lang.String datasourceName)
Gets the datasource information of specific name in WFS service provider.
A WFS service provider corresponds to a datasource in SuperMap iServer, and the datasource in the service provider is converted by the WFS service providing capability. So the datasource in the WFS service provider is unique.
- Specified by:
getDatasourceInfoin interfaceDataProvider- Parameters:
datasourceName- The specified datasource name.- Returns:
- Datasource info.
-
updateDatasourceInfo
public void updateDatasourceInfo(java.lang.String datasourceName, DatasourceInfo newDatasourceInfo)WFSDataProvider currently does not support this method.
Updates the original datasource info with new datasource info.
- Specified by:
updateDatasourceInfoin interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.newDatasourceInfo- The new datasource info.
-
getDatasetInfos
public java.util.List<DatasetInfo> getDatasetInfos(java.lang.String datasourceName)
Gets information about all the datasets in a specified datasource.
- Specified by:
getDatasetInfosin interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.- Returns:
- The list of dataset information.
-
getDatasetInfo
public DatasetInfo getDatasetInfo(java.lang.String datasourceName, java.lang.String datasetName)
Gets the specific dataset information in specific datasource in WFS service provider.
- Specified by:
getDatasetInfoin interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.datasetName- The dataset name.- Returns:
- The dataset information.
-
updateDatasetInfo
public void updateDatasetInfo(java.lang.String datasourceName, java.lang.String datasetName, DatasetInfo newDatasetInfo)WFSDataProvider currently does not support this method.
Updates information about a specified dataset in a given datasource.
- Specified by:
updateDatasetInfoin interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.datasetName- The name of the dataset to be updated.newDatasetInfo- The dataset information.
-
getFieldInfos
public java.util.List<FieldInfo> getFieldInfos(java.lang.String datasourceName, java.lang.String datasetName)
Gets all the field information in the specific dataset in WFS service provider.
- Specified by:
getFieldInfosin interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.datasetName- The dataset name.- Returns:
- Field info list.
-
updateFieldInfos
public void updateFieldInfos(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<FieldInfo> newFieldInfos)WFSDataProvider currently does not support this method.
Updates the field information in a specified dataset.
A field can be added, deleted, or modified by using this method.All the fields (except the SuperMap system fields) in a dataset are replaced with new fields.
If SuperMap data are used, the alias of the SuperMap system fields cannot be updated.
- Specified by:
updateFieldInfosin interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.datasetName- The dataset name.newFieldInfos- The new field information. If SuperMap data are used, the SuperMap system fields cannot be included in this information list.
-
statistic
public double statistic(java.lang.String datasourceName, java.lang.String datasetName, int fieldIndex, StatisticMode statisticMode)WFSDataProvider currently does not support this method.
Calculates statistics on a specified field of a dataset based on a specified statistical mode.
- Specified by:
statisticin interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.datasetName- The dataset name.fieldIndex- The field index.statisticMode- The statistical mode.- Returns:
- The statistic result.
-
statistic
public double statistic(java.lang.String datasourceName, java.lang.String datasetName, java.lang.String fieldName, StatisticMode statisticMode)WFSDataProvider currently does not support this method.
Calculates statistics on a specified field of a dataset based on a specified statistical mode.
- Specified by:
statisticin interfaceDataProvider- Parameters:
datasourceName- The list of datasource names.datasetName- The dataset name.fieldName- The name of the specified field.statisticMode- The statistical mode.- Returns:
- The statistic result.
-
setProviderContext
public void setProviderContext(ProviderContext context)
Sets the WFS service provider context.
- Specified by:
setProviderContextin interfaceProviderContextAware- Parameters:
context- The WFS service provider context.
-
getDomainInfos
public java.util.List<DomainInfo> getDomainInfos(java.lang.String datasourceName, java.lang.String datasetName)
Description copied from interface:DataProviderGets all the domain information for the specified dataset
- Specified by:
getDomainInfosin interfaceDataProvider- Parameters:
datasourceName- the name of the datasourcedatasetName- the dataset name- Returns:
- Domain information list
-
deleteFeatures
public EditResult deleteFeatures(java.lang.String datasourceName, QueryParameter parameters)
Description copied from interface:DataProviderSpecifies the data source to remove the feature via sql.
- Specified by:
deleteFeaturesin interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.parameters- Query parameter.- Returns:
- Edits the results.
-
getDatasetNames
public java.util.List<java.lang.String> getDatasetNames(java.lang.String datasourceName)
Description copied from interface:DataProviderGets all dataset names for the current data source.
- Specified by:
getDatasetNamesin interfaceDataProvider- Parameters:
datasourceName- the data source name.- Returns:
- A list of dataset names.
-
getFeature
public java.util.List<Feature> getFeature(java.lang.String datasourceName, java.lang.String datasetName, int[] ids, java.lang.String[] fields, int fromIndex, int toIndex)
Description copied from interface:DataProviderGets the feature in the specified data set according to the specified feature ID in the way of supporting paging.
- Specified by:
getFeaturein interfaceDataProvider- Parameters:
datasourceName- the name of the datasource.datasetName- the dataset name.ids- Feature ID.fields- An array of fields to be returned. When the parameter is null, all fields are returned.fromIndex- The minimum index number for the result of the pagingtoIndex- The maximum index number for the result of the paging- Returns:
- Feature lists.
-
-