private void exportForMyabudhabinetToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var mOPFn = SelectOutputFilename(null, "myabudhabi_net_ddl.sql", "SQL|*.sql");

            if (mOPFn == null)
            {
                Utilities.LogDebug("No filename specified");
                return;
            }

            var mLyr = ExtFunctions.GetSelectedAddressUnitLayer(theMap);

            if (mLyr == null)
            {
                Utilities.LogDebug("No address unit layer selected");
                return;
            }

            ExtFunctions.ExportToMyAbuDhabiNet(
                mOPFn,
                mLyr,
                theMap.Projection,
                ExtFunctions.GetProjByEPSG(4326),
                false,
                SignType.addressUnitNumberSign);
        }
        private void exportSelectedLayerAsKMLToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IFeatureLayer mLayer;

            if (null != (mLayer = ExtFunctions.GetSelectedAddressUnitLayer(theMap)))
            {
                dlgSaveFile.Title    = "Choose where to save the exported KML file";
                dlgSaveFile.Filter   = "Keyhole Markup File (KML)|*.kml";
                dlgSaveFile.FileName = theMap.Layers.SelectedLayer.LegendText + ".kml";
                if (dlgSaveFile.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    var mReturnValue = ExtFunctions.ExportFeatureLayerToOGR(
                        pDrvNm: "KML",
                        pFLyr: (IFeatureLayer)theMap.Layers.SelectedLayer,
                        pOPFn: dlgSaveFile.FileName,
                        pHasTitle: true,
                        pSrcProj: theMap.Projection,
                        pTgtProj: ExtFunctions.GetProjByEPSG(4326),
                        pTitleFieldNames: "ADDRESSUNITNR",
                        pTitleFormat: "#{0}");

                    SetFunctionExecutionStatus(mReturnValue);
                }
            }
            else
            {
                Utilities.LogDebug("No layer selected");
            }
        }
        private void exportSelectedLayerAsFileGDBToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IFeatureLayer mLayer;

            if (null != (mLayer = ExtFunctions.GetSelectedAddressUnitLayer(theMap)))
            {
                string mOutputFilename;

                if (null != (mOutputFilename = SelectOutputFilename(null, mLayer.LegendText, "File GDB|*.gdb")))
                {
                    var mReturnValue = ExtFunctions.ExportFeatureLayerToOGR(
                        pDrvNm: "FileGDB",
                        pFLyr: (IFeatureLayer)theMap.Layers.SelectedLayer,
                        pOPFn: dlgSaveFile.FileName,
                        pSrcProj: theMap.Projection,
                        pTgtProj: ExtFunctions.GetProjByEPSG(32640),
                        pLCOpts: new List <string>()
                    {
                        "FEATURE_DATASET=Simplified"
                    });

                    Log(mReturnValue.GetMessages());
                    Log("Operation completed");
                }
                else
                {
                    Log("Operation cancelled: No output FileGDB name specified");
                }
            }
            else
            {
                Log("Operation cancelled: No layer selected");
            }
        }
        private void exportSelectedPointLayerAsGPXToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IPointLayer mLyr = ExtFunctions.GetSelectedAddressUnitLayer(theMap);

            if (mLyr == null)
            {
                Utilities.LogDebug("No point layer was selected");
                return;
            }

            var mOPFn = SelectOutputFilename(null, mLyr.LegendText + ".gpx", "GPS Exchange Format|*.gpx");

            if (mOPFn == null)
            {
                Utilities.LogDebug("No filename specified");
                return;
            }

            var mFieldMap = new Dictionary <string, string>();

            mFieldMap.Add(ExtFunctions.TitleFieldName, "name");
            mFieldMap.Add("ROADNAME_EN", "desc");

            var success = ExtFunctions.ExportFeatureLayerToOGR(
                pDrvNm: "GPX",
                pFLyr: mLyr,
                pOPFn: mOPFn,
                pSrcProj: theMap.Projection,
                pTgtProj: ExtFunctions.GetProjByEPSG(4326),
                pHasTitle: true,
                pTitleFieldNames: "ADDRESSUNITNR,ROADID",
                pTitleFormat: "wpt{0}-{1}",
                pDSCOpts: new List <string>()
            {
                "GPX_USE_EXTENSIONS=NO"
            },
                pFieldMap: mFieldMap,
                pOnlyInFieldMap: true
                );
        }
        private void exportAddressUnitsToSQLITEDbToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var mLyr = ExtFunctions.GetSelectedAddressUnitLayer(theMap);

            if (mLyr == null)
            {
                return;
            }

            var mOpFn = SelectOutputFilename(null, mLyr.LegendText + ".sqlite", "SQLite database|*.sqlite", false);

            if (mOpFn == null)
            {
                return;
            }

            ExtFunctions.ExportToSQLiteDatabase(
                mLyr,
                mOpFn,
                theMap.Projection,
                ExtFunctions.GetProjByEPSG(4326));
        }
        private void exportSelectedFeatureLayerToSpatialiteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IFeatureLayer mLyr = ExtFunctions.GetSelectedFeatureLayer(theMap);

            if (mLyr == null)
            {
                return;
            }

            string mOPFn = SelectOutputFilename(null, mLyr.LegendText + ".sqlite", "Spatialite|*.sqlite");

            if (mOPFn == null)
            {
                return;
            }

            var mDSCOpts = new List <string>();

            mDSCOpts.Add("SPATIALITE=YES");

            var mLCOpts = new List <string>();

            mLCOpts.Add("SPATIAL_INDEX=YES");

            var mReturnValue = ExtFunctions.ExportFeatureLayerToOGR(
                "SQLite",
                mLyr,
                mOPFn,
                theMap.Projection,
                ExtFunctions.GetProjByEPSG(4326),
                false,
                null,
                null,
                mLCOpts,
                mDSCOpts);

            SetFunctionExecutionStatus(mReturnValue);
            return;
        }