Configure Transportation Analyst Service Provider |
SuperMap iServer supports the following types of transportation analyst service providers:
Configure a UGC transportation analyst provider as follows:
<provider class="com.supermap.services.providers.UGCTransportationAnalystProvider"
inner-providerNames="ugcDataProvider-Changchun" name="transportationAnalystProvider-Changchun">
<config class="com.supermap.services.providers.TransportationAnalystSetting">
<workspaceConnectString>../../samples/data/NetworkAnalyst/Changchun.sxwu</workspaceConnectString>
<datasourceName>Changchun</datasourceName>
<datasetName>RoadNet</datasetName>
<ruleField>TRule</ruleField>
<forwardSingleWayRuleValues>
<string>FT</string>
</forwardSingleWayRuleValues>
<backwardSingleWayRuleValues>
<string>TF</string>
</backwardSingleWayRuleValues>
<twoWayRuleValues>
<string>twoWay</string>
</twoWayRuleValues>
<prohibitedWayRuleValues>
<string>prohibit</string>
</prohibitedWayRuleValues>
<edgeIDField>SmEdgeID</edgeIDField>
<edgeNameField>RoadName</edgeNameField>
<nodeIDField>SmNodeID</nodeIDField>
<nodeNameField>SmNodeID</nodeNameField>
<fromNodeIDField>SmFNode</fromNodeIDField>
<toNodeIDField>SmTNode</toNodeIDField>
<tolerance>500.0</tolerance>
<weightFieldInfos>
<com.supermap.services.components.commontypes.WeightFieldInfo>
<name>length</name>
<forwardWeightField>Length</forwardWeightField>
<backWeightField>Length</backWeightField>
</com.supermap.services.components.commontypes.WeightFieldInfo>
<com.supermap.services.components.commontypes.WeightFieldInfo>
<name>time</name>
<forwardWeightField>FT_TIME</forwardWeightField>
<backWeightField>TF_TIME</backWeightField>
</com.supermap.services.components.commontypes.WeightFieldInfo>
</weightFieldInfos>
<turnDatasetInfo>
<workspaceConnectString>../../samples/data/NetworkAnalyst/Changchun.sxwu</workspaceConnectString>
<datasourceName>Changchun</datasourceName>
<datasetName>RoadNet_TURN</datasetName>
<nodeIDField>NodeID</nodeIDField>
<fromEdgeIDField>FEdgeID</fromEdgeIDField>
<toEdgeIDField>TEdgeID</toEdgeIDField>
<weightFields>
<string>TurnCost</string>
</weightFields>
</turnDatasetInfo>
<analystModeSetting>
<sscSetting>
<enabled>true</enabled>
<levelField>level_User</levelField>
<sscPath>C:\test.ssc</sscPath>
<autoGenerateSsc>false</autoGenerateSsc>
</sscSetting>
</analystModeSetting>
<autoCheckNetwork>false</autoCheckNetwork>
<initFacilityAnalyst>true</initFacilityAnalyst>
<directionField>SmResistanceA</directionField>
</config>
</provider>
Where, class in < provider > identifies the implementation class of the UGC transportation analyst provider, and the class in < config > identifies the configuration class corresponding to the local transportation network analysis service provider, that is, TransportationAnalystSetting . The contents in < config > are the corresponding configuration items, mainly including:
Data source information such as <workspaceConnectString>、<workspaceType>、<datasourceName>、<datasetName>. Among them <workspaceConnectString> represents the path of the workspace used by the service provider. In addition, the workspace path supports reading from environment variables and system configuration files. It can be written as:
<workspaceConnectString>${datapath1}/World.sxwu</workspaceConnectString>
For detailed instructions, please refer to:Preset Local Workspace PathThe data and algorithm parameter information used for local transportation network analysis, such as <turnDatasetInfo>、<weightFieldInfos>、<nodeIDField>、<nodeNameField>、<fromNodeIDField>、<toNodeIDField>、<tolerance>.
Whether to automatically check the network dataset <autoCheckNetwork>, if false, it is a manual check, and the user needs to click the button on the Provider's configuration interface to check; When set to true, it will automatically check.
For a detailed description of these parameters, please refer to: Configuration of UGC Transportation Analyst Provider.
< initFacilityAnalyst >: Whether to initialize the facility network analysis, the default is false. After it is modified to true, the functions of pipe burst analysis, upstream and downstream key facilities search and analysis, and connectivity analysis will be enabled. For details, please refer to: burstAnalyse , upstreamcirticalfaclilities , downstreamcirticalfaclilities、connectedEdges
< directionField >: Flow direction field, when < initFacilityAnalyst > When true, the parameter is required.
< nodeIDFilterField >: This parameter is only used to specify the filter field that generates the default sourceNodeIDs parameter. That is, when the sourceID is null, the node ID whose attribute field value is true will be used as the default sourceNodeIDs. If this parameter is null, all nodeIDs will be used as the default sourceNodeIDs. When <initFacilityAnalyst> is true, this parameter is available.
< analystModeSetting >: An analysis model configuration used to set an analysis model other than basic analysis model, such as the best path analysis SSC analysis model. If this parameter is not set, only the basic analysis model is used.
< sscSetting >: Best Path Analysis SSC analysis model configuration.
< enabled >: Whether to enable best path analysis SSC analysis model.
< levelField>: Road level field。
< sscPath >: The absolute path to the SSC file.
< autoGenerateSsc >: Whether to generate automatically SSC documents. The default is false, which means it will not be generated automatically.
Note: When there is SSC documents shall be used directly. If there is no SSC file and the automatic generation parameter is enabled, the SSC file will be automatically generated. The SSC file is stored in the path specified by the sscPath parameter. When the configuration enables the best path analysis SSC analysis model but does not enable the automatic generation of SSC files and there is no existing SSC file, the service will not be available.
Note: Before configuring a local transportation network service provider, it is recommended to establish field indexes for the fields that identify network arc segment IDs and network node IDs.
Configure a REST transportation analyst service provider as follows:
<provider class="com.supermap.services.providers.RestTransportationAnalystProvider" name="restSpatialProvider">
<config class="com.supermap.services.providers.RestTransportationAnalystProviderSetting">
<restServiceRootURL>http://localhost:8090/iserver/services/transportationanalyst-sample/rest</restServiceRootURL>
<restProviderCacheConfig>
<maxElementsInMemory>1</maxElementsInMemory>
<maxSizeOnDisk>2048</maxSizeOnDisk>
<timeToLiveSeconds>0</timeToLiveSeconds>
<timeToIdleSeconds>0</timeToIdleSeconds>
</restProviderCacheConfig>
<useCache>true</useCache>
</config>
</provider>
The class in < provider > identifies the implementation class of the REST transportation analyst service provider, and the class in < config > identifies the configuration class corresponding to the REST traffic network analysis service provider, that is, RestTransportationAnalystProviderSetting . The contents in < config > are the corresponding configuration items, including:
Configure an ArcGIS REST network analysis service providers as follows:
<provider class="com.supermap.services.providers.ArcGISRestNetworkAnalystProvider" enabled="true" name="transportationAnalyst-Streets_ND3">
<config class="com.supermap.services.providers.ArcGISRestNetworkAnalystProviderSetting">
<restServiceRootURL>http://localhost:6080/arcgis/rest/services/sample/NAServer</restServiceRootURL>
<token/>
<httpReferer/>
<networkDataset>Streets_ND</networkDataset>
<routeLayer>Route</routeLayer>
<serviceAreaLayer>Service Area</serviceAreaLayer>
<closestFacilityLayer>Closest Facility</closestFacilityLayer>
</config>
</provider>
The class in < provider > identifies the implementation class of ArcGIS REST network analysis service providers, and the class in < config > identifies the configuration class corresponding to the ArcGIS REST network analysis service provider, that is, ArcGISRestNetworkAnalystProviderSetting. The contents in < config > are the corresponding configuration items, including: