Ejemplo n.º 1
0
        public static Tuple <StandardChunkMetadata, bool> Parse(string x)
        {
            var parts  = x.Split('.');
            var split1 = Math.Max(x.IndexOf('n'), x.IndexOf('s'));
            var split2 = Math.Max(x.IndexOf('w'), x.IndexOf('e'));

            var lat  = Angle.Parse(x.Substring(0, split1 + 1));
            var lon  = Angle.Parse(x.Substring(split1 + 1, split2 - split1));
            var zoom = int.Parse(parts[0].Substring(split2 + 1));

            bool isImage = (parts[2][0] == 'i');

            var template = StandardChunkMetadata.GetRangeContaingPoint(lat, lon, zoom);

            var ggg = isImage ?
                      Imaging.Images.Current.GetFileName(template) :
                      Elevation.Heights.Current.GetFileName(template);

            if (ggg != x)
            {
                throw new InvalidOperationException();
            }

            return(new Tuple <StandardChunkMetadata, bool>(template, isImage));
        }
Ejemplo n.º 2
0
        public static StandardChunkMetadata ParseBase(string x)
        {
            var parts  = x.Split('.');
            var split1 = Math.Max(x.IndexOf('n'), x.IndexOf('s'));
            var split2 = Math.Max(x.IndexOf('w'), x.IndexOf('e'));

            var lat  = Angle.Parse(x.Substring(0, split1 + 1));
            var lon  = Angle.Parse(x.Substring(split1 + 1, split2 - split1));
            var zoom = int.Parse(parts[0].Substring(split2 + 1));

            return(StandardChunkMetadata.GetRangeContaingPoint(lat, lon, zoom));
        }