Oracle Spatial Network Data Model Web Service Tests
This HTML file is a simple example on how to send XML requests to NDM web service.
Before running the tests on this page, you must
Open web.xml under web/WEB-INF.
Check the configuration of the JNDI name for your data source
and make sure it exists on your web server. If not, create the data source with
the above JNDI name. This data source should be where your network data comes from.
Open LODConfigs.xml under web/WEB-INF/config. Make sure your network
is properly configured.
Shortest Path Analysis Without Constraints
Shortest Path Analysis With No Highway Constraint
<?xml version="1.0" ?>
<networkAnalysisRequest
xmlns="http://xmlns.oracle.com/spatial/network"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gml="http://www.opengis.net/gml">
<networkName>HERE_SF_NET</networkName>
<shortestPath>
<startPoint>
<nodeID>48492015</nodeID>
</startPoint>
<endPoint>
<nodeID>968987460</nodeID>
</endPoint>
<constraint>
<className>oracle.spatial.network.examples.ndmdemo.custom.NoHighwayConstraint</className>
<parameters/>
</constraint>
<subPathRequestParameter>
<cost> true </cost>
<isFullPath> true </isFullPath>
<startLinkIndex> true </startLinkIndex>
<startPercentage> true </startPercentage>
<endLinkIndex> true </endLinkIndex>
<endPercentage> true </endPercentage>
<pathRequestParameter>
<cost> true </cost>
<isSimple> true </isSimple>
<startNodeID>true</startNodeID>
<endNodeID>true</endNodeID>
<noOfLinks>true</noOfLinks>
<linksRequestParameter>
<onlyLinkID>true</onlyLinkID>
</linksRequestParameter>
<nodesRequestParameter>
<onlyNodeID>true</onlyNodeID>
</nodesRequestParameter>
</pathRequestParameter>
</subPathRequestParameter>
</shortestPath>
</networkAnalysisRequest>
Shortest Path Analysis With Prohibited Zone Constraint
<?xml version="1.0" ?>
<networkAnalysisRequest
xmlns="http://xmlns.oracle.com/spatial/network"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gml="http://www.opengis.net/gml">
<networkName>HERE_SF_NET</networkName>
<shortestPath>
<startPoint>
<nodeID>48492015</nodeID>
</startPoint>
<endPoint>
<nodeID>968987460</nodeID>
</endPoint>
<constraint>
<className>oracle.spatial.network.examples.ndmdemo.custom.ProhibitedZoneConstraint</className>
<parameters>
<prohibitedLinks>430571 910430566 910430567 -910430568 910430587 -910430587 -910430589 910430589 936507767 -936507767 -936507768 936507768 945903679 -945903679 -945903680 945903680 -910514827 910514827 -910430569 -724682237 724791618 910430586 -910430586 120887289 -120887289 23737902 910430588 -910430588</prohibitedLinks>
<prohibitedNodes>199459625 199514127 199742411 199722431 199788589 199686046 199424489 199491652 915150607 199381179 199413306 199481657 199474081 199623184</prohibitedNodes>
</parameters>
</constraint>
<subPathRequestParameter>
<cost> true </cost>
<isFullPath> true </isFullPath>
<startLinkIndex> true </startLinkIndex>
<startPercentage> true </startPercentage>
<endLinkIndex> true </endLinkIndex>
<endPercentage> true </endPercentage>
<pathRequestParameter>
<cost> true </cost>
<isSimple> true </isSimple>
<startNodeID>true</startNodeID>
<endNodeID>true</endNodeID>
<noOfLinks>true</noOfLinks>
<linksRequestParameter>
<onlyLinkID>true</onlyLinkID>
</linksRequestParameter>
<nodesRequestParameter>
<onlyNodeID>true</onlyNodeID>
</nodesRequestParameter>
</pathRequestParameter>
</subPathRequestParameter>
</shortestPath>
</networkAnalysisRequest>
Nearest Neighbors Analysis
<?xml version="1.0" ?>
<networkAnalysisRequest
xmlns="http://xmlns.oracle.com/spatial/network"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<networkName>HERE_SF_NET</networkName>
<nearestNeighbors>
<startPoint>
<nodeID>968987460</nodeID>
</startPoint>
<noOfNeighbors> 10 </noOfNeighbors>
<subPathRequestParameter>
<cost> true </cost>
<isFullPath> true </isFullPath>
<pathRequestParameter>
<cost> true </cost>
<endNodeID>true</endNodeID>
</pathRequestParameter>
</subPathRequestParameter>
</nearestNeighbors>
</networkAnalysisRequest>
Nearest Reaching Neighbors Analysis
<?xml version="1.0" ?>
<networkAnalysisRequest
xmlns="http://xmlns.oracle.com/spatial/network"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<networkName>HERE_SF_NET</networkName>
<nearestReachingNeighbors>
<endPoint>
<nodeID>968987460</nodeID>
</endPoint>
<noOfNeighbors> 10 </noOfNeighbors>
<subPathRequestParameter>
<cost> true </cost>
<isFullPath> true </isFullPath>
<pathRequestParameter>
<cost> true </cost>
<endNodeID>true</endNodeID>
</pathRequestParameter>
</subPathRequestParameter>
</nearestReachingNeighbors>
</networkAnalysisRequest>
Within Cost Analysis
<?xml version="1.0" ?>
<networkAnalysisRequest
xmlns="http://xmlns.oracle.com/spatial/network"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<networkName>HERE_SF_NET</networkName>
<withinCost>
<startPoint>
<nodeID>968987460</nodeID>
</startPoint>
<cost> 200 </cost>
<subPathRequestParameter>
<cost> true </cost>
<isFullPath> true </isFullPath>
<pathRequestParameter>
<cost> true </cost>
<endNodeID>true</endNodeID>
<noOfLinks>true</noOfLinks>
</pathRequestParameter>
</subPathRequestParameter>
</withinCost>
</networkAnalysisRequest>
Within Cost Polygon Analysis
<?xml version="1.0" ?>
<networkAnalysisRequest
xmlns="http://xmlns.oracle.com/spatial/network"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<networkName>HERE_SF_NET</networkName>
<withinCostPolygon>
<startPoint>
<nodeID>968987460</nodeID>
</startPoint>
<cost> 200 </cost>
</withinCostPolygon>
</networkAnalysisRequest>
K-Shortest Paths Analysis With Default Algorithm
<?xml version="1.0" ?>
<networkAnalysisRequest
xmlns="http://xmlns.oracle.com/spatial/network"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gml="http://www.opengis.net/gml">
<networkName>HERE_SF_NET</networkName>
<kShortestPaths>
<startPoint>
<nodeID>48492015</nodeID>
</startPoint>
<endPoint>
<nodeID>968987460</nodeID>
</endPoint>
<k> 5 </k>
<subPathRequestParameter>
<cost> true </cost>
<isFullPath> true </isFullPath>
<startLinkIndex> true </startLinkIndex>
<startPercentage> true </startPercentage>
<endLinkIndex> true </endLinkIndex>
<endPercentage> true </endPercentage>
<pathRequestParameter>
<cost> true </cost>
<isSimple> true </isSimple>
<startNodeID>true</startNodeID>
<endNodeID>true</endNodeID>
<noOfLinks>true</noOfLinks>
<linksRequestParameter>
<onlyLinkID>true</onlyLinkID>
</linksRequestParameter>
<nodesRequestParameter>
<onlyNodeID>true</onlyNodeID>
</nodesRequestParameter>
</pathRequestParameter>
</subPathRequestParameter>
</kShortestPaths>
</networkAnalysisRequest>
K-Shortest Paths Analysis With User Specified Algorithm
<?xml version="1.0" ?>
<networkAnalysisRequest
xmlns="http://xmlns.oracle.com/spatial/network"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gml="http://www.opengis.net/gml">
<networkName>HERE_SF_NET</networkName>
<kShortestPaths>
<startPoint>
<nodeID>48492015</nodeID>
</startPoint>
<endPoint>
<nodeID>968987460</nodeID>
</endPoint>
<k> 5 </k>
<kShortestPathsAlgorithm>
<className>oracle.spatial.network.lod.YenDeviation</className>
<parameters>
<shortestPathAlgorithm>
<className>oracle.spatial.network.lod.AStar</className>
<parameters>
<heuristicCostFunction>
<className>oracle.spatial.network.lod.GeodeticCostFunction</className>
<parameters>
<userDataCategory>0</userDataCategory>
<xCoordUserDataIndex>0</xCoordUserDataIndex>
<yCoordUserDataIndex>1</yCoordUserDataIndex>
</parameters>
</heuristicCostFunction>
<linkLevelSelector>
<className>oracle.spatial.network.lod.DynamicLinkLevelSelector</className>
<parameters>
<maxLinkLevel>2</maxLinkLevel>
<costThreshold linkLevel="1">40000</costThreshold>
<numHighLevelNeighbors>8</numHighLevelNeighbors>
<costMultiplier>1.5</costMultiplier>
<costFunction>
<className>oracle.spatial.network.lod.GeodeticCostFunction</className>
<parameters>
<userDataCategory>0</userDataCategory>
<xCoordUserDataIndex>0</xCoordUserDataIndex>
<yCoordUserDataIndex>1</yCoordUserDataIndex>
</parameters>
</costFunction>
</parameters>
</linkLevelSelector>
</parameters>
</shortestPathAlgorithm>
</parameters>
</kShortestPathsAlgorithm>
<subPathRequestParameter>
<cost> true </cost>
<isFullPath> true </isFullPath>
<startLinkIndex> true </startLinkIndex>
<startPercentage> true </startPercentage>
<endLinkIndex> true </endLinkIndex>
<endPercentage> true </endPercentage>
<pathRequestParameter>
<cost> true </cost>
<isSimple> true </isSimple>
<startNodeID>true</startNodeID>
<endNodeID>true</endNodeID>
<noOfLinks>true</noOfLinks>
<linksRequestParameter>
<onlyLinkID>true</onlyLinkID>
</linksRequestParameter>
<nodesRequestParameter>
<onlyNodeID>true</onlyNodeID>
</nodesRequestParameter>
</pathRequestParameter>
</subPathRequestParameter>
</kShortestPaths>
</networkAnalysisRequest>
TSP Analysis With Default Algorithm
<?xml version="1.0" ?>
<networkAnalysisRequest
xmlns="http://xmlns.oracle.com/spatial/network"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<networkName>HERE_SF_NET</networkName>
<tsp>
<tspPoint>
<nodeID>48524598</nodeID>
</tspPoint>
<tspPoint>
<nodeID>48524056</nodeID>
</tspPoint>
<tspPoint>
<nodeID>48507036</nodeID>
</tspPoint>
<tourFlag>CLOSED</tourFlag>
<tspPathRequestParameter>
<cost> true </cost>
<tspOrder> true </tspOrder>
<subPathRequestParameter>
<cost> true </cost>
<isFullPath> true </isFullPath>
<startLinkIndex> true </startLinkIndex>
<startPercentage> true </startPercentage>
<endLinkIndex> true </endLinkIndex>
<endPercentage> true </endPercentage>
<pathRequestParameter>
<cost> true </cost>
<isSimple> true </isSimple>
<startNodeID>true</startNodeID>
<endNodeID>true</endNodeID>
<noOfLinks>true</noOfLinks>
<linksRequestParameter>
<onlyLinkID>true</onlyLinkID>
</linksRequestParameter>
<nodesRequestParameter>
<onlyNodeID>true</onlyNodeID>
</nodesRequestParameter>
</pathRequestParameter>
</subPathRequestParameter>
</tspPathRequestParameter>
</tsp>
</networkAnalysisRequest>
TSP Analysis With User Specified Algorithm
<?xml version="1.0" ?>
<networkAnalysisRequest
xmlns="http://xmlns.oracle.com/spatial/network"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<networkName>HERE_SF_NET</networkName>
<tsp>
<tspPoint>
<nodeID>48524598</nodeID>
</tspPoint>
<tspPoint>
<nodeID>48524056</nodeID>
</tspPoint>
<tspPoint>
<nodeID>48507036</nodeID>
</tspPoint>
<tourFlag>CLOSED</tourFlag>
<tspAlgorithm>
<className>oracle.spatial.network.lod.TspOp2</className>
<parameters>
<tolerance>0.000001</tolerance>
<shortestPathAlgorithm>
<className>oracle.spatial.network.lod.AStar</className>
<parameters>
<heuristicCostFunction>
<className>oracle.spatial.network.lod.GeodeticCostFunction</className>
<parameters>
<userDataCategory>0</userDataCategory>
<xCoordUserDataIndex>0</xCoordUserDataIndex>
<yCoordUserDataIndex>1</yCoordUserDataIndex>
</parameters>
</heuristicCostFunction>
<linkLevelSelector>
<className>oracle.spatial.network.lod.DynamicLinkLevelSelector</className>
<parameters>
<maxLinkLevel>2</maxLinkLevel>
<costThreshold linkLevel="1">40000</costThreshold>
<numHighLevelNeighbors>8</numHighLevelNeighbors>
<costMultiplier>1.5</costMultiplier>
<costFunction>
<className>oracle.spatial.network.lod.GeodeticCostFunction</className>
<parameters>
<userDataCategory>0</userDataCategory>
<xCoordUserDataIndex>0</xCoordUserDataIndex>
<yCoordUserDataIndex>1</yCoordUserDataIndex>
</parameters>
</costFunction>
</parameters>
</linkLevelSelector>
</parameters>
</shortestPathAlgorithm>
<pairwiseCostCalculator>
<className>oracle.spatial.network.examples.ndmdemo.custom.GeodeticPairwiseCostCalculator</className>
<parameters>
<userDataCategory>0</userDataCategory>
<xCoordUserDataIndex>0</xCoordUserDataIndex>
<yCoordUserDataIndex>1</yCoordUserDataIndex>
</parameters>
</pairwiseCostCalculator>
</parameters>
</tspAlgorithm>
<tspPathRequestParameter>
<cost> true </cost>
<tspOrder> true </tspOrder>
<subPathRequestParameter>
<cost> true </cost>
<isFullPath> true </isFullPath>
<startLinkIndex> true </startLinkIndex>
<startPercentage> true </startPercentage>
<endLinkIndex> true </endLinkIndex>
<endPercentage> true </endPercentage>
<pathRequestParameter>
<cost> true </cost>
<isSimple> true </isSimple>
<startNodeID>true</startNodeID>
<endNodeID>true</endNodeID>
<noOfLinks>true</noOfLinks>
<linksRequestParameter>
<onlyLinkID>true</onlyLinkID>
</linksRequestParameter>
<nodesRequestParameter>
<onlyNodeID>true</onlyNodeID>
</nodesRequestParameter>
</pathRequestParameter>
</subPathRequestParameter>
</tspPathRequestParameter>
</tsp>
</networkAnalysisRequest>