コード例 #1
0
        /// <summary>
        /// Bu kod, mevcut bir şekil dosyasının yeni bir özellik kümesi olarak nasıl açılacağını, özellikleri arabelleğe almayı ve ardından farklı bir dosyaya kaydetmeyi gösterir.
        /// </summary>
        /// <param name="fileName">Path of your shapefile (e.g. C:\myShapefile.shp).</param>
        public static void BufferFeatures(string fileName)
        {
            // Açılacak şekil dosyasının dosya yolunu iletin
            IFeatureSet fs = FeatureSet.Open(@"C:\[Your File Path]\Municipalities.shp");

            // "fs" özellik kümesinin özelliklerini arabelleğe alın
            IFeatureSet bs = fs.Buffer(10, true);

            //Arabelleğe alınan özellik kümesini yeni bir dosya olarak kaydeder
            bs.SaveAs(@"C:\[Your File Path]\Municipalities_Buffer.shp", true);
        }
コード例 #2
0
        /// <summary>
        /// This code demonstrates how to open an existing shapefile as a new feature set, buffer the features and then save them to a different file.
        /// </summary>
        /// <param name="fileName">Path of your shapefile (e.g. C:\myShapefile.shp).</param>
        public static void BufferFeatures(string fileName)
        {
            // Pass in the file path of the shapefile that will be opened
            IFeatureSet fs = FeatureSet.Open(@"C:\[Your File Path]\Municipalities.shp");

            // Buffer the features of the feature set "fs"
            IFeatureSet bs = fs.Buffer(10, true);

            // Saves the buffered feature set as a new file
            bs.SaveAs(@"C:\[Your File Path]\Municipalities_Buffer.shp", true);
        }
コード例 #3
0
        public static void BufferingAFeatureSet()
        {
            //Declares a new feature set and passes in the file path for the standard
            //shapefile that will be opened
            IFeatureSet fs = FeatureSet.Open(@"C:\[Your File Path]\Municipalities.shp");
            //Buffers the feature set "fs"
            IFeatureSet bs = fs.Buffer(10, true);

            //Saves the buffered feature set as a new file
            bs.SaveAs(@"C:\[Your File Path]\Municipalities_Buffer.shp", true);
        }
コード例 #4
0
        // metric coordinates
        public static IFeatureSet ApplyBuffer(string filter, double distance, bool isMin, string workdir)
        {
            string      filename = PoiList.GetShapefile(filter);
            IFeatureSet fs       = FeatureSet.Open(CSV_FILE_DIR + '/' + filename);
            IFeatureSet bs       = fs.Buffer(distance, false);

            if (isMin)
            {
                bs = Complement(bs, workdir);
            }

            for (int i = 0; ; i++)
            {
                if (!File.Exists(WORKSPACE_DIR + workdir + "/buf" + i + ".shp"))
                {
                    bs.SaveAs(WORKSPACE_DIR + workdir + "/buf" + i + ".shp", true);
                    break;
                }
            }

            bs.SaveAs(WORKSPACE_DIR + workdir + "/buf.shp", true);
            return(bs);
        }