Curved geometries / Interlis with OGR & QGIS

20
QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis QGIS Anwendertreffen 2015 Curved geometries / Interlis with OGR & QGIS @PirminKalberer Sourcepole AG, Zürich www.sourcepole.ch

Transcript of Curved geometries / Interlis with OGR & QGIS

Page 1: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

QGIS Anwendertreffen 2015

Curved geometries / Interliswith OGR & QGIS

@PirminKalbererSourcepole AG, Zürichwww.sourcepole.ch

Page 2: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

Curved geometries in QGIS

Page 3: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

Curved geometries in QGIS

Page 4: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

Motivation

> Curved geometries in public data in Switzerland (Interlis format)

> ISO SQL/MM standard has other properties not supported by QGIS (z-Values, m-Values, nested types)

> Supporting those properties might motivate people to write innovative 3D plugins

> Current QgsGeometry works fine, but difficult to extend with new types

Page 5: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

ISO SQL/MM for spatial DBs

> Supported by proprietary DBs and PostGIS

> New types with circular arcs:> CircularString> CompoundCurve> CurvePolygon> MultiCurve> MultiSurface

Page 6: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

Curved geometries in OGR

> Support in OGR core library, GDAL version 2.0

> Implemented by Even Rouault and Pirmin Kalberer (Interlis driver)

> Funded by Swiss QGIS User Group

> Drivers: PostGIS, GML, GPKG, Interlis

Page 7: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

OGR/Interlis history

> OGR 1.3.0 (2005)> First Interlis support

> OGR 1.10> Last version based on IOM library (Java

interpreter needed)> Support for multiple geometries per layer

> OGR 1.11> Based on IlisMeta model> Use model info for writing> Contains bugs, fixed in 2.0

Page 8: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

GDAL/OGR 2.0

> Unified raster/vector driver model (e.g. PDF driver)

> 6 new GDAL and 5 new OGR drivers> GPKG driver with vector and raster support

> Major improvments: CSV, GPKG, GTiff, JPEG2000, MapInfo, PG, SQLite

> 64bit integer fields and FID support

> Curve geometries (PostGIS, GML, Interlis, ...)

> Current version: 2.0 rc1

> Release: June 2015

Page 9: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

Implementation goals (QGIS)

> Support circular arcs and compound geometry types (display and editing)

> Z- / M- coordinates are queriable for plugins and preserved during editing

> System should be extensible with new types (e.g. Bézier-Splines in future)

> The interface of the current QgsGeometry needs to stay for compatibility

> For now segmentation will be used for intersection/union/difference etc.

> Area and length calculated directly (no segmentation)

Page 10: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

Architecture

Page 11: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

Included in QGIS 2.10

> New geometry kernel (XYZM/Curves)

> QGSGeometry compatibility class

> Automatic conversion (GEOS, WKB/WKT/JSON)> Segmentation for geometry processing

(intersection, buffering, etc.)

> PostGIS provider

> Python bindings

> Funded by Canton of Solothurn

Page 12: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

Plans / Future

> Editing tools to create circular arcs (2.12)

> Node tool for curved geometries and Z-/M-values (2.12)

> Length and Area directly from geometry (2.12)

> Configurable segmentation settings

> OGR provider

Page 13: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

Importing curves: ogr2ogr

> http://www.gdal.org/ogr2ogr.html

Page 14: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

GDAL/OGR Interlis driver

> http://www.gdal.org/drv_ili.html

Page 15: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

Interlis plugin for QGIS

> QGIS 2.8 or 2.10 recommended

> QGIS Plugin repository

> Current version requires GDAL 2.0

> Portable QGIS Swiss Edition> QGIS 2.8 with GDAL 2.0 for Windows> www.sourcepole.ch/produkte/interlis/> Executable without setup (also from USB flash

drive)

Page 16: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

Import with model from repository

> Destination: QGIS layer or PostGIS connection

Page 17: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

Import as QGIS layer

Page 18: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

Model lookup in repository

Page 19: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

More features

> Import/Export with local IlisMeta model

> Conversion from Ili model to IlisMeta

> Creating DB schema from Interlis model

> Importing enums from Interlis model

> Configurable mapping (JSON format), e.g. for renaming columns

> Alternative import/export software: ili2pg

Page 20: Curved geometries / Interlis with OGR & QGIS

QGIS Anwendertreffen Bern 10.6.15 Curved geometries / Interlis

Curved geometries / Interlis

Thank you! - Questions?

@PirminKalberer@Sourcepole

Credits: Stefan Ziegler