GeoPackage vs Shapefile

GeoPackage vs Shapefile

GeoPackage is an open OGC standard built on SQLite, and the shapefile is the format that has served as the default exchange container in GIS since the 1990s. Both store vector data for desktop and server use, but they differ in structure, capacity, attribute rules and the kind of work they support. This article compares them for practical data management.

GeoPackage vs Shapefile: What Is the Difference?

A shapefile is a fixed set of files that describes exactly one layer with one geometry type and a simple attribute table. A GeoPackage is a database in a single file: it can hold many vector layers, raster tiles and ordinary tables at once, uses real database data types, and supports SQL queries and a built-in spatial index.

GeoPackage vs Shapefile

Feature

GeoPackage

Shapefile

Format type

SQLite database in one file

Binary, several files

Standard

OGC GeoPackage Encoding Standard

Esri technical description (1998)

Files

One .gpkg file

.shp, .shx, .dbf and optional .prj, .cpg

Content

Many layers, raster tiles and plain tables

One feature class

Size limit

About 140 TB

2 GB per component file

Field names

Practically unlimited

Up to 10 characters

Data types

Integer, real, text, blob, date, datetime, boolean

Text, number, date without time

Null values

Supported

Not supported

Encoding

UTF-8

Code page declared in .cpg

Spatial index

R-tree inside the file

Optional .sbn/.sbx or .qix files

Queries

Full SQL through SQLite

Attribute queries through GIS software

Raster data

Tiles and gridded coverages

Not supported

Typical use

Working format, mobile and offline data

Exchange with established workflows

What Is GeoPackage?

A GeoPackage is an SQLite database that follows rules defined by the Open Geospatial Consortium. Geometry is stored in a binary column inside a normal table, and additional system tables describe the layers, their coordinate systems and their extents, so any software that can read SQLite can also read the data structure.

Because the container is a database, a single .gpkg can hold the whole dataset of a project: several vector layers, basemap tiles for offline work, non-spatial reference tables and metadata. Layer styles can be stored in the file as well, using extensions implemented by QGIS and other applications.

What Is a Shapefile?

A shapefile stores geometry in the .shp file, record offsets in .shx and attributes in a .dbf table inherited from dBASE. The coordinate system lives in an optional .prj file and the character encoding in .cpg. The design is simple and fast to read, which is exactly why it became universal, but it also fixes the limits of a 1990s database format into every dataset produced today.

One File or Several

The practical consequence of the shapefile design is that data can be broken by ordinary file operations. Copying only the .shp, renaming one file but not the others, or losing the .prj during an upload leaves the data unusable or misplaced, and a project with dozens of layers becomes hundreds of files in a folder.

A GeoPackage moves in one piece. It can be emailed, copied to a phone or stored in a repository as a single object, and its internal layer names are not limited to file naming rules, so they can be descriptive and written in any language.

Attributes and Data Types

The dBASE table behind a shapefile allows field names of up to 10 characters, a maximum of 255 fields and text values of up to 254 characters, stores dates without a time component and has no concept of a null value, so empty numbers become zeros and empty text becomes blanks.

GeoPackage uses SQLite types: integers, floating-point numbers, text of any length, binary objects, dates, timestamps and booleans, with proper nulls. Field names keep their original form, which means that after migration, attribute tables no longer need a separate document explaining what abbreviations such as POP_DENS_1 were supposed to mean.

File Size and Performance

The size difference comes mainly from the attribute table. In a shapefile, text fields are fixed-width, so every record occupies the full declared length regardless of its content, while SQLite stores values as they are. In the test below, the same point layer takes roughly half as much space in GeoPackage, even though the GeoPackage also contains a spatial index.

The R-tree index is the more important difference for everyday work. It is created inside the file, so panning a map or running a spatial query reads only the relevant records instead of scanning the whole layer. Shapefiles can also be indexed, but the index lives in additional side files that are easy to lose during transfer, and its absence is often the reason a large shapefile feels slow.

Coordinate Systems

