Example #1
0
        /// <summary>
        /// Write out settings for the GIS dataset
        /// </summary>
        /// <param name="oDatasetElement"></param>
        /// <param name="strDestFolder"></param>
        /// <param name="bDefaultResolution"></param>
        /// <returns></returns>
        internal override ExtractSaveResult Save(System.Xml.XmlElement oDatasetElement, string strDestFolder, DownloadSettings.DownloadCoordinateSystem eCS)
        {
            ExtractSaveResult result = base.Save(oDatasetElement, strDestFolder, eCS);

            System.Xml.XmlAttribute oPathAttr = oDatasetElement.OwnerDocument.CreateAttribute("file");
            if (cbOptions.SelectedIndex == SAVE_AS_MAP)
            {
                oPathAttr.Value = System.IO.Path.Combine(strDestFolder, System.IO.Path.ChangeExtension(Utility.FileSystem.SanitizeFilename(tbFilename.Text), MAP_EXT));
            }
            else if (cbOptions.SelectedIndex == SAVE_AS_SHP_IMPORT || cbOptions.SelectedIndex == SAVE_AS_SHP_NOIMPORT)
            {
                // Shape file uses a namespace name, not a file name (produces oodles of files)
                oPathAttr.Value = System.IO.Path.Combine(strDestFolder, System.IO.Path.GetFileNameWithoutExtension(Utility.FileSystem.SanitizeFilename(tbFilename.Text)));
            }
            else if (cbOptions.SelectedIndex == SAVE_AS_TAB_IMPORT || cbOptions.SelectedIndex == SAVE_AS_TAB_NOIMPORT)
            {
                oPathAttr.Value = System.IO.Path.Combine(strDestFolder, System.IO.Path.ChangeExtension(Utility.FileSystem.SanitizeFilename(tbFilename.Text), TAB_EXT));
            }
            oDatasetElement.Attributes.Append(oPathAttr);

            System.Xml.XmlAttribute oGroupAttribute = oDatasetElement.OwnerDocument.CreateAttribute("group");
            oGroupAttribute.Value = Utility.FileSystem.SanitizeFilename(tbGroupName.Text);
            oDatasetElement.Attributes.Append(oGroupAttribute);

            System.Xml.XmlElement         oDownloadElement = oDatasetElement.OwnerDocument.CreateElement("download_options");
            Options.GIS.OMDownloadOptions eOption          = (Options.GIS.OMDownloadOptions)cbOptions.SelectedIndex;
            oDownloadElement.InnerXml = eOption.ToString();
            oDatasetElement.AppendChild(oDownloadElement);

            return(result);
        }
Example #2
0
        /// <summary>
        /// Write out settings for the Picture dataset
        /// </summary>
        /// <param name="oDatasetElement"></param>
        /// <param name="strDestFolder"></param>
        /// <param name="bDefaultResolution"></param>
        /// <returns></returns>
        internal override ExtractSaveResult Save(System.Xml.XmlElement oDatasetElement, string strDestFolder, DownloadSettings.DownloadCoordinateSystem eCS)
        {
            ExtractSaveResult result = base.Save(oDatasetElement, strDestFolder, eCS);

            SetExtension();
            System.Xml.XmlAttribute oPathAttr = oDatasetElement.OwnerDocument.CreateAttribute("file");
            oPathAttr.Value = System.IO.Path.Combine(strDestFolder, Utility.FileSystem.SanitizeFilename(tbFilename.Text));
            oDatasetElement.Attributes.Append(oPathAttr);

            System.Xml.XmlAttribute oResolutionAttr = oDatasetElement.OwnerDocument.CreateAttribute("resolution");
            oResolutionAttr.Value = oResolution.ResolutionValueSpecific(eCS).ToString(CultureInfo.InvariantCulture);
            oDatasetElement.Attributes.Append(oResolutionAttr);

            System.Xml.XmlElement           oDownloadElement = oDatasetElement.OwnerDocument.CreateElement("download_options");
            Options.Picture.DownloadOptions eOption          = (Options.Picture.DownloadOptions)cbDownloadOptions.SelectedIndex;
            oDownloadElement.InnerText = eOption.ToString();
            oDatasetElement.AppendChild(oDownloadElement);

            System.Xml.XmlElement          oDisplayElement = oDatasetElement.OwnerDocument.CreateElement("display_options");
            Options.Picture.DisplayOptions eDisplayOption  = (Options.Picture.DisplayOptions)cbDisplayOptions.SelectedIndex;
            oDisplayElement.InnerText = eDisplayOption.ToString();
            oDatasetElement.AppendChild(oDisplayElement);

            return(result);
        }
