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 for 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

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

CreateSQLiteDatabase

  • Summary
  • Syntax
  • Code sample

Summary

Creates an SQLite database or GeoPackage.

Syntax

CreateSQLiteDatabase (sqlite_database_path, {spatial_type})
ParameterExplanationData Type
sqlite_database_path

Location of the SQLite database to be created and the name of the SQLite database file. You must include the .sqlite extension in the database file name if creating a SQLite database that uses a spatial type of ST_Geometry or SpatiaLite. When creating a GeoPackage, a .gpkg extension is required.

String
spatial_type

The geometry type to install with the new SQLite database. You can use only one geometry type in SQLite databases.

  • ST_GEOMETRY —Esri's spatial storage type. This is the default.
  • SPATIALITE —SpatiaLite spatial storage type.
  • GEOPACKAGE — OGC GeoPackage dataset.
String

Return Value

Data TypeExplanation
File

An SQLite database (.sqlite extension) with either ST_Geometry or SpatiaLite geometry type installed. Alternately, a GeoPackage is returned (.gpkg extension).

Code sample

CreateSQLiteDatabase ST_Geometry example 1

Create an SQLite database.

import arcpy

# Set local variables
sqlite_database_path = 'C:/Data/Counties.sqlite'

# Execute CreateSQLiteDatabase
arcpy.gp.CreateSQLiteDatabase(sqlite_database_path, "ST_GEOMETRY")
CreateSQLiteDatabase GeoPackage example 2

Create a GeoPackage.

import arcpy

# Set local variables
sqlite_database_path = 'C:/Data/Counties.gpkg'

# Execute CreateSQLiteDatabase
arcpy.gp.CreateSQLiteDatabase(sqlite_database_path, "GEOPACKAGE")

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

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