ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Create SQLite Database

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Creates a GeoPackage or an SQLite database that contains the ST_Geometry or SpatiaLite spatial type.

Usage

  • The Output Database Name parameter value will be automatically assigned an extension based on the value of the Spatial Type parameter. If the spatial type parameter value is ST_Geometry or SpatiaLite, the output name will have an .sqlite extension. If the spatial type parameter value is GeoPackage, the output name will have a .gpkg extension.

Syntax

arcpy.management.CreateSQLiteDatabase(out_database_name, {spatial_type})
ParameterExplanationData Type
out_database_name

The location of the SQLite database or GeoPackage to be created and the name of the file. The .sqlite extension will be automatically assigned if the spatial_type parameter value is ST_GEOMETRY or SPATIALITE. If the spatial_type parameter value is GEOPACKAGE, the .gpkg extension will be automatically assigned.

File
spatial_type
(Optional)

Specifies the spatial type that will be installed with the new SQLite database or the GeoPackage version that will be created.

  • ST_GEOMETRY —The Esri spatial storage type will be installed. This is the default.
  • SPATIALITE —SpatiaLite spatial storage type will be installed.
  • GEOPACKAGE —An OGC GeoPackage 1.3 dataset is created.
  • GEOPACKAGE_1.0 —An OGC GeoPackage 1.0 dataset will be created.
  • GEOPACKAGE_1.1 —An OGC GeoPackage 1.1 dataset will be created.
  • GEOPACKAGE_1.2 —An OGC GeoPackage 1.2.1 dataset will be created.
  • GEOPACKAGE_1.3 —An OGC GeoPackage 1.3 dataset will be created.
String

Code sample

CreateSQLiteDatabase example 1 (Python window)

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')
CreateSQLiteDatabase example 2 (stand-alone script)

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

  • Current Workspace

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics

  • An overview of the Workspace toolset

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal