Vector and Database

GeoPackage (GPKG) Viewer

Open a GeoPackage file in your browser. View its layers on the map, search the attribute table, run read-only SQL queries and export layers to GeoJSON or CSV.

The file is read on your device, inside the browser, and is not uploaded anywhere. Only library files (jsDelivr) and basemap tiles (Esri, OpenStreetMap) are downloaded from the internet. If you have accepted cookies, only events such as "file opened" are counted anonymously.

What it reads

Points, lines, polygons, multi-part geometries and geometry collections; 2D, Z, M and ZM coordinates; coordinate systems defined by EPSG code or WKT; PNG, JPEG and WebP tiles, and attribute tables without geometry.

Related Tools

What a GeoPackage is

GeoPackage (file extension .gpkg) is an open geospatial format defined by the Open Geospatial Consortium (OGC). Under the hood it is a single SQLite database file organised with a set of required tables and rules. One file can hold several vector layers, raster tile layers and attribute tables without geometry. Because it has none of the shapefile's limits, such as short column names, the 2 GB size cap and a handful of sidecar files, it is increasingly used for data exchange between organisations and in field apps.

This tool is meant to show which layers a GeoPackage contains, which coordinate system each layer uses and how many records it holds, without installing desktop GIS software. It draws the layers on a map, lists attributes in a paged table and exports any layer to GeoJSON or CSV.

Next to the data tables, every GeoPackage carries a few system tables. gpkg_contents lists each layer with its type and extent, gpkg_geometry_columns defines the geometry column, geometry type and the Z and M dimensions, and gpkg_spatial_ref_sys stores the coordinate systems in use together with their WKT definitions. Zoom levels of tile layers live in gpkg_tile_matrix_set and gpkg_tile_matrix. The tool builds the layer list from these tables, and you can inspect the same tables in the SQL box.

How to use it

  1. Drag the GPKG file onto the box above, or click the box to choose it.
  2. The layer list shows each layer's type (features, tiles, attributes), geometry type, record count and coordinate system. Use the checkboxes to turn layers on and off on the map.
  3. Click a layer name to open its details and attribute table. The search box looks through every column, and the table is paged 25 rows at a time.
  4. Click a feature on the map to see its attributes; the matching row is highlighted in the table. The target icon in the table locates the feature on the map.
  5. For tile layers, see how many tiles each zoom level holds and choose which zoom level to show on the map.
  6. Download the selected layer as GeoJSON or CSV, or run your own query in the SQL box.

Export and SQL queries

The GeoJSON export transforms every feature in the layer to WGS84 longitude and latitude and writes RFC 7946 GeoJSON; Z values are kept. The CSV file contains the attribute columns plus the geometry as WKT text in WGS84, and it is saved with a UTF-8 byte order mark so that non-Latin characters display correctly in Excel. On the English page the field separator is a comma.

The SQL box lets you query the tables in the file directly. For example, SELECT district, count(*) FROM parcels GROUP BY district counts records per district, and SELECT * FROM gpkg_spatial_ref_sys lists the coordinate system definitions in the file. If the result contains a geometry column, the features found are drawn in orange on the map. Because the connection is opened with writing switched off, queries cannot change the file.

Data and method

The file is opened in browser memory with sql.js 1.14.2 (MIT licence), a WebAssembly build of SQLite. Layers are read from gpkg_contents, geometry columns from gpkg_geometry_columns and coordinate systems from gpkg_spatial_ref_sys. Each geometry is decoded by reading the GeoPackage binary header (byte order, envelope and SRS id) followed by the WKB payload, and converted to GeoJSON; both byte orders, ISO and EWKB type codes, and Z and M dimensions are supported.

Coordinates are transformed with proj4js 2.9.0 (MIT licence). TUREF, ED50 and UTM systems common in Turkey are built in; for other systems the WKT definition stored in the file is used. For the ED50 datum, the EPSG:1784 (ED50 to WGS 84 (30)) parameters defined for Turkey are applied. Icons come from Lucide (ISC); basemaps belong to Esri and OpenStreetMap contributors. Open-source libraries used and their licences: Data Sources.

Limits

For professional projects

If you need to bring GeoPackage, shapefile and CAD data from different departments into a shared data model, or turn that data into regularly updated dashboards, you can reach us through the contact page. More about our work is on the Rodosto Teknoloji website.

Frequently Asked Questions

How do I convert a GPKG file to GeoJSON?

Open the file, pick a feature layer from the layer list and press GeoJSON. All features in the layer are transformed to WGS84 longitude and latitude and written as RFC 7946 GeoJSON. You can also download the attribute table as CSV, where the geometry is included as WKT text.

Is my GeoPackage uploaded to a server?

No. The file is read inside the browser by an SQLite engine running in WebAssembly and is not sent anywhere. Only the library files (jsDelivr) and basemap tiles (Esri, OpenStreetMap) are downloaded from the internet.

Can I change data with the SQL box?

No. The SQL box is read-only: only SELECT, WITH, EXPLAIN and PRAGMA queries that describe table structure are run, and the database connection is opened with writing switched off. Your file is never modified.

Are tile (raster) layers displayed?

Yes. For layers with PNG, JPEG or WebP tiles, the tiles of one zoom level are merged and placed on the map. A table lists the zoom levels with their tile counts, matrix size and pixel size. For tiles the browser cannot decode, such as TIFF-tiled elevation coverages, only the information is shown.