Hello everyone, welcome to ArcGIS Tutorial. Today, we are going to discuss The SQLite database on ArcGIS 10. For you who new to SQLite, SQLite is a lightweight SQL database engine that has been used widely in many GIS software including QGIS and ArcGIS. SQLite is an embedded SQL database engine that does not require separate server process. In our eyes, SQLite is just a file, same as other files. If you want to learn the details, please visit this SQLite page.
Our Goal
At the end of this article, you will be able to create a new SQLite database on ArcGIS 10.6 using Python command.
Requirements
Since we are going to “play” a little bit with Python command, make sure you follow the steps below carefully. But don’t worry, Python is not as bad as you think.
Lesson 1. Create a New SQLite Database on ArcGIS
To create a new SQLite Database on ArcGIS via Python, follow these steps:
- Open ArcMap
- Open Python window. To do this, go to GeoProcessing | Python.
- Type the following command to create the database
import arcpy
arcpy.CreateSQLiteDatabase_management('D:/Tutorial/test.sqlite', 'ST_GEOMETRY')
Make sure you change the path with your own path.
- In few moments, if there is no error, your new SQLite database is ready.
Lesson 2. How to Export Data/Feature Class to SQLite Database in ArcGIS
Now we have a new SQLite database. We will try to export some feature class to this SQLite database from ArcMap. To do this, follow these steps.
- Right-click the SQLite file from Catalog.
- Go to Import | Feature Class
- Specify the input and output feature class
- Type the layer name for the output
- Hit OK
Pretty easy, right? SQLite database is a simple and compact way to store and distribute ArcGIS files. SQLite or Spatialite database only supports vector data. It does not support raster dataset. If you want to store your raster datasets, we recommend using file geodatabase (.gdb) instead of using SQLite.