public Stream GenerateSingleImage(string strServerType, string strServer, string strLayer, string strBBox, double dMinX, double dMinY, double dMaxX, double dMaxY) { strServerType = HttpUtility.UrlDecode(strServerType); strServer = HttpUtility.UrlDecode(strServer); strLayer = HttpUtility.UrlDecode(strLayer); BoundingBox oViewBounds; BoundingBox oLayerBounds = new BoundingBox(dMaxX, dMaxY, dMinX, dMinY); System.Diagnostics.Debug.Assert(oLayerBounds.MaxX >= oLayerBounds.MinX); System.Diagnostics.Debug.Assert(oLayerBounds.MaxY >= oLayerBounds.MinY); LayerInfo oLayer = new LayerInfo(strServerType, strServer, strLayer); #region // Input checking oViewBounds = ParseBBoxToken(strBBox); if (oViewBounds == null) { ReportStatusCode(HttpStatusCode.BadRequest); return null; } System.Diagnostics.Debug.Assert(oViewBounds.MaxX >= oViewBounds.MinX); System.Diagnostics.Debug.Assert(oViewBounds.MaxY >= oViewBounds.MinY); #endregion byte[] oImage = oLayer.GetCompositeImage(oLayerBounds, oViewBounds); if (oImage != null) { return new MemoryStream(oImage); } else { ReportStatusCode(HttpStatusCode.NotFound); return null; } }
public Stream GetCachedImageTile(string strServerType, string strServer, string strLayer, int iLevel, int iCol, int iRow) { strServerType = HttpUtility.UrlDecode(strServerType); strServer = HttpUtility.UrlDecode(strServer); strLayer = HttpUtility.UrlDecode(strLayer); TileInfo oTile = new TileInfo(iLevel, iCol, iRow); LayerInfo oLayer = new LayerInfo(strServerType, strServer, strLayer); #region // Input checking if (String.IsNullOrEmpty(strServerType) || String.IsNullOrEmpty(strServer) || String.IsNullOrEmpty(strLayer)) { ReportStatusCode(HttpStatusCode.BadRequest); return null; } #endregion byte[] oImage = oLayer.GetTileImage(oTile); if (oImage != null) { return new MemoryStream(oImage); } else { ReportStatusCode(HttpStatusCode.NotFound); return null; } }
/// <summary> /// Constructor. /// </summary> /// <param name="oLayer">The layer of this download.</param> /// <param name="oTile">The tile to download.</param> public DownloadInfo(LayerInfo oLayer, TileInfo oTile) { m_oLayer = oLayer; m_oTile = oTile; }