Skip to content

Repository files navigation

02CadGis icon

02CadGis

AutoCAD DWG/DXF, Netcad NCZ, KML, GML, CSV, GDB, DGN conversion studio for QGIS

QGIS License GeoPackage PlanX
Documentation

📖 Comprehensive Academic Reference Manual

02CadGis is a professional QGIS dock plugin for turning CAD and GIS exchange files into clean GeoPackage layers. It is built for planning, cadastral, municipal, and urban analytics workflows where AutoCAD DWG (*.dwg), DXF, KML/KMZ, GML, GeoJSON, CSV, SpatiaLite, GPX, DGN, FileGDB, and Netcad files need to become usable QGIS data quickly.

CAD converter
Import & Convert
CAD/GIS files to GeoPackage or scratch layers.
Netcad importer
Netcad NCZ/NCA
Batch import drawings, layers, text and tables.
GIS exporter
Export
Write active QGIS vector layers to DXF, KML or KMZ.

What It Does

  • Converts AutoCAD DWG (*.dwg), DXF, KML, KMZ, GML, GeoJSON, CSV/TSV, SpatiaLite/SQLite, GPX, DGN, FileGDB, Personal GDB, NCZ and compatible NCA files into .gpkg layers.
  • Accepts drag & drop: drop any supported file onto the dock and the dataset type is detected automatically (Netcad files jump to the NCZ tab).
  • Shows a pre-conversion layer preview with geometry types and feature counts, so you convert only the layers you check.
  • Caches the layer catalog of Geodatabase and database sources by a content fingerprint, so reopening the same unchanged .gdb/.mdb lists its layers instantly (over 100x faster) without reopening the driver.
  • Loads selected layers live, with no conversion: for FileGDB / Personal GDB (and any multi-layer OGR source) the checked layers are added straight to QGIS as zero-copy references, so even multi-million-feature Geodatabase layers open in a fraction of a second.
  • Splits DXF and DGN by CAD layer: each CAD layer name (DXF Layer) or level (DGN Level) becomes its own selectable QGIS layer instead of a single merged table.
  • Reads every KML document inside a KMZ, not just the first, so multi-document archives are imported in full.
  • Reads delimited text with automatic geometry detection: delimiter, X/Y or lon/lat columns (WGS84 auto-suggested), or a WKT column, all overridable before import.
  • Imports multiple Netcad drawings at once with selectable CAD layers and @TAB attribute tables.
  • Expands KML balloon HTML tables and list descriptions into real attribute fields.
  • Extracts KML/KMZ GroundOverlay images as georeferenced GeoTIFF layers.
  • Simplifies collinear CAD vertices, removes duplicate nodes, and closes small polygon gaps by tolerance.
  • Preserves CAD color intent with QGIS renderers and optional buffered labels for text elements.
  • Draws imar plans with the official e-Plan symbology. In PlanGML mode, each CAD tabaka is matched against the plan gösterimleri style set published by the Ministry on eplan.csb.gov.tr and rendered with its official color, tarama pattern and line type. The rules and the tarama tiles are compiled into the plugin, so nothing is downloaded and no style server is needed. The gösterim is the official standard, not 02CadGis artwork — see THIRD_PARTY_NOTICES.md.
  • Exports active QGIS vector layers to DXF, KML or KMZ.
  • Includes a built-in Guide button in the QGIS dock for workflow help.

Supported Workflows

Workflow Input / Output Engine Best for
CAD/GIS import .dxf, .dgn, .kml, .kmz, .gml, .geojson, .sqlite, .gpx, .gdb, .mdb to .gpkg or scratch layers QGIS GDAL/OGR Standard exchange files and planning datasets
Delimited text import .csv, .tsv, .txt with auto-detected X/Y or WKT geometry QGIS delimited text provider Survey point lists, exports from spreadsheets and databases
Future enhancement .dwg Planned external/newer CAD reader path DWG versions beyond GDAL libopencad support
Netcad import .ncz, compatible .nca Built-in parser Netcad drawings with layers, colors, labels and @TAB tables
KML overlay extraction KML/KMZ GroundOverlay to GeoTIFF GDAL Georeferenced image overlays
QGIS export Active vector layer to .dxf, .kml, .kmz QGIS vector writer Delivery back to CAD/GIS exchange formats

