Example #1
0
 public void QueryEnvelope(RectangularTileIndex forTile,
                           [NotNull] IEnvelope envelope)
 {
     RectangularTilingUtils.QueryTileEnvelope(OriginX, OriginY,
                                              TileWidth, TileHeight,
                                              forTile, envelope);
 }
Example #2
0
 private RectangularTileIndex GetTileIndexAt(
     double locationX, double locationY,
     BorderPointTileAllocationPolicy borderPointTileAllocation)
 {
     return(RectangularTilingUtils.GetTileIndex(locationX, locationY,
                                                OriginX, OriginY,
                                                TileWidth, TileHeight,
                                                borderPointTileAllocation));
 }
Example #3
0
        public IEnvelope GetIntersectedTilesExtent([NotNull] IEnvelope extent,
                                                   [NotNull] IEnvelope constraintExtent)
        {
            Assert.ArgumentNotNull(extent, nameof(extent));
            Assert.False(extent.IsEmpty, "extent is empty");
            Assert.ArgumentNotNull(constraintExtent, nameof(constraintExtent));
            Assert.False(constraintExtent.IsEmpty, "constraintExtent is empty");

            IEnvelope projectedExtent;

            GeometryUtils.EnsureSpatialReference(extent, SpatialReference, true,
                                                 out projectedExtent);
            IEnvelope projectedConstraintExtent;

            GeometryUtils.EnsureSpatialReference(constraintExtent, SpatialReference,
                                                 true,
                                                 out projectedConstraintExtent);

            int?leftIndex;
            int?rightIndex;

            RectangularTilingUtils.GetTileIndexes1D(OriginX, TileWidth,
                                                    projectedExtent.XMin, projectedExtent.XMax,
                                                    projectedConstraintExtent.XMin,
                                                    projectedConstraintExtent.XMax,
                                                    out leftIndex, out rightIndex);

            int?bottomIndex;
            int?topIndex;

            RectangularTilingUtils.GetTileIndexes1D(OriginY, TileHeight,
                                                    projectedExtent.YMin, projectedExtent.YMax,
                                                    projectedConstraintExtent.YMin,
                                                    projectedConstraintExtent.YMax,
                                                    out bottomIndex, out topIndex);

            IEnvelope result;

            if (leftIndex == null || rightIndex == null || bottomIndex == null ||
                topIndex == null)
            {
                result = new EnvelopeClass();
                result.SpatialReference = SpatialReference;
            }
            else
            {
                var tileLL =
                    new RectangularTileIndex(leftIndex.Value, bottomIndex.Value);
                var tileUR =
                    new RectangularTileIndex(rightIndex.Value, topIndex.Value);

                result = GetTileEnvelope(SpatialReference, tileLL, tileUR);
            }

            return(result);
        }
Example #4
0
        public IEnvelope GetTileEnvelope([CanBeNull] ISpatialReference spatialReference,
                                         params RectangularTileIndex[] tileIndexes)
        {
            IEnvelope result = RectangularTilingUtils.GetTileEnvelope(OriginX, OriginY,
                                                                      TileWidth, TileHeight,
                                                                      spatialReference,
                                                                      tileIndexes);

            return(result);
        }