Summary
Creates a GeoPackageor an SQLite database that contains the ST_Geometry or SpatiaLite spatial type.
Usage
The Output Database Name will be automatically assigned an extension based on the value of the Spatial Type parameter. If the spatial type is ST_Geometry or SpatiaLite, the output name will have an .sqlite extension. If the spatial type is GeoPackage, the output name will have a .gpkg extension.
Syntax
arcpy.management.CreateSQLiteDatabase(out_database_name, {spatial_type})
Parameter | Explanation | Data Type |
out_database_name | The location of the SQLite database or GeoPackage to be created and the name of the file. An extension of .sqlite will be automatically assigned if the spatial_type is ST_GEOMETRY or SPATIALITE. If the spatial_type is GEOPACKAGE, a .gpkg extension will be automatically assigned. | File |
spatial_type (Optional) | Specifies the spatial type to install with the new SQLite database or the GeoPackage version to create.
| String |
Code sample
The following Python window script demonstrates how to use the CreateSQLiteDatabase tool in immediate mode to create a GeoPackage.
import arcpy
arcpy.CreateSQLiteDatabase_management('c:/data/example.gpkg', 'GEOPACKAGE_1.2')
The following stand-alone script demonstrates how to use the CreateSQLiteDatabase tool to create an SQLite database that contains the ST_Geometry spatial type.
import arcpy
# Execute CreateSQLiteDatabase
arcpy.CreateSQLiteDatabase_management('C:/data/example.sqlite', 'ST_GEOMETRY')
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes