private RectangularTileIndex GetTileIndexAt( double locationX, double locationY, BorderPointTileAllocationPolicy borderPointTileAllocation) { return(RectangularTilingUtils.GetTileIndex(locationX, locationY, OriginX, OriginY, TileWidth, TileHeight, borderPointTileAllocation)); }
public static RectangularTileIndex GetTileIndex( double locationX, double locationY, double originX, double originY, double tileWidth, double tileHeight, BorderPointTileAllocationPolicy borderPointTileAllocation) { int indexEast; int indexNorth; double tilePositionX = (locationX - originX) / tileWidth; double tilePositionY = (locationY - originY) / tileHeight; switch (borderPointTileAllocation) { case BorderPointTileAllocationPolicy.BottomLeft: indexEast = GetIntegerIndex(tilePositionX, AllocationPolicy1D.ExcludeUpperBound); indexNorth = GetIntegerIndex(tilePositionY, AllocationPolicy1D.ExcludeUpperBound); break; case BorderPointTileAllocationPolicy.TopLeft: indexEast = GetIntegerIndex(tilePositionX, AllocationPolicy1D.ExcludeUpperBound); indexNorth = GetIntegerIndex(tilePositionY, AllocationPolicy1D.IncludeUpperBound); break; case BorderPointTileAllocationPolicy.TopRight: indexEast = GetIntegerIndex(tilePositionX, AllocationPolicy1D.IncludeUpperBound); indexNorth = GetIntegerIndex(tilePositionY, AllocationPolicy1D.IncludeUpperBound); break; case BorderPointTileAllocationPolicy.BottomRight: indexEast = GetIntegerIndex(tilePositionX, AllocationPolicy1D.IncludeUpperBound); indexNorth = GetIntegerIndex(tilePositionY, AllocationPolicy1D.ExcludeUpperBound); break; default: throw new ArgumentOutOfRangeException( nameof(borderPointTileAllocation), borderPointTileAllocation, @"Unexpected value"); } return(new RectangularTileIndex(indexEast, indexNorth)); }
public RectangularTilingStructure( double originX, double originY, double tileWidth, double tileHeight, BorderPointTileAllocationPolicy borderPointTileAllocation, [CanBeNull] ISpatialReference spatialReference) { OriginX = originX; OriginY = originY; TileWidth = tileWidth; TileHeight = tileHeight; BorderPointTileAllocation = borderPointTileAllocation; SpatialReference = spatialReference; }