public override List <SqlGeometry> GetGeometries(BoundingBox boundingBox)
        {
            var geographicBoundingBox = boundingBox.Transform(MapProjects.WebMercatorToGeodeticWgs84);

            return(GeodeticIndexes.GetIndexLines(geographicBoundingBox, this.Type)
                   .Select(g => g.AsSqlGeometry().Transform(MapProjects.GeodeticWgs84ToWebMercator, SridHelper.WebMercator))
                   .ToList());
        }
        public override List <NamedSqlGeometry> GetGeometryLabelPairs(SqlGeometry geometry)
        {
            var geographicBoundingBox = geometry.GetBoundingBox().Transform(MapProjects.WebMercatorToGeodeticWgs84);

            return(GeodeticIndexes.FindIndexSheets(geographicBoundingBox, this.Type)
                   .Select(sheet => new NamedSqlGeometry(sheet.TheGeometry.AsSqlGeometry(), sheet.SheetName))
                   .Where(s => s.TheSqlGeometry?.STIntersects(geometry).IsTrue == true)
                   .ToList());
        }
        public override List <SqlGeodeticSheet> GetFeatures(SqlGeometry geometry)
        {
            var geographicBoundingBox = geometry?.GetBoundingBox().Transform(MapProjects.WebMercatorToGeodeticWgs84) ?? this.GeodeticWgs84Extent;

            return(GeodeticIndexes.FindIndexSheets(geographicBoundingBox, this.Type)
                   .Select(s => new SqlGeodeticSheet(s))
                   .Where(s => s.TheSqlGeometry?.STIntersects(geometry).IsTrue == true)
                   .ToList());
        }
Exemplo n.º 4
0
        public static List <SqlFeature> GetIndexSheets(SqlGeometry webMercatorGeometry, GeodeticIndexType type)
        {
            var geographicGeometry = webMercatorGeometry.Transform(IRI.Msh.CoordinateSystem.MapProjection.MapProjects.WebMercatorToGeodeticWgs84, 4326);

            var geographicBoundingBox = geographicGeometry.GetBoundingBox();

            return(GeodeticIndexes.FindIndexSheets(geographicBoundingBox, type)
                   .Where(b => b.GeodeticExtent.Intersects(geographicGeometry))
                   .Select(b => new SqlFeature(b.GeodeticExtent.Transform(IRI.Msh.CoordinateSystem.MapProjection.MapProjects.GeodeticWgs84ToWebMercator).AsSqlGeometry())
            {
                Attributes = new Dictionary <string, object>()
                {
                    { nameof(b.SheetName), b.SheetName }
                }
            })
                   .ToList());

            //switch (type)
            //{
            //    case GeodeticIndexType.Ncc250k:
            //        return GetIndexeSheets(webMercatorGeometry, IRI.Msh.Common.Mapping.GeodeticIndexes.Find250kIndexSheets);

            //    case GeodeticIndexType.Ncc100k:
            //        return GetIndexeSheets(webMercatorGeometry, IRI.Msh.Common.Mapping.GeodeticIndexes.Find100kIndexSheets);

            //    case GeodeticIndexType.Ncc50k:
            //        return GetIndexeSheets(webMercatorGeometry, IRI.Msh.Common.Mapping.GeodeticIndexes.Find50kIndexSheets);

            //    case GeodeticIndexType.Ncc25k:
            //        return GetIndexeSheets(webMercatorGeometry, IRI.Msh.Common.Mapping.GeodeticIndexes.Find25kIndexSheets);

            //    case GeodeticIndexType.Ncc10k:
            //        return GetIndexeSheets(webMercatorGeometry, IRI.Msh.Common.Mapping.GeodeticIndexes.Find10kIndexSheets);

            //    case GeodeticIndexType.Ncc5k:
            //        return GetIndexeSheets(webMercatorGeometry, IRI.Msh.Common.Mapping.GeodeticIndexes.Find5kIndexSheets);

            //    default:
            //        throw new NotImplementedException();
            //}
        }