Live Online ConverterChannel: geopackagegml

GeoPackage to GML Converter

Export SQLite spatial tables as GML XML documents.

Convert database tables and variables back to official XML schemas. This upcoming utility extracts index layers and attributes from modern GeoPackage sources and writes them to standard GML XML formats.

Drag file here to convert, or select file

Supported file extension: .gpkg • Max 50MB

Channel: Direct Stream ModeGDAL Driver Operational

Specification Rules

  • Export cadastral records from local databases back to GML formats
  • Share spatial layers with government bodies requiring XML schemas
  • Integrate local database assets with enterprise map pipelines
  • Multi-layered database tables are split into individual GML files
  • GML XML structures occupy more space on disk than raw geospatial files
  • Requires explicit coordinate reference systems to avoid errors

GDAL Direct Equivalent Terminal Command

sh — gdalready
$ogr2ogr -f GML output.gml input.gpkg layer_name

When to use this conversion

Convert when a GeoPackage-based master dataset needs to be published as GML for INSPIRE compliance, government data portal submission, or OGC WFS service. The GeoPackage is the working format; GML is the distribution format.

Technical Details

GDAL extracts each GeoPackage layer (or a specified subset) and writes GML 3.2.1. The source CRS is preserved in srsName attributes; feature properties become typed XML elements. For schema-strict publishing, post-process the output to match the recipient's XSD or use FME with a template.
Output file size

GML is typically 10–20× the size of the source GeoPackage. The verbosity penalty is severe; always gzip GML for distribution.

Common Errors & Fixes

  • XSD validation fails: GML structure doesn't match the publisher's schema. Fix: use a templating tool (FME, custom XSLT) to produce strict output.
  • CRS URI format wrong: recipient expects EPSG URN, GDAL wrote EPSG URL. Fix: --dsco SRSNAME_FORMAT=OGC_URN.
  • Multi-layer single file rejected: some recipients want one GML per feature type. Fix: run ogr2ogr per layer.
  • GML version mismatch: 3.2.1 vs 3.1 vs 2.x. Fix: explicit -dsco FORMAT=<version>.

Alternative Tools

  • QGIS: open .gpkg, export each layer as GML
  • ogr2ogr CLI: ogr2ogr -f GML output.gml input.gpkg layer_name
  • FME with INSPIRE/NAS templates for schema-compliant output
  • GeoServer publishes layers as GML via WFS — same effect, served over HTTP

Frequently Asked Questions

Can I convert multiple database tables simultaneously?

Yes. The converter targets active layers, creating matching vector tables for each imported file.

What is the standard coordinate scale?

Projections utilize UTM configurations to ensure spatial accuracy when mapping vectors.

Is the output compatible with municipal systems?

Yes. The generated files are structured according to GML standards, ensuring compatibility with official systems.

Related Transformations Map