예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }