예제 #1
0
        public static frmImportRaster PrepareToImportRaster(Surface refSurface, Purposes purpose, string Noun, IntPtr parentWindow)
        {
            frmImportRaster frm    = null;
            Raster          source = ProjectManager.BrowseRaster(naru.ui.UIHelpers.WrapMessageWithNoun("Browse and Select a", Noun, "Raster"), parentWindow);

            if (source is Raster)
            {
                if (GISDatasetValidation.DSHasSpatialRef(source, "raster", "rasters"))
                {
                    frm = new frmImportRaster(source, refSurface, purpose, Noun);
                }
            }

            return(frm);
        }
예제 #2
0
        private bool ValidateForm()
        {
            // Sanity check to avoid empty names
            txtName.Text = txtName.Text.Trim();

            if (string.IsNullOrEmpty(txtName.Text))
            {
                MessageBox.Show("You must provide a name for the point density associated surface.", Properties.Resources.ApplicationNameLong, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }

            if (!DEM.IsAssocNameUnique(txtName.Text, Assoc))
            {
                MessageBox.Show("The name '" + txtName.Text + "' is already in use by another associated surface within this survey. Please choose a unique name.", Properties.Resources.ApplicationNameLong, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                txtName.Select();
                return(false);
            }

            if (ucPointCloud.SelectedItem is GCDConsoleLib.Vector)
            {
                if (!GISDatasetValidation.DSHasSpatialRef(ucPointCloud.SelectedItem, "feature class", "feature classes") ||
                    !GISDatasetValidation.DSSpatialRefMatchesProjectWithMsgbox(ucPointCloud.SelectedItem, "feature class", "feature classes") ||
                    !GISDatasetValidation.DSHorizUnitsMatchProject(ucPointCloud.SelectedItem, "feature class", "feature classes") ||
                    !GISDatasetValidation.DSGeometryTypeMatches((Vector)ucPointCloud.SelectedItem, GDalGeometryType.SimpleTypes.Point))
                {
                    ucPointCloud.Select();
                    return(false);
                }
            }
            else
            {
                MessageBox.Show("You must select a point cloud Shape File to continue.", "Missing Point Shape File", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }

            return(true);
        }