Exemple #1
0
        public void ApplyGridShift(Coordinate c, bool inverse)
        {
            foreach (var grid in _grids)
            {
                var gridOptional = grid.StartsWith("@");
                var gridName     = grid.StartsWith("@") ? grid.Substring(1) : grid;
                var uri          = new Uri(System.IO.Path.Combine(".", gridName));
                var table        = GridTable.Load(uri);
                if (table == null)
                {
                    if (!gridOptional)
                    {
                        throw new Proj4NetException();
                    }
                    continue;
                }

                GridTable useTable;
                if (table.Applies(new PhiLambda {
                    Lambda = c.Y, Phi = c.X
                }, out useTable))
                {
                    useTable.Apply(c, inverse);
                }
            }
        }