QGIS Dock

The plugin opens as one compact dock with three focused panels:

  1. CAD & GIS Converter Select source type (or drop a file), review the discovered layer list, set target GeoPackage, CRS, cleanup options, KML expansion, GroundOverlay extraction, and delimited-text geometry columns. A target GPKG name is pre-suggested from the source file, options persist across sessions, and results are announced in the QGIS message bar without blocking dialogs. Pick one of three output modes: convert to GeoPackage (durable, transformed), import as temporary scratch layers, or live — add the checked layers with no conversion at all, ideal for browsing large FileGDB / Personal GDB databases. DXF/DGN sources can be split into their CAD layers for selection, and the Geodatabase/database layer catalog is cached for instant reopening.

  2. Netcad NCZ/NCA Importer Select one or more Netcad drawings, review metadata, choose CAD layers and @TAB tables, set closure tolerance, generate geometry metrics, apply colors/labels, and load to QGIS.

  3. CAD & GIS Exporter Select a project vector layer and export it as DXF, KML or KMZ.

Use temporary scratch layers for quick inspection. Use GeoPackage output for durable deliverables.

Conversion Flow

flowchart LR
  A[CAD / GIS / Netcad source] --> B{Input type}
  B -->|DXF DGN KML KMZ GML GeoJSON SQLite GPX GDB| C[QGIS OGR reader]
  B -->|CSV TSV TXT| T[Delimited text sniffer]
  B -->|DWG| X[Future enhancement]
  B -->|NCZ / NCA| D[Netcad parser]
  C --> E[CRS + cleanup + attributes]
  T --> E
  D --> E
  E --> F{Output mode}
  F -->|GeoPackage| G[(.gpkg)]
  F -->|Scratch| H[QGIS memory layers]
  G --> I[QGIS project]
  H --> I
  I --> J[DXF / KML / KMZ export]
Loading

Netcad Import Notes

The Netcad panel is intentionally detailed because these drawings often contain mixed geometry, text, colors and table data.

  • Fast selection, selective decode: choosing a drawing only indexes its layers and metadata, so the layer tree appears almost immediately even for large municipal files; geometry is decoded only for the layers you keep checked at import time.
  • Index cache: the layer catalog of each drawing is cached locally and keyed to the file's size and modification time, so reopening an unchanged drawing is near-instant. The cache rebuilds automatically when a file changes; use Clear cache on the Netcad tab to reset it manually.
  • Batch import: select several files; 02CadGis keeps file groups separate by default, or merges matching layer names inside geometry-type groups when Merge geometry types is enabled.
  • Automatic CRS detection: a Netcad drawing stores its own SRS id, not an EPSG code, so 02CadGis works the EPSG out from the drawing's projection text plus a sample of its coordinates and preselects it. The Turkish 3-degree families are covered — TUREF and ED50, in both the TM form and the zone-prefixed Gauss-Krüger form — along with the UTM zones over Turkey. The panel shows which CRS was chosen and why, and the choice is only a preselection: change it and your choice is what gets used. When the drawing does not say enough to name a CRS with confidence, 02CadGis says so and leaves the selection to you rather than guessing, since a wrong CRS silently puts the data in the wrong place. The chosen CRS is what the layers are drawn in and what a written GeoPackage carries.
  • Metadata review: version, projection text, EPSG hints, feature counts and table counts are shown before conversion.
  • Layer filtering: uncheck unnecessary CAD layers or @TAB tables before import.
  • Closure tolerance: keeps cadastral polygon creation controlled; use small values unless the drawing has known snap gaps.
  • Geometry metrics: optional length, area and centroid fields help QA and reporting.
  • Styling: ARGB colors and text labels can be carried into QGIS for easier review.
  • Joins: @TAB tables are linked back to geometry where matching name or label fields are available.

PlanGML mode and official symbology

PlanGML mode is off by default and should stay off for non-planning drawings — topographic surveys, utility networks, cadastral and civil engineering files keep their raw tabaka names, their CAD attributes and their original ARGB colors.

