public class GeoPackageDataProvider extends java.lang.Object implements DataProvider, Disposable, ProviderContextAware
Constructor and Description |
---|
GeoPackageDataProvider()
The constructor.
|
GeoPackageDataProvider(GeoPackageDataProviderSetting providerSetting)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
EditResult |
addFeatures(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<Feature> targetFeatures)
Adds a set of features of the same type to the specified dataset.
|
boolean |
clearFeatures(java.lang.String datasourceName, java.lang.String datasetName)
Clears the elements of the specified dataset.
|
boolean |
containsDataset(java.lang.String datasourceName, java.lang.String datasetName)
Determines whether the specified data source contains the specified data set.
|
boolean |
copyDataset(java.lang.String srcDatasourceName, java.lang.String srcDatasetName, java.lang.String destDatasourceName, java.lang.String destDatasetName)
Copy the data set.
|
boolean |
createDataset(java.lang.String datasourceName, DatasetInfo datasetInfo)
In the specified data source, it creates a new data set based on the data set information.
|
boolean |
deleteDataset(java.lang.String datasourceName, java.lang.String datasetName)
Deletes the specified dataset in the specified data source.
|
EditResult |
deleteFeatures(java.lang.String datasourceName, QueryParameter parameters)
Specifies the data source to remove the feature via sql.
|
EditResult |
deleteFeatures(java.lang.String datasourceName, java.lang.String datasetName, int[] ids)
Removes a set of features in the specified dataset.
|
void |
dispose()
Release the resource object.
|
DatasetInfo |
getDatasetInfo(java.lang.String datasourceName, java.lang.String datasetName)
Gets the specified data set information for the specified data source.
|
java.util.List<DatasetInfo> |
getDatasetInfos(java.lang.String datasourceName)
Gets all dataset information for the specified data source.
|
java.util.List<java.lang.String> |
getDatasetNames(java.lang.String datasourceName)
Gets all dataset names for the current data source.
|
DatasourceInfo |
getDatasourceInfo(java.lang.String datasourceName)
Gets information about the specified data source.
|
java.util.List<DatasourceInfo> |
getDatasourceInfos()
Get all the data source information corresponding to the current data service provider.
|
java.util.List<DomainInfo> |
getDomainInfos(java.lang.String datasourceName, java.lang.String datasetName)
Gets all the domain information for the specified dataset
|
GetFeatureResult |
getFeature(GetFeatureParameters parameters)
Query and return the feature results.
|
java.util.List<Feature> |
getFeature(java.lang.String datasourceName, QueryParameter queryParam)
Gets the elements through SQL query criteria.
|
java.util.List<Feature> |
getFeature(java.lang.String datasourceName, QueryParameter queryParam, int maxFeatures)
Gets the elements through SQL query criteria.
|
java.util.List<Feature> |
getFeature(java.lang.String datasourceName, java.lang.String datasetName, Geometry geometry, double distance, java.lang.String attributeFilter, java.lang.String[] fields)
Gets the elements that fall within the buffer of the specified space object and satisfy certain attribute filters.
|
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 the elements that specify a geometric object that has a specific spatial query mode and satisfies the specified attribute filter.
|
java.util.List<Feature> |
getFeature(java.lang.String datasourceName, java.lang.String datasetName, int[] ids, java.lang.String[] fields)
Gets the feature in the specified dataset based on the specified feature ID.
|
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)
Get the elements within the specified space and meet certain attribute filters.
|
java.util.List<FieldInfo> |
getFieldInfos(java.lang.String datasourceName, java.lang.String datasetName)
Gets all the field information for the specified dataset.
|
boolean |
renameDataset(java.lang.String datasourceName, java.lang.String oldName, java.lang.String newName)
Modifies the name of the specified dataset.
|
void |
setProviderContext(ProviderContext context)
Sets the service provider context
|
double |
statistic(java.lang.String datasourceName, java.lang.String datasetName, int fieldIndex, StatisticMode statisticMode)
In the specified data set, statistics and calculations the specified field according to the specified statistical method.
|
double |
statistic(java.lang.String datasourceName, java.lang.String datasetName, java.lang.String fieldName, StatisticMode statisticMode)
In the specified data set, statistics and calculations the specified field according to the specified statistical method.
|
void |
updateDatasetInfo(java.lang.String datasourceName, java.lang.String datasetName, DatasetInfo newDatasetInfo)
In the specified data source, update the information for the specified data set.
|
void |
updateDatasourceInfo(java.lang.String datasourceName, DatasourceInfo newDatasourceInfo)
Updates the original data source information with the new data source information.
|
EditResult |
updateFeatures(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<Feature> targetFeatures)
Updates a set of features in the specified dataset.
|
void |
updateFieldInfos(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<FieldInfo> newFieldInfos)
Updates the field information for the specified dataset.
|
public GeoPackageDataProvider()
The constructor.
public GeoPackageDataProvider(GeoPackageDataProviderSetting providerSetting)
The constructor.
providerSetting
- GeoPackage configuration.public void setProviderContext(ProviderContext context)
ProviderContextAware
Sets the service provider context
setProviderContext
in interface ProviderContextAware
context
- service provider contextpublic void dispose()
Disposable
Release the resource object.
dispose
in interface Disposable
public boolean createDataset(java.lang.String datasourceName, DatasetInfo datasetInfo)
DataProvider
In the specified data source, it creates a new data set based on the data set information.
createDataset
in interface DataProvider
datasourceName
- the name of the datasource.datasetInfo
- Data set info.public boolean deleteDataset(java.lang.String datasourceName, java.lang.String datasetName)
DataProvider
Deletes the specified dataset in the specified data source.
deleteDataset
in interface DataProvider
datasourceName
- the name of the datasource.datasetName
- the dataset name.public boolean containsDataset(java.lang.String datasourceName, java.lang.String datasetName)
DataProvider
Determines whether the specified data source contains the specified data set.
containsDataset
in interface DataProvider
datasourceName
- the name of the datasource.datasetName
- the dataset name.public boolean renameDataset(java.lang.String datasourceName, java.lang.String oldName, java.lang.String newName)
DataProvider
Modifies the name of the specified dataset.
renameDataset
in interface DataProvider
datasourceName
- the name of the datasource.oldName
- Old data set name.newName
- New data set name.public boolean copyDataset(java.lang.String srcDatasourceName, java.lang.String srcDatasetName, java.lang.String destDatasourceName, java.lang.String destDatasetName)
DataProvider
Copy the data set.
From the specified source data source, the specified source data set is copied to the target dataset in the specified target data source.
copyDataset
in interface DataProvider
srcDatasetName
- Source data set name.destDatasourceName
- Target data source name.destDatasetName
- Target data set name.public EditResult addFeatures(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<Feature> targetFeatures)
DataProvider
Adds a set of features of the same type to the specified dataset.
Each dataset of SuperMap has a type (DatasetType
), which can be a point dataset, a line dataset, a surface dataset, etc., and the elements in each dataset have corresponding types, such as those stored in a point dataset must be a point element. Therefore, when adding features to a dataset, the added elements must be of the same type.
addFeatures
in interface DataProvider
datasourceName
- the name of the datasource.datasetName
- the dataset name.targetFeatures
- To add a list of features, the elements in the list must be of the same type.public EditResult deleteFeatures(java.lang.String datasourceName, java.lang.String datasetName, int[] ids)
DataProvider
Removes a set of features in the specified dataset.
deleteFeatures
in interface DataProvider
datasourceName
- the name of the datasource.datasetName
- the dataset name.ids
- The ID array of the feature to be deleted.public EditResult updateFeatures(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<Feature> targetFeatures)
DataProvider
Updates a set of features in the specified dataset.
The parameter targetFeatures is a new feature list whose feature ID is the same as the feature ID to be updated in the dataset, finds the element to be updated based on the ID, and then updates the original feature to the new feature.
updateFeatures
in interface DataProvider
datasourceName
- the name of the datasource.datasetName
- the dataset name.targetFeatures
- new feature list. Its ID is the same as the feature ID to be updated.public boolean clearFeatures(java.lang.String datasourceName, java.lang.String datasetName)
DataProvider
Clears the elements of the specified dataset.
clearFeatures
in interface DataProvider
datasourceName
- the name of the datasource.datasetName
- the dataset name.public java.util.List<Feature> getFeature(java.lang.String datasourceName, java.lang.String datasetName, Rectangle2D bounds, java.lang.String attributeFilter, java.lang.String[] fields)
DataProvider
Get the elements within the specified space and meet certain attribute filters.
getFeature
in interface DataProvider
datasourceName
- the name of the datasource.datasetName
- the dataset name.bounds
- The specified query range.attributeFilter
- Attribute query filter. Such as fieldValue <100, name like '% hotel%'fields
- An array of fields to be returned. When the parameter is null, all fields are returned.public java.util.List<Feature> getFeature(java.lang.String datasourceName, java.lang.String datasetName, int[] ids, java.lang.String[] fields)
DataProvider
Gets the feature in the specified dataset based on the specified feature ID.
getFeature
in interface DataProvider
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.public java.util.List<Feature> getFeature(java.lang.String datasourceName, java.lang.String datasetName, Geometry geometry, double distance, java.lang.String attributeFilter, java.lang.String[] fields)
DataProvider
Gets the elements that fall within the buffer of the specified space object and satisfy certain attribute filters.
getFeature
in interface DataProvider
datasourceName
- the name of the datasource.datasetName
- the dataset name.geometry
- Geometric object.distance
- The radius of the buffer.attributeFilter
- Filter condition of attribute quering Such as fieldValue <100, name like '% hotel%'fields
- An array of fields to be returned. When the parameter is null, all fields are returned.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)
DataProvider
Gets the elements that specify a geometric object that has a specific spatial query mode and satisfies the specified attribute filter.
getFeature
in interface DataProvider
datasourceName
- the name of the datasource.datasetName
- the dataset name.geometry
- Geometric object.spatialQueryMode
- spatial query mode.attributeFilter
- Filter condition of attribute quering Such as fieldValue <100, name like '% hotel%'fields
- An array of fields to be returned. When the parameter is null, all fields are returned.public java.util.List<Feature> getFeature(java.lang.String datasourceName, QueryParameter queryParam)
DataProvider
Gets the elements through SQL query criteria.
getFeature
in interface DataProvider
datasourceName
- the name of the datasource.queryParam
- Query parameters.public java.util.List<Feature> getFeature(java.lang.String datasourceName, QueryParameter queryParam, int maxFeatures)
DataProvider
Gets the elements through SQL query criteria.
getFeature
in interface DataProvider
datasourceName
- the name of the datasource.queryParam
- Query parameters.maxFeatures
- The maximum number of features that can be returned.public GetFeatureResult getFeature(GetFeatureParameters parameters)
DataProvider
Query and return the feature results.
getFeature
in interface DataProvider
parameters
- Is the encapsulation of other getFeature parameters.public java.util.List<DatasourceInfo> getDatasourceInfos()
DataProvider
Get all the data source information corresponding to the current data service provider.
getDatasourceInfos
in interface DataProvider
public DatasourceInfo getDatasourceInfo(java.lang.String datasourceName)
DataProvider
Gets information about the specified data source.
getDatasourceInfo
in interface DataProvider
datasourceName
- the name of the datasource.public void updateDatasourceInfo(java.lang.String datasourceName, DatasourceInfo newDatasourceInfo)
DataProvider
Updates the original data source information with the new data source information.
updateDatasourceInfo
in interface DataProvider
datasourceName
- the name of the datasource.newDatasourceInfo
- new data source information.public java.util.List<DatasetInfo> getDatasetInfos(java.lang.String datasourceName)
DataProvider
Gets all dataset information for the specified data source.
getDatasetInfos
in interface DataProvider
datasourceName
- the name of the datasource.public DatasetInfo getDatasetInfo(java.lang.String datasourceName, java.lang.String datasetName)
DataProvider
Gets the specified data set information for the specified data source.
getDatasetInfo
in interface DataProvider
datasourceName
- the name of the datasource.datasetName
- the dataset name.public void updateDatasetInfo(java.lang.String datasourceName, java.lang.String datasetName, DatasetInfo newDatasetInfo)
DataProvider
In the specified data source, update the information for the specified data set.
updateDatasetInfo
in interface DataProvider
datasourceName
- the name of the datasource.datasetName
- The name of the dataset to be updated.newDatasetInfo
- New data source information.public java.util.List<FieldInfo> getFieldInfos(java.lang.String datasourceName, java.lang.String datasetName)
DataProvider
Gets all the field information for the specified dataset.
getFieldInfos
in interface DataProvider
datasourceName
- the name of the datasource.datasetName
- the dataset name.public void updateFieldInfos(java.lang.String datasourceName, java.lang.String datasetName, java.util.List<FieldInfo> newFieldInfos)
DataProvider
Updates the field information for the specified dataset.
Use this method to achieve add, delete, modify operation to the field, that is, the entire data set field (except SuperMap system field) is replaced with the new field.
If you are using SuperMap data, updating the alias of SuperMap system field is not currently supported.
updateFieldInfos
in interface DataProvider
datasourceName
- the name of the datasource.datasetName
- the dataset name.newFieldInfos
- new field information. If you are using SuperMap data, the new field information list can not contain SuperMap's system fields.public double statistic(java.lang.String datasourceName, java.lang.String datasetName, int fieldIndex, StatisticMode statisticMode)
DataProvider
In the specified data set, statistics and calculations the specified field according to the specified statistical method.
statistic
in interface DataProvider
datasourceName
- the name of the datasource.datasetName
- the dataset name.fieldIndex
- Field number.statisticMode
- Statistical methods.public double statistic(java.lang.String datasourceName, java.lang.String datasetName, java.lang.String fieldName, StatisticMode statisticMode)
DataProvider
In the specified data set, statistics and calculations the specified field according to the specified statistical method.
statistic
in interface DataProvider
datasourceName
- the name of the datasource.datasetName
- the dataset name.fieldName
- Field name.statisticMode
- Statistical methods.public java.util.List<DomainInfo> getDomainInfos(java.lang.String datasourceName, java.lang.String datasetName)
DataProvider
Gets all the domain information for the specified dataset
getDomainInfos
in interface DataProvider
datasourceName
- the name of the datasourcedatasetName
- the dataset namepublic EditResult deleteFeatures(java.lang.String datasourceName, QueryParameter parameters)
DataProvider
Specifies the data source to remove the feature via sql.
deleteFeatures
in interface DataProvider
datasourceName
- the name of the datasource.parameters
- Query parameter.public java.util.List<java.lang.String> getDatasetNames(java.lang.String datasourceName)
DataProvider
Gets all dataset names for the current data source.
getDatasetNames
in interface DataProvider
datasourceName
- the data source name.public java.util.List<Feature> getFeature(java.lang.String datasourceName, java.lang.String datasetName, int[] ids, java.lang.String[] fields, int fromIndex, int toIndex)
DataProvider
Gets the feature in the specified data set according to the specified feature ID in the way of supporting paging.
getFeature
in interface DataProvider
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