CLI GuideChannel: alkis nasgeopackage

ALKIS NAS to GeoPackage Converter

Convert specialized German cadastral XML records into structured GIS models.

The German ALKIS cadastral land register uses the NAS XML schema, which features complex relationships that standard web models cannot parse directly. This guide details how to import NAS datasets into spatially indexed database tables using specialized GDAL drivers.

Indirect Mapping Execution Required

Because database connection attributes or local attributes parsing is required, direct web streams are disabled. Use the GDAL CLI script below for precise terminal conversions.

Specification Rules

  • Incorporate official German cadastral data into regional planning databases
  • Analyze parcel boundary lines and ownership coordinates across municipalities
  • Import official construction plan boundaries into regional planning files
  • NAS uses a highly custom XML schema that standard converters fail to read
  • Must use GDAL versions compiled with the libxml2 library
  • Output coordinates default to German Gauss-Kruger or UTM projections

GDAL Direct Equivalent Terminal Command

sh — gdalready
$ogr2ogr -f GPKG cadastral.gpkg input.xml

When to use this conversion

Use this guide whenever you receive German cadastral data in the NAS XML exchange format (ALKIS) and need to use it in QGIS, ArcGIS, or any non-specialist GIS tool. The NAS driver is the only realistic path; direct generic-GML conversion almost always fails.

Technical Details

GDAL must be built with libxml2 and the NAS driver enabled. The driver reads the NAS XML stream, applies the AdV-defined feature schema (Flurstück, Gebäude, etc.), and writes each feature type to its own GeoPackage layer. Coordinates remain in the source CRS — typically EPSG:25832 (ETRS89 / UTM 32N) for western Germany or EPSG:25833 for eastern.
Output file size

GeoPackage is typically 10–30% the size of the source NAS XML. The XML is extraordinarily verbose; binary geometry plus SQLite metadata compresses it dramatically.

Common Errors & Fixes

  • GDAL fails with "Unknown driver NAS": build does not include libxml2 or NAS support. Fix: install conda-forge gdal, which compiles with NAS by default.
  • Schema mismatch errors: the NAS schema version differs from what GDAL expects. Fix: pass an explicit --config NAS_INDICATOR matching your exporter's schema file.
  • Geometries empty for Flurstücke: the feature hierarchy resolves to references that GDAL doesn't follow by default. Fix: set --config GML_SKIP_RESOLVE_ELEMS NONE.
  • CRS not set automatically: very rare, but ensure the layer has srs_id 25832 or 25833 in gpkg_spatial_ref_sys after import.

Alternative Tools

  • norbit ALKIS Import or the official AdV tools for production cadastral pipelines
  • norBIT alkis-format tools for converting to PostGIS
  • FME with the NAS reader (commercial but excellent)
  • QGIS's ALKIS Vereinfachte Schema plugin for simplified schema import

Frequently Asked Questions

Why does standard conversion fail on NAS XML files?

NAS uses a complex GML scheme with deeply nested element properties. Standard models only see basic text elements rather than real shapes/geometries.

Which coordinate reference system does ALKIS use?

Most ALKIS models in Germany are projected using local coordinate systems like ETRS89 / UTM (EPSG:25832 or EPSG:25833).

Where can I find schema definitions?

We recommend using targeted QGIS imports or custom python libraries designed to process German cadastral schemas.

Related Transformations Map