Skip to main content

qml4dart 0.1.1 copy "qml4dart: ^0.1.1" to clipboard
qml4dart: ^0.1.1 copied to clipboard

Pure Dart codec and object model for QGIS QML layer style files.

qml4dart #

Pure Dart Codec und Objektmodell für QGIS-.qml-Layer-Style-Dateien.

Liest, modelliert und schreibt QML — ohne Flutter-Abhängigkeit und ohne QGIS-Laufzeit.

Features #

  • Renderer: singleSymbol, categorizedSymbol, graduatedSymbol, RuleRenderer (inkl. verschachtelte Regeln)
  • Symbol-Layer: SimpleMarker, SimpleLine, SimpleFill, SvgMarker, RasterFill
  • Geometrietypen: Punkt (marker), Linie (line), Polygon (fill)
  • Properties: Farbe, Opacity, Linienbreite, Dash Pattern, Join/Cap, Marker-Größe, Outline, Rotation
  • Beide QML-Formate: altes <prop k v>-Format und neues <Option type="Map">-Format (QGIS >= 3.26)
  • Scale Visibility: auf Dokument- und Regel-Ebene
  • Result-Typen: ReadQmlSuccess(document, warnings) / ReadQmlFailure(message, cause)

Beispiel #

import 'package:qml4dart/qml4dart.dart';

const codec = Qml4DartCodec();

// QML-String parsen
final result = codec.parseString(qmlXmlString);
if (result case ReadQmlSuccess(:final document, :final warnings)) {
  print('Renderer: ${document.renderer.type}');
  print('Symbole: ${document.renderer.symbols.length}');
  for (final w in warnings) {
    print('Warning: $w');
  }
}

// QML-Datei lesen
final fileResult = await codec.parseFile('style.qml');

// Objekt → QML-String
final writeResult = codec.encodeString(document);
if (writeResult case WriteQmlSuccess(:final xml)) {
  print(xml);
}

// Objekt → QML-Datei
await codec.encodeFile('output.qml', document);

Abhängigkeiten #

  • xml — XML-Parsing und -Erzeugung

Lizenz #

MIT — siehe LICENSE.

0
likes
150
points
13
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Pure Dart codec and object model for QGIS QML layer style files.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

xml

More

Packages that depend on qml4dart