Пример #1
0
 public void Transfrom(float[] xs, float[] ys, out int[] rows, out int[] cols)
 {
     if (_nearestSearcher == null)
     {
         _nearestSearcher = new NearestSearcher(_lons, _lats, _size.Width, _size.Height);
     }
     rows = new int[xs.Length];
     cols = new int[ys.Length];
     if (_scale != 1)
     {
         for (int i = 0; i < xs.Length; i++)
         {
             _nearestSearcher.Cal(xs[i], ys[i], ref rows[i], ref cols[i]);
             rows[i] *= _scale;
             cols[i] *= _scale;
         }
     }
     else
     {
         for (int i = 0; i < xs.Length; i++)
         {
             _nearestSearcher.Cal(xs[i], ys[i], ref rows[i], ref cols[i]);
         }
     }
 }
Пример #2
0
 public void Transform(float x, float y, ref int row, ref int col)
 {
     if (_nearestSearcher == null)
     {
         _nearestSearcher = new NearestSearcher(_lons, _lats, _size.Width, _size.Height);
     }
     _nearestSearcher.Cal(x, y, ref col, ref row);
     col *= _scale;
     row *= _scale;
 }
Пример #3
0
 public void Dispose()
 {
     if (_nearestSearcher != null)
     {
         _nearestSearcher.Dispose();
         _nearestSearcher = null;
     }
     _lats = null;
     _lons = null;
 }