Exemplo n.º 1
0
        public base_risk GetRiskSite(DbGeometry inLocation)
        {
            base_risk br = null;

            using (DataMapsEntities me = new DataMapsEntities())
            {
                br = me.base_risk.Where(f => f.geom.Contains(inLocation)).FirstOrDefault() as base_risk;
            }
            return(br);
        }
Exemplo n.º 2
0
        public List <base_release> GetReleaseSites()
        {
            List <base_release> br = new List <base_release> ();

            using (DataMapsEntities me = new DataMapsEntities())
            {
                br = me.base_release.ToList();
            }
            return(br);
        }
Exemplo n.º 3
0
        public base_move GetMoveSite(DbGeometry inLocation)
        {
            base_move bm = null;

            using (DataMapsEntities me = new DataMapsEntities())
            {
                bm = me.base_move.Where(f => f.geom.Contains(inLocation)).FirstOrDefault() as base_move;
            }
            return(bm);
        }
Exemplo n.º 4
0
        public base_food GetFoodSite(DbGeometry inLocation)
        {
            base_food bf = null;

            using (DataMapsEntities me = new DataMapsEntities())
            {
                bf = me.base_food.Where(g => g.geom.Contains(inLocation)).FirstOrDefault() as base_food;
            }
            return(bf);
        }
Exemplo n.º 5
0
        public bool IsStillOnMap(DbGeometry inLocation)
        {
            bool   onMap = false;
            object o;

            using (DataMapsEntities me = new DataMapsEntities())
            {
                o = me.base_social.Where(f => f.geom.Contains(inLocation)).FirstOrDefault();
                if (o != null)
                {
                    onMap = true;
                }
            }
            return(onMap);
        }
Exemplo n.º 6
0
        public bool DidCross(DbGeometry start, DbGeometry end)
        {
            bool didCross;

            using (DataMapsEntities me = new DataMapsEntities())
            {
                object StartPoly = me.base_social.Where(f => f.geom.Contains(start)).FirstOrDefault();
                object EndPoly   = me.base_social.Where(f => f.geom.Contains(end)).FirstOrDefault();
                // I hate negative logic too.  But if they equal each other then they did not cross
                didCross = !StartPoly.Equals(EndPoly);
            }
            //string s = start.WellKnownValue.WellKnownText.Replace("POINT (","").Replace(")","");
            //string e = end.WellKnownValue.WellKnownText.Replace("POINT (", "").Replace(")", "");
            //string a = start.XCoordinate.Value.ToString ();
            //DbGeometry myLine = DbGeometry.LineFromText("LINESTRING( " + s + " , " + e + ")",0);

            return(didCross);
        }