Example #3
0
        /// <summary>
        /// Write out settings for the Grid dataset
        /// </summary>
        /// <param name="oDatasetElement"></param>
        /// <param name="strDestFolder"></param>
        /// <param name="bDefaultResolution"></param>
        /// <returns></returns>
        internal override ExtractSaveResult Save(System.Xml.XmlElement oDatasetElement, string strDestFolder, DownloadSettings.DownloadCoordinateSystem eCS)
        {
            ExtractSaveResult result = base.Save(oDatasetElement, strDestFolder, eCS);

            int    iIndex      = cbDownloadOptions.SelectedIndex;
            string strFileName = Utility.FileSystem.SanitizeFilename(tbFilename.Text);

            if (!String.IsNullOrEmpty(Options.Grid.DownloadOptionExtension[iIndex]))
            {
                strFileName = System.IO.Path.ChangeExtension(strFileName, Options.Grid.DownloadOptionExtension[iIndex]);
            }
            else
            {
                if (String.IsNullOrEmpty(System.IO.Path.GetExtension(strFileName)))
                {
                    strFileName = System.IO.Path.ChangeExtension(strFileName, ".grd");
                }
            }
            strFileName = string.Format(CultureInfo.InvariantCulture, "{0}({1})", strFileName, Options.Grid.DownloadOptionQualifier[iIndex]);

            System.Xml.XmlAttribute oPathAttr = oDatasetElement.OwnerDocument.CreateAttribute("file");
            oPathAttr.Value = System.IO.Path.Combine(strDestFolder, strFileName);
            oDatasetElement.Attributes.Append(oPathAttr);

            System.Xml.XmlAttribute oResolutionAttr = oDatasetElement.OwnerDocument.CreateAttribute("resolution");
            oResolutionAttr.Value = oResolution.ResolutionValueSpecific(eCS).ToString(CultureInfo.InvariantCulture);
            oDatasetElement.Attributes.Append(oResolutionAttr);

            System.Xml.XmlElement       oDisplayElement = oDatasetElement.OwnerDocument.CreateElement("display_options");
            Options.Grid.DisplayOptions eDisplayOption  = (Options.Grid.DisplayOptions)cbDisplayOptions.SelectedIndex;
            oDisplayElement.InnerText = eDisplayOption.ToString();
            oDatasetElement.AppendChild(oDisplayElement);

            return(result);
        }
Example #4
0
        /// <summary>
        /// Write out settings for the database
        /// </summary>
        /// <param name="oDatasetElement"></param>
        /// <param name="strDestFolder"></param>
        /// <param name="bDefaultResolution"></param>
        /// <returns></returns>
        internal override ExtractSaveResult Save(System.Xml.XmlElement oDatasetElement, string strDestFolder, DownloadSettings.DownloadCoordinateSystem eCS)
        {
            ExtractSaveResult result = base.Save(oDatasetElement, strDestFolder, eCS);

            System.Xml.XmlAttribute oPathAttr = oDatasetElement.OwnerDocument.CreateAttribute("file");
            oPathAttr.Value = System.IO.Path.Combine(strDestFolder, System.IO.Path.ChangeExtension(Utility.FileSystem.SanitizeFilename(tbFilename.Text), DATABASE_EXT));

            oDatasetElement.Attributes.Append(oPathAttr);

            return(result);
        }
