GisOperation

Land Desktop Map 3D Samples

 
GisOperation
 
 
 

When you enter the GisOperation command on the Map command-line, you cause an instance of the Implementation class to be created and its PerformGisOperations method to be executed. This method does the following:

  1. Uses OSGeo.MapGuide.AcMapMap to get the current map
  2. Uses the current map to get the layers as an OSGeo.MapGuide.MgLayerCollection object. There are three layers: two vector data layers and one raster data layer. The two vector data layers contain the polygons from the Zoning.sdf file and the points from the Signals.sdf file.
  3. Creates an OSGeo.FDO.Schema.FeatureSchema object. This feature schema will contain the FDO class definitions from the two layers that contain vector data. For each OSGeo.MapGuide.MgLayerBase object in the MgLayerCollection object, it does the following:
    • Gets the feature class name from the layer. The feature class name has the form <schemaName>:<className>. If the <schemaName> is rasters, the layer is ignored.
    • Extracts from the MgLayerBase object the string representing the feature source identifier for the SDF file, which is the source of the features for the layer.
    • Uses the feature source identifier for the SDF file together with the <schemaName> and the <className> to create an OSGeo.FDO.Schema.FeatureClass object. This is described in topic CreateFdoFeatureClass.
    • Adds the FeatureClass object to the FeatureSchema object.
    • Get the Well-Known-Text (WKT) string specifying the coordinate system used for the layer. This is described in the topic GetCoordSysWkt.
  4. Creates an sdf file called Combined.sdf which has the feature schema created in the previous step and the coordinate system from the first layer processed in the previous step. This is described in the topic CreateSdfFile.
  5. Creates an MgResourceIdentifier for Combined.sdf and stores the identifier in the Resource Service repository. This is described in the topic ConnectToSdfFile.
  6. Copies the features from Signals.sdf and Zoning.sdf into Combined.sdf. The operations are performed using the MgResourceIdentifier objects for the three SDF files. This is described in the topic CopyFeatures.
  7. Make all of the layers in the current map invisible.
  8. Creates a layer for each of the classes in Combined.sdf and adds them to the current map. This is described in the topic AddAllToMap.
  9. Selects a subset of the polygon features from the Combined.sdf file and applies a buffer operation on them. This starts off with creating an OSGeo.MapGuide.MgFeatureQueryOptions object and configuring it with a filter string. The rest is described in topic Apply A Buffer Operation To Features. The buffering operation returns an MgBatchPropertyCollection object. This object contains a collection of MgPropertyCollection objects. Each MgPropertyCollection object contains the properties of one feature including the default geometry property, which has had the buffering operation applied to it.
  10. Check for the existence of a file and if it exists, delete it. This file would have been created by a previous invocation of the GisOperation command.
  11. Creates a new feature schema with a class definition which is identical to that of the polygon feature class definition contained in the Combined.sdf file except that the feature class and geometry property names are different and the geometry property GeometryTypes attribute is MgFeatureGeometricType.Surface.
  12. Creates the Buffered.sdf file with the schema created in the previous step and the coordinate system from the Combined.sdf file.
  13. Creates an MgResourceIdentifier for Buffered.sdf and stores the identifier in the Resource Service repository.
  14. Loop through the MgBatchPropertyCollection object and use MgFeatureCommandCollection, MgInsertFeatures, and MgFeatureService objects to insert the MgPropertyCollection objects into the Buffered.sdf file.
  15. Creates a layer from the features in the Buffered.sdf file and adds this layer to the current map. This is described in topic AddAllToMap.
  16. Makes the Redding zoning areas and the Redding jpeg layers visible.
  17. Changes the color of the buffered features layer in the current map. This is described in topic ChangeSurfaceLayerStyle.