예제 #1
0
        public ige_projectionDAL getProjectionDAL(_ge_location loc)
        {
            Constants.datumProjection _dp = loc.datumProjection;

            if (loc.datumProjection == Constants.datumProjection.OSGB36NG)
            {
                _projectionDAL = new ge_projectionOSGB36(loc);
            }

            if (loc.datumProjection == Constants.datumProjection.OSGB36NGODN)
            {
                _projectionDAL = new ge_projectionOSGB36(loc);
            }

            if (loc.datumProjection == Constants.datumProjection.WGS84)
            {
                _projectionDAL = new ge_projectionWGS84(loc);
            }

            if (loc.datumProjection == Constants.datumProjection.GRS80)
            {
                _projectionDAL = new ge_projectionGRS80(loc);
            }

            return(_projectionDAL);
        }
예제 #2
0
        public bool UpdateProjectionLoc(_ge_location loc, out string msg, string sourceCoordSystem = "")
        {
            bool retvar = false;

            if (loc.datumProjection == datumProjection.NONE)
            {
                retvar = true;
                msg    = "No datumProjection";
            }
            else
            {
                ProjectionSystem  ps = new ProjectionSystem();
                ige_projectionDAL pd = ps.getProjectionDAL(loc);

                if (pd == null)
                {
                    msg    = "datumProjection not understood";
                    retvar = false;
                }
                else
                {
                    retvar = ps.updateAll(sourceCoordSystem);
                    msg    = pd.getMessage();
                }
            }

            return(retvar);
        }
예제 #3
0
        public bool UpdateProjectionLoc(_ge_location loc)
        {
            bool retvar = false;

            if (loc.datumProjection == Constants.datumProjection.NONE)
            {
                retvar = true;
                ViewData["locMessage"] = "No datumProjection";
            }
            else
            {
                ProjectionSystem  ps = new ProjectionSystem();
                ige_projectionDAL pd = ps.getProjectionDAL(loc);

                if (pd == null)
                {
                    retvar = false;
                }
                else
                {
                    retvar = pd.updateAll(locSelect);
                    ViewData["locMessage"] = pd.getMessage();
                }
            }

            return(retvar);
        }
예제 #4
0
 public static bool ValidHeight(_ge_location ge_loc)
 {
     if (ge_loc.locHeight == null)
     {
         return(false);
     }
     return(true);
 }
예제 #5
0
        public static bool ValidLatitudeLongitude(_ge_location ge_loc)
        {
            if (ge_loc.locLongitude == null)
            {
                return(false);
            }
            if (ge_loc.locLatitude == null)
            {
                return(false);
            }

            return(true);
        }
예제 #6
0
        public ge_projectionGRS80(_ge_location Loc) : base(Loc)
        {
            ge_projection_factors pf = new ge_projection_factors();

            pf.a    = 6378137.0000;
            pf.b    = 6356752.3141;
            pf.f0   = 0.999601271700;
            pf.e0   = 400000.000;
            pf.n0   = -100000.000;
            pf.PHI0 = 49.000;
            pf.LAM0 = -2.000;

            gc.pf = pf;
        }
예제 #7
0
        public ge_projectionOSGB36(_ge_location Loc) : base(Loc)
        {
            ge_projection_factors pf = new ge_projection_factors();

            pf.a    = 6377563.3960;
            pf.b    = 6356256.9090;
            pf.f0   = 0.999601271700;
            pf.e0   = 400000.000;
            pf.n0   = -100000.000;
            pf.PHI0 = 49.000;
            pf.LAM0 = -2.000;

            gc.pf = pf;
        }
예제 #8
0
        public bool process_loc(_ge_location ge_loc, string description, string id)
        {
            try {
                if (!ValidLatitudeLongitude(ge_loc))
                {
                    return(false);
                }

                string coordinates = ge_loc.locLongitude + "," + ge_loc.locLatitude;

                if (ValidHeight(ge_loc))
                {
                    coordinates += "," + ge_loc.locHeight;
                }

                XmlNode PlaceMark = _doc.CreateElement(kmlContainer.PLACEMARK);
                XmlNode Name      = _doc.CreateElement(kmlContainer.NAME);
                Name.InnerText = ge_loc.locName;
                PlaceMark.AppendChild(Name);

                XmlNode Description = _doc.CreateElement(kmlContainer.DESCRIPTION);
                Description.InnerText = description;
                PlaceMark.AppendChild(Description);

                XmlNode Point = _doc.CreateElement(kmlContainer.POINT);
                PlaceMark.AppendChild(Point);

                XmlNode Coordinates = _doc.CreateElement(kmlContainer.COORDS);
                Coordinates.InnerText = coordinates;
                Point.AppendChild(Coordinates);

                XmlNode ExtendedData = _doc.CreateElement(kmlContainer.EXTENDEDDATA);
                PlaceMark.AppendChild(ExtendedData);

                XmlElement Data = _doc.CreateElement(kmlContainer.DATA);
                Data.SetAttribute(kmlContainer.NAME, description);
                ExtendedData.AppendChild(Data);

                XmlElement Value = _doc.CreateElement(kmlContainer.VALUE);
                Value.InnerText = description;
                Data.AppendChild(Value);

                currentContainer.AppendChild(PlaceMark);
                return(true);
            } catch {
                return(false);
            }
        }
예제 #9
0
 private bool write_location(_ge_location loc, XmlNode parent)
 {
     try {
         AddNode("locName", loc.locName, parent);
         AddNode("locAddress", loc.locAddress, parent);
         AddNode("locPostCode", loc.locPostcode, parent);
         AddNode("locMapReference", loc.locMapReference, parent);
         AddNode("locEast", loc.locEast.ToString(), parent);
         AddNode("locNorth", loc.locNorth.ToString(), parent);
         AddNode("locLevel", loc.locLevel.ToString(), parent);
         AddNode("datumProjection", loc.datumProjection.ToString(), parent);
         AddNode("locLatitude", loc.locLatitude.ToString(), parent);
         AddNode("locLongitude", loc.locLongitude.ToString(), parent);
         AddNode("locHeight", loc.locHeight.ToString(), parent);
         AddNode("folder", loc.folder, parent);
         return(true);
     } catch {
         return(false);
     }
 }
예제 #10
0
 public _ge_projectionDAL(_ge_location Loc)
 {
     gc  = new ge_conversion();
     loc = Loc;
 }