Skip To Content

Add Raster to GeoPackage


Load raster datasets into an OGC GeoPackage raster pyramid.


  • The target GeoPackage can be created using the Create SQLite Database tool.

  • The GeoPackage raster name cannot already exist in the GeoPackage.

  • Raster data with an unknown coordinate reference will be created with a 6-level tiling scheme.


AddRasterToGeoPackage_conversion (in_dataset, target_geopackage, raster_name, {tiling_scheme}, {tiling_scheme_file}, {area_of_interest})
ParameterExplanationData Type

The raster dataset to load into the OGC GeoPackage raster pyramid.

Raster Layer; Mosaic Layer

The target GeoPackage.

File; Workspace

The name of the output GeoPackage raster pyramid.


The tiling scheme used.

  • TILEDThe spatial reference of the input raster will be maintained and tiles will be generated consistent with the GeoPackage standard. This is the default.
  • ARCGISONLINE_SCHEME Generate raster tiles in a Web Mercator coordinate reference (the same scheme developed for the Army Geospatial Center).
  • NSGPROFILE_SCALED_TRANSVERSE_MERCATORA scaled transverse Mercator is used.
  • NSGPROFILE_WGS84_GEOGRAPHICWGS84 Geographic is used.
  • GOOGLE_EARTH_WEB_MERCATORCreate raster tiles using the parameters in the Web Mercator coordinate reference.
  • FROM_FILEUses a custom tiling scheme from a file using an XML schema definition created using the Generate Tile Cache Tiling Scheme tool.

A custom tiling scheme file that is required when tiling_scheme is set to FROM_FILE.


Specify an area to limit the area of where you the raster loaded, rather than the entire dataset.

Feature Set

Code sample

AddRasterToGeoPackage example 1 (Python window)

The following Python window script demonstrates how to use the AddRasterToGeoPackage tool.

import arcpy
arcpy.AddRasterToGeoPackage_conversion("c:/data/san_diego.png", "c:/data/san_diego.gpkg", "SanDiego", "TILED")


This tool does not use any geoprocessing environments.

Licensing information

  • ArcGIS Desktop Basic: Yes
  • ArcGIS Desktop Standard: Yes
  • ArcGIS Desktop Advanced: Yes

Related topics