public static Tile GetNewTile(Imageset imageset, int level, int x, int y, Tile parent)
        {
            switch (imageset.Projection)
            {
            case ProjectionType.Mercator:
            {
                MercatorTile newTile = MercatorTile.Create(level, x, y, imageset, parent);
                return(newTile);
            }

            case ProjectionType.Equirectangular:
            {
                return(EquirectangularTile.Create(level, x, y, imageset, parent));
            }

            //case ProjectionType.Spherical:
            //    {
            //        return new SphericalTile(level, x, y, imageset, parent);
            //    }
            default:
            case ProjectionType.Toast:
            {
                return(ToastTile.Create(level, x, y, imageset, parent));
            }

            case ProjectionType.SkyImage:
            {
                return(new SkyImageTile(level, x, y, imageset, parent));
            }

            case ProjectionType.Plotted:
            {
                return(PlotTile.Create(level, x, y, imageset, parent));
            }

            case ProjectionType.Healpix:
            {
                if (imageset.HipsProperties == null)
                {
                    imageset.HipsProperties = new HipsProperties(imageset);
                }
                if (imageset.HipsProperties.DownloadComplete)
                {
                    return(new HealpixTile(level, x, y, imageset, parent));
                }
                else
                {
                    return(null);
                }
            }

            case ProjectionType.Tangent:
            {
                TangentTile newTile = new TangentTile(level, x, y, imageset, parent);
                return(newTile);
            }
            }
        }
        public static Tile GetNewTile(Imageset imageset, int level, int x, int y, Tile parent)
        {
            switch (imageset.Projection)
            {
            case ProjectionType.Mercator:
            {
                MercatorTile newTile = MercatorTile.Create(level, x, y, imageset, parent);
                return(newTile);
            }

            case ProjectionType.Equirectangular:
            {
                return(EquirectangularTile.Create(level, x, y, imageset, parent));
            }

            //case ProjectionType.Spherical:
            //    {
            //        return new SphericalTile(level, x, y, imageset, parent);
            //    }
            default:
            case ProjectionType.Toast:
            {
                return(ToastTile.Create(level, x, y, imageset, parent));
            }

            case ProjectionType.SkyImage:
            {
                return(SkyImageTile.Create(level, x, y, imageset, parent));
            }

            case ProjectionType.Plotted:
            {
                return(PlotTile.Create(level, x, y, imageset, parent));
            }

            case ProjectionType.Healpix:
            {
                return(new HealpixTile(level, x, y, imageset, parent));
            }

            case ProjectionType.Tangent:
            {
                TangentTile newTile = TangentTile.Create(level, x, y, imageset, parent);
                return(newTile);
            }
            }
        }