Пример #1
0
        //Code for defining a geographic coordinate system for a feature set
        public static void AddingACoordinateSystemToFeatureSet(FeatureSet fs)
        {
            FeatureSet     CopyFS = new FeatureSet();
            ProjectionInfo dest   = default(ProjectionInfo);

            //Copies the selected layer to a new feature set
            //Prevents the original file from being edited
            CopyFS.CopyFeatures(fs, true);

            dest = KnownCoordinateSystems.Geographic.World.WGS1984;
            //Adds the geographic coordinate system to the feature set
            CopyFS.Projection = dest;
            //Saves the feature set
            CopyFS.SaveAs("C:\\Temp\\US_Cities_GCS_WGS1984.shp", true);

            Console.WriteLine("The feature was successfully been projected.");
        }