Exemplo n.º 1
0
        public static string ProjectionP4ByName(string name)
        {
            ProjDB    projDb = new ProjDB();
            DataTable tab    = projDb.DbSelect("*", "projections", "PROJECTION_Name='" + name + "'");

            if (tab != null)
            {
                DataRow row = tab.Rows[0];

                return(row["PROJECTION_P4"].ToString());
            }

            return("");
        }
Exemplo n.º 2
0
        public static string ProjectionNameByP4(string p4)
        {
            ProjDB    projDb = new ProjDB();
            DataTable tab    = projDb.DbSelect("*", "projections", "PROJECTION_P4='" + p4 + "'");

            if (tab != null)
            {
                DataRow row = tab.Rows[0];

                return(row["PROJECTION_Name"].ToString());
            }

            return("");
        }
Exemplo n.º 3
0
        public static string PrimeMeridianByP4(string p4, out double longitude)
        {
            ProjDB    projDb = new ProjDB();
            DataTable tab    = projDb.DbSelect("*", "pm", "PM_P4='" + p4 + "'");

            if (tab != null && tab.Rows.Count > 0)
            {
                DataRow row = tab.Rows[0];

                longitude = (double)row["PM_Meridian"];
                return(row["PM_Name"].ToString());
            }
            longitude = 0.0;
            return("Unknown");
        }
Exemplo n.º 4
0
        public static string SpheroidByName(string Name, out double majorAxis, out double minorAxis, out double invFlattening)
        {
            ProjDB    projDb = new ProjDB();
            DataTable tab    = projDb.DbSelect("*", "spheroid", "SPHEROID_Name='" + Name + "'");

            if (tab != null && tab.Rows.Count > 0)
            {
                DataRow row = tab.Rows[0];

                majorAxis     = ((row["SPHEROID_SemiMajorAxis"] != DBNull.Value) ? Convert.ToDouble(row["SPHEROID_SemiMajorAxis"]) : 0.0);
                minorAxis     = ((row["SPHEROID_SemiMinorAxis"] != DBNull.Value) ? Convert.ToDouble(row["SPHEROID_SemiMinorAxis"]) : 0.0);
                invFlattening = ((row["SPHEROID_InverseFlattening"] != DBNull.Value) ? Convert.ToDouble(row["SPHEROID_InverseFlattening"]) : 0.0);

                return(row["SPHEROID_P4"].ToString());
            }

            majorAxis = minorAxis = invFlattening = 0.0;
            return("");
        }