A GeoPackage records coordinate systems in a system table, so different layers in one file can use different projections, and each layer keeps a full WKT definition. A shapefile stores a single definition per dataset in the .prj file, and when that file is missing the software has to guess, which is one of the most common causes of misplaced data.

Software Support

GDAL/OGR has supported GeoPackage since 2014, and it is read and written by QGIS, ArcGIS Pro, MapInfo, FME, GeoServer and mobile applications such as QField. QGIS uses GeoPackage as its default format when creating new layers, and the same file can be opened on a phone for offline field work and then brought back to the desktop.

Shapefile support is still broader in one respect: almost any tool written in the last thirty years can read it, including old systems and simple scripts. This is the main reason organizations continue to publish data as shapefiles even when they use other formats internally.

Migrating from Shapefile to GeoPackage

Conversion is straightforward in QGIS, ArcGIS Pro or with a single ogr2ogr command, and several shapefiles can be written into one GeoPackage as separate layers. What conversion cannot do is restore information that was already lost: truncated field names stay truncated, zeros that replaced nulls stay zeros, and mis-encoded text stays broken unless the correct code page is specified during the import.

For that reason it is worth checking the original source before migrating a long-standing dataset. If the shapefile was itself exported from a geodatabase or a database table, re-exporting from that source into GeoPackage gives a cleaner result than converting the shapefile.

Common Mistakes

The most common technical mistake is treating a GeoPackage as a shared multiuser database. SQLite locks the whole file during a write, so simultaneous editing by several people, especially over a network share or a cloud-sync folder, can block writes or damage the file. For collaborative editing, PostGIS or an enterprise geodatabase is the right tool.

Another surprise is that a GeoPackage does not shrink when features are deleted: the freed pages stay inside the file until a VACUUM is executed. Running it after large deletions or repeated edits keeps the file compact.

The third mistake is migrating everything at once without checking who consumes the data. If partners, contractors or an internal portal expect shapefiles, the sensible approach is to use GeoPackage as the working format and export shapefiles only for delivery.

FAQs

Is GeoPackage a full replacement for the shapefile?

Technically yes: it stores everything a shapefile can and removes its limits. In practice the answer depends on the recipient, because some older software and internal workflows still accept only shapefiles.

Does ArcGIS Pro support GeoPackage?

Yes. ArcGIS Pro can read and write GeoPackage vector layers and read raster tiles, and conversion tools exist in both directions. Esri-specific capabilities such as attribute rules, subtypes and topology remain features of the geodatabase.

Can several people edit one GeoPackage?

Not simultaneously. Sequential work with a file on a shared drive is possible, but concurrent editing requires a server database. A common pattern is to give each participant a copy for field work and merge the results afterwards.

Can a GeoPackage store rasters?

Yes. The standard defines tile matrix sets for image tiles and gridded coverages for elevation-style data, which is what makes offline basemaps possible in mobile applications.

What about GeoJSON in this comparison?

GeoJSON is a text format for web exchange, not a working container. GeoPackage is closer in purpose to the shapefile: local storage of complete datasets, with an index and real data types.

Key Takeaways

GeoPackage solves the problems the shapefile creates: it keeps a project in one file, removes the 2 GB and 10-character limits, stores proper data types with nulls, carries its own spatial index and can hold vector layers, rasters and tables side by side. The shapefile keeps one advantage, but an important one: universal support.

A practical strategy is therefore to work in GeoPackage and export shapefiles only when a recipient requires them. New projects that start in GeoPackage avoid the data losses that appear later, when the truncated names and missing nulls of an old shapefile can no longer be recovered.

Transform Your Spatial Data Into Business Insight

Stop struggling with complex GIS tools. Import, analyze, and visualize your geographic data in minutes, not hours.

Transform Your Spatial Data Into Business Insight

Stop struggling with complex GIS tools. Import, analyze, and visualize your geographic data in minutes, not hours.

Transform Your Spatial Data Into Business Insight

Stop struggling with complex GIS tools. Import, analyze, and visualize your geographic data in minutes, not hours.