SuperMap iServer supports the following types of data service providers:

Configuring local data service provider

Configure a local data service provider as illustrated below:

<provider name="ugcDataProvider1" class="com.supermap.services.providers.UGCDataProvider">
      <config class="com.supermap.services.providers.UGCDataProviderSetting">
          <workspacePath>../../samples/data/World/World.sxwu</workspacePath>
          <excludedFieldsInDatasources>
            <com.supermap.services.providers.ExcludedFieldsInDatasource>
              <dataSourceName>World</dataSourceName>
              <!-- Set exclusion fields -->
              <excludedFieldsInDatasets>
                 <com.supermap.services.providers.ExcludedFieldsInDataset>
                   <datasetName>Countries</datasetName>
                   <excludedFields>SMID,SmUserID</excludedFields>
                 </com.supermap.services.providers.ExcludedFieldsInDataset>
               </excludedFieldsInDatasets>
             <com.supermap.services.providers.ExcludedFieldsInDatasource>
           </excludedFieldsInDatasources>
           <!-- Delayed commit configuration -->
           <dataProviderDelayCommitSetting>
              <enabled>false</enabled>
              <logEntireErrorMsg>true</logEntireErrorMsg>
              <dayOfWeek>1,2,3,4,5,6,7</dayOfWeek>
              <hour>3</hour>
              <minute>0</minute>
              <commitMode>SPECIFICTIME</commitMode>
              <countToCommit>1000</countToCommit>
              <updateInterval>300</updateInterval>
              <cachePath>/output</cachePath>
           </dataProviderDelayCommitSetting>
           <!-- Set the info of the datasources and datasets to be published -->
           <datasourceInfos>
              <com.supermap.services.providers.FilteredDatasourceInfo>
                 <datasourceName>China</datasourceName>
                 <includedDatasetNames>
                   <string>World_Continent_pg</string>
                   <string>Island_B_pg</string>
                   <string>World_Ocean_txt</string>
                 </includedDatasetNames>
              </com.supermap.services.providers.FilteredDatasourceInfo>
           </datasourceInfos>
        </config>
</provider>

Where the class in <provider> identifies the implementation class of the local data service provider. The class in <config> identifies the configuration class corresponding to the local data service provider, that is, UGCDataProviderSetting. The contents of <config> are the corresponding configuration items.

  • <workspacePath>: The path of the workspace used by the service provider. If the workspace has a password, assuming the password is supermap, then write:   
  • <workspacePath>server=../samples/data/World/World.sxwu;password=supermap</workspacePath> 
    In addition, the workspace path supports reading from environment variables and system configuration files. It can be written as:
    <workspacePath>server=${datapath1}/World.sxwu;password=supermap</workspacePath> 
    For details, see: Presetting local workspace path
  • <excludedFieldsInDatasources>: Used to set the exclusion fields, this parameter is optional. The administrator can exclude the fields of the specified dataset based on needs, and the excluded fields will not be visible when the user performs a data query operation.

Where, com.supermap.services.providers.ExcludedFieldsInDatasource and com.supermap.services.providers.ExcludedFieldsInDataset are the implementation class for exclusion fields. <dataSourceName> is the name of datasource, <datasetName> is the name of dataset, <excludedFields> is the fields you want to exclude.

  •  <dataProviderDelayCommitSetting>: Delayed submission setting for feature operations. When this setting is enabled, the system will delay the submission of the action based on the set time after the editing of the feature. This parameter is optional. When not set, the editing of feature will be submitted synchronously and take effect immediately. This parameter is available when the data is allowed to edit. Specific settings include:
  • <enabled>: Whether to enable delayed submission.
  • <logEntireErrorMsg>: Whether to open the console error log. When this setting is turned on, the detailed error message will be displayed on the console panel.
  • <commitMode>: Set the submission method, including timing submission SPECIFICTIME and the interval submission INTERVALUPDATE. Timing submission means batch submission at specific time point, you need to set <dayOfWeek>, <hour>, <minute>. Interval submission means that a batch submission is made at regular intervals, you need to set <updateInterval> parameter.
  • <countToCommit>: Maximum number of requests. This parameter is valid only when the "commitMode" is INTERVALUPDATA. For example, the value is 1000, before reaching the specified time, if the number of data editing requests has reached 1000, the system will automatically submit these operations.
  • <dayOfWeek>: Set the update cycle. For example, <dayOfWeek>1,3,5</dayOfWeek>means that the operations will be automatically submitted on Mondays, Wednesdays and Sundays. This parameter is valid when the "commitMode" is SpecificTime.
  • <hour>: Set how many hours to submit(24 hours). This parameter is valid when the "commitMode" is SpecificTime.
  • <minute>: Set how many minutes to submit. This parameter is valid when the "commitMode" is SpecificTime.
  • <updateInterval>: Commit interval in seconds. For example, <updateInterval>300</updateInterval>means that data is updated every 300 seconds. This parameter is valid when the "commitMode" is IntervalUpdate.
  • <cachePath>: The storage path for the operation information. When it reaches the specified time, the system will automatically submit these operation information files to the background to finish the editing of elements.
  • <datasourceInfos>: The list of datasources information, which can contain 0 to multiple com.supermap.services.providers.FilteredDatasourceInfo nodes.
  • <com.supermap.services.providers.FilteredDatasourceInfo>: This node is used to set the datasource information to be published. Among them, you can set the datasource names and the contained dataset names and other information. Administrators can select some datasources or datasets to publish as needed. Specifically, the parameters can be set as follows:

               a. When the datasource name exists, you need to set:

    • <datasourceName>: The name of the datasource.
    • <includedDatasetNames>: Set the list of datasets to be published.

               b. When the datasource name does not exist, you need to set:

    • <connInfo>: Datasource connection information.
      • <alias>: Datasource alias.
      • <engineType>: The engine type.
      • <server>: The service address of the database.
      • <dataBase>: The name of the database.
      • <driver>: The name of the driver required for the datasource connection.
      • <password>: Password.
      • <user>: Username.
      • <connect>: Whether the datasource automatically connects to the data.
      • <exclusive>: Whether to open the datasource exclusively.
      • <openLinkTable>: Whether to open other non-SuperMap data tables in the database as LinkTable.
      • <readOnly>: Whether to open in a read-only mode.
    • <includedDatasetNames>: List of datasets to be filtered.

Configuring REST data service provider

Configure a REST data service provider as illustrated below:

<provider name="restMapProvider1" class="com.supermap.services.providers.RESTDataProvider">
        <config class="com.supermap.services.providers.RESTDataProviderSetting">
                <restServiceRootURL>http://localhost:8090/iserver/services/rest</restServiceRootURL>
                <token>GsXST0cE0CumxQUFXBX7Oopin4<token>
        </config>
</provider>

Where the class of <provider> identifies the implementation class of the REST data service provider, the class in <config> identifies the configuration class corresponding to the REST data service provider, that is, RestDataProviderSetting, and the contents of <config> are the corresponding configuration items.

  • <restServiceRootURL>: REST data service address, pointing at the root resource path, such as http://localhost:8090/iserver/services/data-world/rest.
  • <useCache>: Whether to use caches. Default is true. After opening the REST cache, the REST request to the resource will be cached locally for later use when receiving the same requests again.
  • <restProviderCacheConfig>: Settings for storing the historical cached requests in memory, including:
  • <maxElementsInMemory>: The maximum of request records allowed in memory. 0 means no limitation; 1 means do not use  memory to cache, default is 1. If not 1, the priority is to store the request record in memory.
  • <maxSizeOnDisk>: The maximum allocated disk capacity. The unit is MB, the default size is 2048 MB.
  • <timeToLiveSeconds>: Used to set the upper limit for the survival of the cache, when time's up, the cache will be removed. Timing starts from the creation of the record, the unit is second. The default is 0, means permanent survival.
  • <timeToIdleSeconds>: Used to set the upper limit for the idle time of the cache, when time's up, the cache will be removed. Timing starts from last access time, the unit is second. The default is 0, means permanent survival.
  • <token>, <httpReferer>: When enabling security machanism, accessing the protected REST resources requires Token . If the token used is applied by the way of HTTP referer, the corresponding <httpReferer> needs to be set.

Configuring ArcGIS REST feature service provider

Configure a ArcGIS REST feature service provider as illustrated below:

<provider class="com.supermap.services.providers.ArcGISRestDataProvider" enabled="true" name="arcgisRestDataProvider-test"> 
      <config class="com.supermap.services.providers.ArcGISRestDataProviderSetting"> 
        <restServiceRootURL>http://localhost:6080/arcgis/rest/services/SampleWorldCities/FeatureServer</restServiceRootURL>  
        <token>51fda53ceb25478cb37fa059ab013160</token>  
      </config> 
    </provider>

Where the class of <provider> identifies the implementation class of the ArcGIS REST feature service provider, the class of <config> identifies the ArcGISRestDataProviderSetting, and the content of <config> is its corresponding configuring items:

  • <restServiceRootURL>: ArcGIS REST feature service address, pointing to the root resource path of the service.
  • <token>, <httpReferer>: When enabling security machanism, accessing the protected REST resources requires Token . If the token used is applied by the way of HTTP referer, the corresponding <httpReferer> needs to be set.

