com.supermap.services.providers

Class ArcGISRestDataProvider

  • java.lang.Object
    • com.supermap.services.providers.ArcGISRestDataProvider
  • All Implemented Interfaces:
    DataProvider, ProviderContextAware


    public class ArcGISRestDataProvider
    extends java.lang.Object
    implements DataProvider, ProviderContextAware
    

    ArcGIS REST data service provider.

    ArcGISRestDataProvider encapsulates ArcGIS REST feature services as SuperMap iServer data services.

    It supports to add, delete, modify and query features; but does not support to edit the datasets and datasources.

    The query function is provided by the Query resource of ArcGIS Feature Service, supporting sql query, spatial query and bounds query; not support distance query; not support maxFeatures parameter.

    • Note:
    • The butted Query parameter: geometry, geometryType, where, objectIds, outFields, returnGeomery, orderByFields (ArcGIS 10.1 or higher). outStatistics (ArcGIS 10.1 or higher).
    • Supported spatial query relations: INTERSECT, CONTAIN, CROSS, TOUCH, WITHIN and OVERLAP.
    Since:
    8.0.0
    • Method Summary

      Methods 
      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 queryParam)
      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.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ArcGISRestDataProvider

        public ArcGISRestDataProvider()
        
    • Method Detail

      • createDataset

        public boolean createDataset(java.lang.String datasourceName,
                            DatasetInfo datasetInfo)
        
        Description copied from interface: DataProvider

        In the specified data source, it creates a new data set based on the data set information.

        Specified by:
        createDataset in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource.
        datasetInfo - Data set info.
        Returns:
        Returns true if the dataset is created successfully, false otherwise.
      • deleteDataset

        public boolean deleteDataset(java.lang.String datasourceName,
                            java.lang.String datasetName)
        
        Description copied from interface: DataProvider

        Deletes the specified dataset in the specified data source.

        Specified by:
        deleteDataset in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource.
        datasetName - the dataset name.
      • renameDataset

        public boolean renameDataset(java.lang.String datasourceName,
                            java.lang.String oldName,
                            java.lang.String newName)
        
        Description copied from interface: DataProvider

        Modifies the name of the specified dataset.

        Specified by:
        renameDataset in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource.
        oldName - Old data set name.
        newName - New data set name.
        Returns:
        Returns true if the dataset is modified successfully, false otherwise.
      • copyDataset

        public boolean copyDataset(java.lang.String srcDatasourceName,
                          java.lang.String srcDatasetName,
                          java.lang.String destDatasourceName,
                          java.lang.String destDatasetName)
        
        Description copied from interface: 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.

        Specified by:
        copyDataset in interface DataProvider
        srcDatasetName - Source data set name.
        destDatasourceName - Target data source name.
        destDatasetName - Target data set name.
        Returns:
        Returns true if the dataset is copied successfully, false otherwise.
      • updateFieldInfos

        public void updateFieldInfos(java.lang.String datasourceName,
                            java.lang.String datasetName,
                            java.util.List<FieldInfo> newFieldInfos)
        
        Description copied from interface: 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.

        Specified by:
        updateFieldInfos in interface DataProvider
        Parameters:
        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.
      • updateDatasourceInfo

        public void updateDatasourceInfo(java.lang.String datasourceName,
                                DatasourceInfo newDatasourceInfo)
        
        Description copied from interface: DataProvider

        Updates the original data source information with the new data source information.

        Specified by:
        updateDatasourceInfo in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource.
        newDatasourceInfo - new data source information.
      • updateDatasetInfo

        public void updateDatasetInfo(java.lang.String datasourceName,
                             java.lang.String datasetName,
                             DatasetInfo newDatasetInfo)
        
        Description copied from interface: DataProvider

        In the specified data source, update the information for the specified data set.

        Specified by:
        updateDatasetInfo in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource.
        datasetName - The name of the dataset to be updated.
        newDatasetInfo - New data source information.
      • getDomainInfos

        public java.util.List<DomainInfo> getDomainInfos(java.lang.String datasourceName,
                                                java.lang.String datasetName)
        
        Description copied from interface: DataProvider

        Gets all the domain information for the specified dataset

        Specified by:
        getDomainInfos in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource
        datasetName - the dataset name
        Returns:
        Domain information list
      • containsDataset

        public boolean containsDataset(java.lang.String datasourceName,
                              java.lang.String datasetName)
        
        Description copied from interface: DataProvider

        Determines whether the specified data source contains the specified data set.

        Specified by:
        containsDataset in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource.
        datasetName - the dataset name.
        Returns:
        Returns true if contains the specified dataset, false otherwise.
      • getDatasetInfos

        public java.util.List<DatasetInfo> getDatasetInfos(java.lang.String datasourceName)
        
        Description copied from interface: DataProvider

        Gets all dataset information for the specified data source.

        Specified by:
        getDatasetInfos in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource.
        Returns:
        the list of dataset information.
      • getDatasetInfo

        public DatasetInfo getDatasetInfo(java.lang.String datasourceName,
                                 java.lang.String datasetName)
        
        Description copied from interface: DataProvider

        Gets the specified data set information for the specified data source.

        Specified by:
        getDatasetInfo in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource.
        datasetName - the dataset name.
        Returns:
        Data set information.
      • addFeatures

        public EditResult addFeatures(java.lang.String datasourceName,
                             java.lang.String datasetName,
                             java.util.List<Feature> targetFeatures)
        
        Description copied from interface: 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.

        Specified by:
        addFeatures in interface DataProvider
        Parameters:
        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.
        Returns:
        edit the results.
      • deleteFeatures

        public EditResult deleteFeatures(java.lang.String datasourceName,
                                java.lang.String datasetName,
                                int[] ids)
        
        Description copied from interface: DataProvider

        Removes a set of features in the specified dataset.

        Specified by:
        deleteFeatures in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource.
        datasetName - the dataset name.
        ids - The ID array of the feature to be deleted.
        Returns:
        edit the results.
      • updateFeatures

        public EditResult updateFeatures(java.lang.String datasourceName,
                                java.lang.String datasetName,
                                java.util.List<Feature> targetFeatures)
        
        Description copied from interface: 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.

        Specified by:
        updateFeatures in interface DataProvider
        Parameters:
        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.
        Returns:
        edit the results.
      • clearFeatures

        public boolean clearFeatures(java.lang.String datasourceName,
                            java.lang.String datasetName)
        
        Description copied from interface: DataProvider

        Clears the elements of the specified dataset.

        Specified by:
        clearFeatures in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource.
        datasetName - the dataset name.
        Returns:
        Returns true if the dataset is deleted successfully, false otherwise.
      • 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)
        
        Description copied from interface: DataProvider

        Get the elements within the specified space and meet certain attribute filters.

        Specified by:
        getFeature in interface DataProvider
        Parameters:
        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.
        Returns:
        feature list.
      • getFeature

        public java.util.List<Feature> getFeature(java.lang.String datasourceName,
                                         java.lang.String datasetName,
                                         int[] ids,
                                         java.lang.String[] fields)
        
        Description copied from interface: DataProvider

        Gets the feature in the specified dataset based on the specified feature ID.

        Specified by:
        getFeature in interface DataProvider
        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.
        Returns:
        feature list.
      • getFeature

        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)
        
        Description copied from interface: DataProvider

        Gets the elements that fall within the buffer of the specified space object and satisfy certain attribute filters.

        Specified by:
        getFeature in interface DataProvider
        Parameters:
        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.
        Returns:
        feature list.
      • 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)
        
        Description copied from interface: DataProvider

        Gets the elements that specify a geometric object that has a specific spatial query mode and satisfies the specified attribute filter.

        Specified by:
        getFeature in interface DataProvider
        Parameters:
        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.
        Returns:
        feature list.
      • getFeature

        public java.util.List<Feature> getFeature(java.lang.String datasourceName,
                                         QueryParameter queryParam)
        
        Description copied from interface: DataProvider

        Gets the elements through SQL query criteria.

        Specified by:
        getFeature in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource.
        queryParam - Query parameters.
        Returns:
        feature list.
      • getFeature

        public java.util.List<Feature> getFeature(java.lang.String datasourceName,
                                         QueryParameter queryParam,
                                         int maxFeatures)
        
        Description copied from interface: DataProvider

        Gets the elements through SQL query criteria.

        Specified by:
        getFeature in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource.
        queryParam - Query parameters.
        maxFeatures - The maximum number of features that can be returned.
        Returns:
        Feature lists.
      • getDatasourceInfos

        public java.util.List<DatasourceInfo> getDatasourceInfos()
        
        Description copied from interface: DataProvider

        Get all the data source information corresponding to the current data service provider.

        Specified by:
        getDatasourceInfos in interface DataProvider
        Returns:
        data source information list.
      • getDatasourceInfo

        public DatasourceInfo getDatasourceInfo(java.lang.String datasourceName)
        
        Description copied from interface: DataProvider

        Gets information about the specified data source.

        Specified by:
        getDatasourceInfo in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource.
        Returns:
        data source information.
      • getFieldInfos

        public java.util.List<FieldInfo> getFieldInfos(java.lang.String datasourceName,
                                              java.lang.String datasetName)
        
        Description copied from interface: DataProvider

        Gets all the field information for the specified dataset.

        Specified by:
        getFieldInfos in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource.
        datasetName - the dataset name.
        Returns:
        Field information list.
      • statistic

        public double statistic(java.lang.String datasourceName,
                       java.lang.String datasetName,
                       int fieldIndex,
                       StatisticMode statisticMode)
        
        Description copied from interface: DataProvider

        In the specified data set, statistics and calculations the specified field according to the specified statistical method.

        Specified by:
        statistic in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource.
        datasetName - the dataset name.
        fieldIndex - Field number.
        statisticMode - Statistical methods.
        Returns:
        statistics result.
      • statistic

        public double statistic(java.lang.String datasourceName,
                       java.lang.String datasetName,
                       java.lang.String fieldName,
                       StatisticMode statisticMode)
        
        Description copied from interface: DataProvider

        In the specified data set, statistics and calculations the specified field according to the specified statistical method.

        Specified by:
        statistic in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource.
        datasetName - the dataset name.
        fieldName - Field name.
        statisticMode - Statistical methods.
        Returns:
        statistics result.
      • deleteFeatures

        public EditResult deleteFeatures(java.lang.String datasourceName,
                                QueryParameter queryParam)
        
        Description copied from interface: DataProvider

        Specifies the data source to remove the feature via sql.

        Specified by:
        deleteFeatures in interface DataProvider
        Parameters:
        datasourceName - the name of the datasource.
        queryParam - Query parameter.
        Returns:
        Edits the results.
      • getDatasetNames

        public java.util.List<java.lang.String> getDatasetNames(java.lang.String datasourceName)
        
        Description copied from interface: DataProvider

        Gets all dataset names for the current data source.

        Specified by:
        getDatasetNames in interface DataProvider
        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: DataProvider

        Gets the feature in the specified data set according to the specified feature ID in the way of supporting paging.

        Specified by:
        getFeature in interface DataProvider
        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 paging
        toIndex - The maximum index number for the result of the paging
        Returns:
        Feature lists.