/// <summary>
        /// Create random sample points in the extent of the spatial reference
        /// </summary>
        /// <param name="pointFeatureLayer">Point geometry feature layer used to the generate the points.</param>
        /// <returns>Task{bool}</returns>
        private Task<bool> constructSamplePoints(FeatureLayer pointFeatureLayer)
        {
            // create a random number generator
            var randomGenerator = new Random();

            // the database and geometry interactions are considered fine-grained and must be executed on
            // the main CIM thread
            return QueuedTask.Run(() =>
            {
                // start an edit operation to create new (random) point features
                var createOperation = new EditOperation();
                createOperation.Name = "Generate points";
                createOperation.SelectNewFeatures = false;

                // get the feature class associated with the layer
                var featureClass = pointFeatureLayer.GetTable() as FeatureClass;

                // define an area of interest. Random points are generated in the allowed
                // confines of the allow extent range
                var areaOfInterest = MapView.Active.Extent;

                MapPoint newMapPoint = null;

                // retrieve the class definition of the point feature class
                var classDefinition = featureClass.GetDefinition() as FeatureClassDefinition;

                // store the spatial reference as its own variable
                var spatialReference = classDefinition.GetSpatialReference();

                // create 20 new point geometries and queue them for creation
                for (int i = 0; i < 20; i++)
                {
                    // generate either 2D or 3D geometries
                    if (classDefinition.HasZ())
                        newMapPoint = MapPointBuilder.CreateMapPoint(randomGenerator.NextCoordinate(areaOfInterest, true), spatialReference);
                    else
                        newMapPoint = MapPointBuilder.CreateMapPoint(randomGenerator.NextCoordinate(areaOfInterest, false), spatialReference);

                    // queue feature creation
                    createOperation.Create(pointFeatureLayer, newMapPoint);
                }

                // execute the edit (feature creation) operation
                return createOperation.ExecuteAsync();
            });

        }
        /// <summary>
        /// Create a single multi-point feature that is comprised of 20 points.
        /// </summary>
        /// <param name="multiPointLayer">Multi-point geometry feature layer used to add the multi-point feature.</param>
        /// <returns></returns>
        private Task constructSampleMultiPoints(FeatureLayer multiPointLayer)
        {
            // create a random number generator
            var randomGenerator = new Random();

            // the database and geometry interactions are considered fine-grained and need to be executed on
            // a separate thread
            return QueuedTask.Run(() =>
            {
                // get the feature class associated with the layer
                var featureClass =  multiPointLayer.GetTable() as FeatureClass;
                var featureClassDefinition = featureClass.GetDefinition() as FeatureClassDefinition;

                // store the spatial reference as its own variable
                var spatialReference = featureClassDefinition.GetSpatialReference();

                // define an area of interest. Random points are generated in the allowed
                // confines of the allow extent range
                var areaOfInterest = MapView.Active.Extent;

                // start an edit operation to create new (random) multi-point feature
                var createOperation = new EditOperation();
                createOperation.Name = "Generate multipoints";

                // retrieve the class definition of the point feature class
                var classDefinition = featureClass.GetDefinition() as FeatureClassDefinition;

                // create a list to hold the 20 coordinates of the multi-point feature
                IList<Coordinate> coordinateList = new List<Coordinate>(20);

                for (int i = 0; i < 20; i++)
                {
                    // generate either 2D or 3D geometries
                    if (classDefinition.HasZ())
                        coordinateList.Add(randomGenerator.NextCoordinate(areaOfInterest, true));
                    else
                        coordinateList.Add(randomGenerator.NextCoordinate(areaOfInterest, false));
                }

                var newPoints = MultipointBuilder.CreateMultipoint(coordinateList, classDefinition.GetSpatialReference());
                // create and execute the feature creation operation
                createOperation.Create(multiPointLayer, newPoints);

                return createOperation.ExecuteAsync();
            });
        }