コード例 #1
0
        private void addPlotIDsToFGDBToolStripMenuItem_Click(object sender, EventArgs e)
        {
            dlgSelectFolder.Description = "Please select Onwani FileGDB (created by this tool)";
            if (dlgSelectFolder.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }
            var mOnwaniFileGDB = dlgSelectFolder.SelectedPath;

            var mPlotShapefile = PlotImport.GetShapefileName();

            if (!File.Exists(mPlotShapefile))
            {
                Log("No plot file loaded, please import one using the 'Import zone, sector, plot' command");
                return;
            }

            Dictionary <string, string> mFldsToCopy = new Dictionary <string, string>()
            {
                { "ZONETPSSNA", "ZONETPSS" },
                { "SECTORTPSS", "SECTORTPSS" },
                { "PLOTNUMBER", "PLOTNUMBER" }
            };

            double[] mBufferSteps = new double[] { 0, 0.1, 0.25, 0.5, 0.75, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

            string mFeatClassName = "Address_unit_signs";

            Log("Adding zone, sector and plot to address unit signs");
            try
            {
                ExtFunctions.AddPlotIDsToAddressDB(this, mOnwaniFileGDB, mPlotShapefile, mFldsToCopy, "PLOT", mBufferSteps, mFeatClassName);
                Log("Completed process");
            }
            catch (Exception ex)
            {
                Log("Operation aborted: " + ex.Message);
            }
        }