예제 #1
0
 public GridDataPoints activeData(GridDataPoints allPoints, RectLatLng bounds, String id)
 {
     GridDataPoints activePoints = new GridDataPoints(id);
     foreach (GridDataPoint p in allPoints.points)
     {
         if (OverlayProcessor.RectLatLngCollide(p.loc,bounds))
         {
             activePoints.addPoint(p);
         }
     }
     return activePoints;
 }
예제 #2
0
        public void fillGridDataStoreManager(ref Dictionary<String, GridDataPoints> ds)
        {
            //List<StationReading> lsr;

            foreach (List<StationReading> lsr in precip.Values)
            {
                foreach (StationReading sr in lsr)
                {
                    if (ds.ContainsKey(sr.DataTime))
                    {
                        ds[sr.DataTime].addPoint(makeGDP(sr));
                    }
                    else
                    {
                        GridDataPoints gds = new GridDataPoints(sr.DataTime);
                        gds.addPoint(makeGDP(sr));
                        ds.Add(sr.DataTime,gds);
                    }
                }
            }
        }
예제 #3
0
        //, int Alpha)
        public void makeLayer(String RedDataSetName, String GreenDataSetName, String BlueDataSetName)
        {
            //blue only
            ViewArea = Control.ViewArea;
            //int x = (int)Control.FromLatLngToLocal(ViewArea.LocationRightBottom).X;
            curLayer = new Bitmap((int)Control.FromLatLngToLocal(ViewArea.LocationRightBottom).X,(int) Control.FromLatLngToLocal(ViewArea.LocationRightBottom).Y);
            g = System.Drawing.Graphics.FromImage(curLayer);
            //g.Clear(Color.Black);
            //
            allPoints = GDSM.DataSets[BlueDataSetName];
            Console.WriteLine(BlueDataSetName + GDSM.DataSets.ContainsKey(BlueDataSetName));

            activePoints = activeData(allPoints, ViewArea, BlueDataSetName);
            GPoint TL;
            GPoint BR;
            foreach (GridDataPoint p in activePoints.points)
            {
                TL = Control.FromLatLngToLocal(p.loc.LocationTopLeft);
                BR = Control.FromLatLngToLocal(p.loc.LocationRightBottom);
                //Console.WriteLine("Drawing: [" + TL.X + ", " + TL.Y + "] [" + BR.X + ", " + BR.Y + "] - " + p.value + " - (" + p.loc.LocationRightBottom.Lat + ", " + p.loc.LocationRightBottom.Lng +")");
                g.FillRectangle(new SolidBrush(Color.FromArgb(125, Color.FromArgb(0,0,p.value))),new Rectangle((int)TL.X, (int)TL.Y, (int)(BR.X - TL.X), (int)(BR.Y - TL.Y)));
            }

            g.Flush();
            Layers.Add(curLayer);
        }