Configuring WFS data service provider

Configure a WFS data service provider as illustrated below:

<provider class="com.supermap.services.providers.WFSDataProvider"
        enabled="true" name="wfsDataProvider-test">
        <config class="com.supermap.services.providers.WFSDataProviderSetting">
                <serviceRootURL>http://localhost:8090/iserver/services/data-world/wfs100/utf-8</serviceURL>
        </config>
</provider>

Where the class of <provider> identifies the implementation class of the REST data service provider, the class of <config> identifies the WFSDataProviderSetting, and the content of <config> is its corresponding configuring items:

  • <serviceRootURL>: The specific wfs service address.
  • <idMappingClassName>: FeatureID converter class name, used to convert the Feature ID represented as a string in the wfs service to an integer that is required in iServer.  iServer defaults to convert the number at the end of the string of Feature ID in wfs to an integer as the feature ID of the SuperMap iServer. Users can also customize a new conversion rules by implementing the FeatureIDMapping interface.

Configuring GeoPackage data service provider

Configure a GeoPackage data service provider, as shown below:

<provider class="com.supermap.services.providers.GeoPackageDataProvider"  enabled="true"  name="gpkgData-samplevectors">  
      <config class="com.supermap.services.providers.GeoPackageDataProviderSetting"> 
             <filePath>../../samples/sample_vectors.gpkg</filePath>  
      </config>  
</provider> 

Where the class of <provider> identifies the implementation class of GeoPackage data service provider, the class of <config> identifies the configuration class corresponding to GeoPackage data service provider, namely the contents in GeoPackageDataProviderSetting correspond to the contents in GeoPackageDataProviderSetting.

Configuring Shape data service provider

The configuration of a Shape data service provider is shown below:

    <provider class="com.supermap.services.providers.ShapeFileDataProvider" enabled="true" name="ShapedataProvider-">
      <config class="com.supermap.services.providers.ShapeFileDataProviderSetting">
        <shpDir>E:/supermap/data/shp</shpDir> 
        <charset>UTF-8</charset>
      </config>
    </provider> 

The class attribute in <provider> represents the implementation class of the  Shape data service provider, the class attribute in the <config> represents the configuration class of Shape data service provider, that is ShapeFileDataProviderSetting, and the contents of <config> are the configuration items of  ShapeFileDataProviderSetting as follows:

  • <shpDir>: The Shape file path.
  • <charset>: The encoding format of the Shape file.

 

Configuring PostGIS data service provider

The configuration of a PostGIS data service provider is shown below:

    <provider class="com.supermap.services.providers.PostgisDataProvider" enabled="true" name="data-postGIS">
      <config class="com.supermap.services.providers.PostgisDataProviderSetting"> 
        <dbType>postgis</dbType>  
        <host>192.168.17.212</host>  
        <port>5432</port>  
        <database>postGIS</database>  
        <user>postgres</user>  
        <passwd>iserver</passwd> 
      </config>
    </provider> 

The class attribute in <provider> represents the implementation class of the  PostGIS data service provider, the class attribute in the <config> represents the configuration class of PostGIS data service provider, that is PostgisDataProviderSetting, and the contents of <config> are the configuration items of  PostgisDataProviderSetting as follows:

  • <dbType>: Database type.
  • <host>: The address of the PostGIS server.
  • <port>: The port number of the PostGIS server.
  • <database>: The database used to store the data to be published.
  • <username>: The name of the user who have the permission to access dababase.
  • <password>: The password of the user.

Configuring HBase data service provider

The configuration of a HBase data service provider is shown below:

    <provider class="com.supermap.services.providers.HBaseDataProvider" enabled="true" name="data-hbase">
      <config class="com.supermap.services.providers.HBaseDataProviderSetting"> 
        <maxFeatures>1000</maxFeatures>  
        <catalog>hbase</catalog>  
        <zookeepers>localhost:2181</zookeepers>
      </config>
    </provider> 

The class attribute in <provider> represents the implementation class of the  HBase data service provider, the class attribute in the <config> represents the configuration class of HBase data service provider, that is HBaseDataProviderSetting, and the contents of <config> are the configuration items of  HBaseDataProviderSetting as follows:

  • <maxFeatures>: Used to set the maximum number of result features returned by the server by default. The default is 1000.
  • <catalog>: The storage directory of Hbase data.
  • <zookeepers>:  zookeeper address, you can set multiple values, separated by commas.
  • <filePath>: GeoPackage database file path.