SpiderNetwork

Land Desktop Map 3D Samples

 
SpiderNetwork
 
 
 

When you enter the SpiderNetwork command on the Map command-line, you cause an instance of the SpiderNetwork class to be created and its RunSpiderNetwork method to be executed.

The RunSpiderNetwork method does the following:

  1. Prints SpiderNetwork... to the command-line.
  2. Connects to the SpiderNetwork\Data\crime.sdf file. This data store contains a set of points which represent the location of crimes. Each feature contains an integer field containing the feature id of a police station. This is described in the topic ConnectToSdfFile.
  3. Connects to the SpiderNetwork\Data\policestation.sdf file. This data store contains a set of points which represent the location of police station. This is described in the topic ConnectToSdfFile.
  4. Creates an sdf file in the local filesystem to hold the results and uses the Resource Service to give it an MgResourceIdentifier. This is described in the topic CreateSdfFile.
  5. Gets all of the features in the policestation.sdf and loops over them.
  6. Extracts the point geometry and feature id from the policestation feature.
  7. Gets all of the features in the crime.sdf data store whose PoliceStationResponded property value is equal to the policestation feature id, which is currently being read and loops over them.
  8. Extracts the point geometry from the crime feature currently being read and creates a LineString geometry whose start point is the police station point geometry and whose end point is the crime location point geometry.
  9. Uses the LineString geometry to create a geometry property and adds it to a property collection.
  10. Uses the police station feature id to create an integer property and adds it to the same property collection.
  11. Creates an MgInsertFeatures command for the feature in the property collection and adds the command to a feature command collection.
  12. Uses an MgFeatureService object to execute the command in the feature command collection to insert the feature into the results sdf file.
  13. Creates a layer for the police station features and adds this layer to the current map.
  14. Creates a layer for the crime location features and adds this layer to the current map.
  15. Creates a layer for the results features and adds this layer to the current map.