服务提供者为服务组件提供功能,是服务组件业务逻辑处理的来源。SuperMap iServer 提供了自定义服务提供者的功能,可以通过修改服务配置文件iserver-services.xml(参见iServer 配置文件说明)实现。服务提供者的配置包括工作空间路径、缓存路径、缓存访问路径等,服务提供者类型不同,配置项的内容也不同。
服务提供者的具体配置在<provider/>节点中进行,而其基本类型、实现类和配置类等信息如表1_服务提供者实现与配置所示。
预设本地工作空间路径
对于数据来源为本地工作空间的服务提供者,除了在XML配置文件中直接写入完整或相对数据路径外,iServer 还支持在环境变量、系统配置文件中预设工作空间路径。
如果您预设了数据路径,则通过 XML 配置服务提供者时,可以直接读取预设路径下的工作空间数据,不必再写出完整的数据路径。
通过环境变量预设
具体操作如下:
- 指定工作空间或工作空间文件所在的路径
- 在操作系统的环境变量中,创建新的环境变量并指向工作空间文件,如:data1、idata2,分别指向:data1=E:/supermap/data/China400.smwu、data2=E:/supermap/data/Jingjin.sxwu
- 或者,创建新的环境变量并指向工作空间所在的路径,如:datapath1、datapath2,分别指向数据路径:datapath1=E:/supermap/data1,datapath2=E:/supermap/data2
- 配置服务提供者,在工作空间路径配置项中写入已有的环境变量
- 对于 ${iServerData1},写法如:<workspacePath>${data1}<workspacePath>
- 对于${iServerDataPath1},写法如:<workspacePath>${datapath1}/China400.smwu<workspacePath>
通过系统配置文件预设
具体操作如下:
- 在系统配置文件iserver-system.xml的<properties>节点中添加代表工作空间文件或路径的一个或多个变量,详见:iServer 配置文件说明
- 如:<data1>,并配置信息:<data1>E:/supermap/data/China.smwu</data1>
- 如:<datapath1>,并配置信息:<datapath1>E:/supermap/data</datapath1>
- 配置服务提供者,在工作空间路径配置项中写入已有的环境变量
- 对于 ${data1},写法如:<workspacePath>${data1}<workspacePath>
- 对于${datapath1},写法如:<workspacePath>${datapath1}/China400.smwu<workspacePath>
上述环境变量、系统配置文件两种方式均可实现预设本地工作空间数据。但是,如果您同时使用上述两种方式设置了工作空间,iServer 会优先使用环境变量中设置的数据。
服务提供者实现与配置类
服务提供者类型 |
服务提供者实现类 (com.supermap.services.providers.*) |
服务提供者配置类 (com.supermap.services.providers.*) |
|
数据 | UGCDataProvider | UGCDataProviderSetting | |
WFSDataProvider | WFSDataProviderSetting | ||
RestDataProvider | RestDataProviderSetting | ||
ArcGISRestDataProvider | ArcGISRestDataProviderSetting | ||
AggregationDataProvider | AggregationDataProviderSetting | ||
GeoPackageDataProvider | GeoPackageDataProviderSetting | ||
ShapefileDataProvider | ShapefileDataProviderSetting | ||
PostgisDataProvider | PostgisDataProviderSetting | ||
GeoTrellis 数据服务提供者 |
GeotrellisDataProvider |
GeotrellisDataProviderSetting |
|
BlockchainDataProvider |
BlockchainDataProviderSetting |
||
ElasticsearchDataProvider |
ElasticsearchDataProviderSetting |
||
地图 | UGCMapProvider | UGCMapProviderSetting | |
RestMapProvider | RestMapProviderSetting | ||
CloudMapProvider | CloudMapProviderSetting | ||
FastDFSTileProvider | FastDFSTileProviderSetting | ||
GDPMapProvider | GDPMapProviderSetting | ||
MongoDBTileProvider | MongoDBTileProviderSetting | ||
MongoDBMVTTileProvider | MongoDBTileProviderSetting | ||
SMTilesMapProvider | SMTilesMapProviderSetting | ||
SVTilesMapProvider | SVTilesMapProviderSetting | ||
UGCV5TileProvider | UGCV5TileProviderSetting | ||
MVTTileProvider | MVTTileProviderSetting | ||
WMSMapProvider | WMSMapProviderSetting | ||
WMTSMapProvider | WMTSMapProviderSetting | ||
RestMapProvider | RestMapProviderSetting | ||
BingMapsMapProvider | BingMapsMapProviderSetting | ||
GoogleMapsMapProvider | GoogleMapsMapProviderSetting | ||
TiandituMapProvider | TiandituMapProviderSetting | ||
ArcGISRestMapProvider | ArcGISRestMapProviderSetting | ||
ArcGISCacheMapProvider |
ArcGISCacheMapProviderSetting |
||
ArcGISCacheV2MapProvider |
ArcGISCacheMapProviderSetting |
||
TPKMapProvider |
TPKMapProviderSetting |
||
VTPKMapProvider | VTPKMapProviderSetting | ||
GeoTrellisMapProvider | GeoTrellisMapProviderSetting | ||
BlockchainMapProvider | BlockchainMapProviderSetting | ||
AggregationMapProvider | AggregationMapProviderSetting | ||
MultiTilesProvider | MultiTilesProviderSetting | ||
BaiduMapProvider | BaiduMapProviderSetting | ||
OpenStreetMapProvider | OpenStreetMapProviderSetting | ||
GeoPackageMapProvider | GeoPackageMapProviderSetting | ||
ShapefileMapProvider | ShapefileMapProviderSetting | ||
PostgisMapProvider | PostgisMapProviderSetting | ||
OTSTileProvider |
OTSTileProviderSetting |
||
ZXYTilesMapProvider |
ZXYTilesMapProviderSetting |
||
三维 | UGCRealspaceProvider | UGCRealspaceProviderSetting | |
RestRealspaceProvider | RestRealspaceProviderSetting | ||
MongoDBRealspaceProvider | MongoDBRealspaceProviderSetting | ||
OssRealspaceProvider | OssRealspaceProviderSetting | ||
SuperMapTilesRealspaceProvider | SuperMapTilesRealspaceProviderSetting | ||
ThreeDTilesRealspaceProvider | ThreeDTilesRealspaceProviderSetting | ||
MVTTileRealspaceProvider | ThreeDTilesRealspaceProviderSetting | ||
LocalRealspaceProvider | LocalRealspaceProviderSetting | ||
空间分析 | UGCSpatialAnalystProvider | UGCSpatialAnalystProviderSetting | |
RestSpatialAnalystProvider | RestSpatialAnalystProviderSetting | ||
交通网络分析 | UGCTransportationAnalystProvider | TransportationAnalystSetting | |
RestTransportationAnalystProvider | RestTransportationAnalystProviderSetting | ||
ArcGISRestNetworkAnalystProvider | ArcGISRestNetworkAnalystProviderSetting | ||
交通换乘分析 | UGCTrafficTransferAnalystProvider | TrafficTransferAnalystSetting | |
RestTrafficTransferAnalystProvider | RestTrafficTransferAnalystProviderSetting | ||
三维网络分析 | UGCNetworkAnalyst3DProvider | NetworkAnalyst3DSetting | |
几何 |
Geometry 服务提供者 |
GeoToolsGeometryProvider | DefaultProviderConfig |
影像 | UGCImageServiceProvider | ImageProviderSetting | |
地址匹配 |
REST 地址匹配服务提供者 |
RestAddressMatchProvider | RestAddressMatchProviderSetting |
UGCAddressMatchProvider | UGCAddressMatchProviderSetting | ||
动态标绘 | UGCPlotProvider | UGCPlotProviderSetting | |
RestPlotProvider | RestPlotProviderSetting |