Example #5
0
        /// <summary>
        /// Write out settings for the document
        /// </summary>
        /// <param name="oDatasetElement"></param>
        /// <param name="strDestFolder"></param>
        /// <param name="bDefaultResolution"></param>
        /// <returns></returns>
        internal override ExtractSaveResult Save(System.Xml.XmlElement oDatasetElement, string strDestFolder, DownloadSettings.DownloadCoordinateSystem eCS)
        {
            ExtractSaveResult result = base.Save(oDatasetElement, strDestFolder, eCS);

            System.Xml.XmlAttribute oPathAttr = oDatasetElement.OwnerDocument.CreateAttribute("file");
            oPathAttr.Value = System.IO.Path.Combine(strDestFolder, System.IO.Path.ChangeExtension(tbFilename.Text, m_szExtension));
            oDatasetElement.Attributes.Append(oPathAttr);

            System.Xml.XmlElement            oDownloadElement = oDatasetElement.OwnerDocument.CreateElement("download_options");
            Options.Document.DownloadOptions eOption          = (Options.Document.DownloadOptions)cbDownload.SelectedIndex;
            oDownloadElement.InnerText = eOption.ToString();
            oDatasetElement.AppendChild(oDownloadElement);

            return(result);
        }
Example #6
0
        /// <summary>
        /// Write out settings for the HyperXYZ dataset
        /// </summary>
        /// <param name="oDatasetElement"></param>
        /// <param name="strDestFolder"></param>
        /// <param name="bDefaultResolution"></param>
        /// <returns></returns>
        internal override ExtractSaveResult Save(System.Xml.XmlElement oDatasetElement, string strDestFolder, DownloadSettings.DownloadCoordinateSystem eCS)
        {
            // --- Always download point data in its native projection when in ArcMap ---
            if (MainForm.Client == Options.Client.ClientType.ArcMAP)
            {
                eCS = DownloadSettings.DownloadCoordinateSystem.Native;
            }

            ExtractSaveResult result = base.Save(oDatasetElement, strDestFolder, eCS);

            System.Xml.XmlAttribute oPathAttr = oDatasetElement.OwnerDocument.CreateAttribute("file");
            oPathAttr.Value = System.IO.Path.Combine(strDestFolder, System.IO.Path.ChangeExtension(Utility.FileSystem.SanitizeFilename(tbFilename.Text), ExtensionForHXYZ));

            oDatasetElement.Attributes.Append(oPathAttr);

            return(result);
        }
Example #7
0
        /// <summary>
        /// Write out settings for the voxel dataset
        /// </summary>
        /// <param name="oDatasetElement"></param>
        /// <param name="strDestFolder"></param>
        /// <param name="bDefaultResolution"></param>
        /// <returns></returns>
        internal override ExtractSaveResult Save(System.Xml.XmlElement oDatasetElement, string strDestFolder, DownloadSettings.DownloadCoordinateSystem eCS)
        {
            ExtractSaveResult result = base.Save(oDatasetElement, strDestFolder, eCS);

            System.Xml.XmlAttribute oPathAttr = oDatasetElement.OwnerDocument.CreateAttribute("file");
            oPathAttr.Value = System.IO.Path.Combine(strDestFolder, System.IO.Path.ChangeExtension(Utility.FileSystem.SanitizeFilename(tbFilename.Text), MAP_EXT));
            oDatasetElement.Attributes.Append(oPathAttr);

            System.Xml.XmlAttribute oResolutionAttr = oDatasetElement.OwnerDocument.CreateAttribute("resolution");
            oResolutionAttr.Value = oResolution.ResolutionValueSpecific(eCS).ToString(CultureInfo.InvariantCulture);
            oDatasetElement.Attributes.Append(oResolutionAttr);

            System.Xml.XmlAttribute oGroupAttribute = oDatasetElement.OwnerDocument.CreateAttribute("group");
            oGroupAttribute.Value = tbGroupName.Text;
            oDatasetElement.Attributes.Append(oGroupAttribute);

            return(result);
        }