Turn it on for an imar plan and 02CadGis will:

  • group tabaka into the official upper groups of the Ministry's UİP tabaka catalog — KONUT ALANLARI / YERLEŞİM ALANLARI, KENTSEL ÇALIŞMA ALANLARI, AÇIK VE YEŞİL ALANLAR, EĞİTİM TESİSLERİ ALANI, PLANLAMA SINIRLARI, … — one layer per upper group and geometry type, so the layer tree is organised the way the regulation is. Tabaka the catalog does not define go to a single DİĞER PLAN ALANLARI layer, which is the only group name here that is not the Ministry's own;
  • fill the PlanGML schema columns (UST_GRUP_ID, UST_GRUP_ADI, ALT_GRUP_ID, ALT_GRUP_ADI, PLAN_KODU, FONKSIYON_KODU, TAM_ADI, GISTERIM, uip_tabaka) with the official codes from the Ministry's UİP tabaka catalog — PL_KONUT comes out as group 112000 "KONUT ALANLARI / YERLEŞİM ALANLARI", function 112002 "YERLEŞİK KONUT ALANI" — keeping the drawing's own tabaka name in uip_tabaka. A tabaka the catalog does not define, such as a CAD symbol or text layer, gets empty code cells rather than invented ones;
  • style each layer from the official e-Plan style set — a categorized renderer over uip_tabaka, so every land use inside a merged layer keeps its own official gösterim rather than a single flat color.

The plan type selector picks which official set is used. Auto reads the scale from the file name — 1000_… uses uygulama imar (1/1000), 5000_… nazım imar (1/5000), 25000 and above çevre düzeni — and words such as NAZIM or ÇEVRE override the number. Choose the type explicitly when the file name says nothing.

Tabaka the official set does not cover (CAD helper layers such as symbol, text anchor or rölöve layers) fall back to a neutral style and are never given a planning meaning they do not have.

If a file does not parse as expected, retry with cleanup disabled and inspect the raw layer selection before increasing tolerance.

NCZ Engine Provenance

02CadGis reads Netcad NCZ/NCA drawings with its v2 engine (core/ncz_engine/v2/), an independent, block-oriented decoder written against the documented format layout in docs/NCZ_FORMAT.md rather than by adapting upstream source line by line. Because that format knowledge ultimately traces back to Jeomatik NCZ Reader, Copyright (C) 2026 Erdinç Örsan ÜNAL, under GPL-2.0-or-later, the upstream copyright, source link, and license are retained in THIRD_PARTY_NOTICES.md. The legacy v1 decoder is kept as a validated reference and safety fallback; the v2 engine is verified to produce byte-identical output to it across the synthetic NCZ corpus in tests/. The engine architecture and roadmap are in docs/NCZ_ENGINE_V2.md.

02CadGis is an independent project and is not endorsed by or affiliated with Jeomatik.

Installation

Development path in this plugin workspace:

C:\Users\YE\PyCharmMiscProject\qgis_plugins\zero2cadgis

Optional test environment variable:

$env:QGIS_PLUGINPATH = "C:\Users\YE\PyCharmMiscProject\qgis_plugins"

Restart QGIS, then enable 02CadGis Universal CAD/GIS Importer from Plugins > Manage and Install Plugins.

Build and Validate

python -m unittest zero2cadgis.tests.test_e2e_converter
python packaging\validate_plugin.py zero2cadgis --strict
.\packaging\Build-PluginZip.ps1 -PluginDir zero2cadgis

The release zip is written to:

QGIS_Plugin_Releases\zero2cadgis.zip

Troubleshooting

Symptom Likely cause Fix
Plugin does not appear QGIS is not scanning this folder Set QGIS_PLUGINPATH and restart QGIS.
DWG does not open DWG is currently a future enhancement; this QGIS/GDAL build only exposes limited libopencad support Convert to DXF first, then run 02CadGis.
KML overlay is missing No valid GroundOverlay or image path Check the KML/KMZ structure and referenced image files.
Netcad layers are missing Unsupported entity block or aggressive cleanup Retry with cleanup disabled and lower closure tolerance.
Hub icon is missing Metadata icon path mismatch Keep icon=icons/icon.png and package with the provided build script.

Ownership and License

About

Convert Netcad NCZ/NCA drawings, DXF CAD, KML/KMZ, DGN, and GDB datasets directly into optimized GeoPackage layers with QGIS styling.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages