MapPackage.CreateImagePyramidWriter Methods
Creates a MapPackageImagePyramidWriter to write image data to a new table in an OGC GeoPackage file.
Overload List
Name | Description | |
---|---|---|
Public method | CreateImagePyramidWriter(MapPackageImageTable table, View view) | Creates a MapPackageImagePyramidWriter to render data from an entire View to a new table in an OGC GeoPackage file. |
Public method | CreateImagePyramidWriter(MapPackageImageTable table, Layer layer) | Creates a MapPackageImagePyramidWriter to render data from a specific Layer to a new table in an OGC GeoPackage file. |
CreateImagePyramidWriter(MapPackageImageTable table, View view)
Creates a MapPackageImagePyramidWriter to render data from an entire View to a new table in an OGC GeoPackage file.Syntax
public MapPackageImagePyramidWriter CreateImagePyramidWriter (
MapPackageImageTable table,
View view
)
Parameters
Return Value
Remarks
Use this method when you want to render an entire View to a GeoPackage image pyramid. The pyramid will be created in a new table in the OGC GeoPackage file this MapPackage is connected to.
The Drawable.PixelSize and Drawable.PixelSizeAdjustments of the attached drawable will be ignored during rasterization. If you want to create a package for a screen resolution other than 96 DPI, use the MapPackageImageTable.PixelSize and MapPackageImageTable.PixelSizeAdjustments properties instead.
Example
// Save layer to a GeoPackage file
static void SaveLayerToGeoPackage(string filename, Layer layer)
{
// Create new map package
var mapPackage = new MapPackage(filename);
// Create an image table
var imageTable = new MapPackageImageTable("background", Crs.Wgs84MercatorWeb, layer.GetDataBounds(Crs.Wgs84MercatorWeb));
// Write raster image tiles to the GeoPackage file
var imageWriter = mapPackage.CreateImagePyramidWriter(imageTable, layer);
imageWriter.Write();
}
CreateImagePyramidWriter(MapPackageImageTable table, Layer layer)
Creates a MapPackageImagePyramidWriter to render data from a specific Layer to a new table in an OGC GeoPackage file.Syntax
public MapPackageImagePyramidWriter CreateImagePyramidWriter (
MapPackageImageTable table,
Layer layer
)
Parameters
Return Value
Remarks
Use this method when you want to render a specific Layer to a GeoPackage image pyramid. The pyramid will be created in a new table in the OGC GeoPackage file this MapPackage is connected to.
Example
// Save layer to a GeoPackage file
static void SaveLayerToGeoPackage(string filename, Layer layer)
{
// Create new map package
var mapPackage = new MapPackage(filename);
// Create an image table
var imageTable = new MapPackageImageTable("background", Crs.Wgs84MercatorWeb, layer.GetDataBounds(Crs.Wgs84MercatorWeb));
// Write raster image tiles to the GeoPackage file
var imageWriter = mapPackage.CreateImagePyramidWriter(imageTable, layer);
imageWriter.Write();
}
Platforms
Windows, Linux, Android