Skip to content

Commit

Permalink
Fix 16888: create gpkg layer does not allow to add Z/M dimension
Browse files Browse the repository at this point in the history
  • Loading branch information
c-marcel committed Aug 23, 2017
1 parent c5371b6 commit 64df114
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
7 changes: 7 additions & 0 deletions src/gui/qgsnewgeopackagelayerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,13 @@ bool QgsNewGeoPackageLayerDialog::apply()
OGRwkbGeometryType wkbType = static_cast<OGRwkbGeometryType>
( mGeometryTypeBox->currentData( Qt::UserRole ).toInt() );

// z-coordinate & m-value.
if (mGeometryWithZCheckBox->isChecked())
{
wkbType = OGR_GT_SetZ(wkbType);
wkbType = OGR_GT_SetM(wkbType);
}

OGRSpatialReferenceH hSRS = nullptr;
// consider spatial reference system of the layer
QgsCoordinateReferenceSystem srs = mCrsSelector->crs();
Expand Down
19 changes: 13 additions & 6 deletions src/ui/qgsnewgeopackagelayerdialogbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@
<rect>
<x>0</x>
<y>0</y>
<width>530</width>
<height>635</height>
<width>514</width>
<height>644</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="4" column="0">
<item row="5" column="0">
<widget class="QCheckBox" name="mCheckBoxCreateSpatialIndex">
<property name="toolTip">
<string>Add an integer id field as the primary key for the new layer</string>
Expand All @@ -79,7 +79,7 @@
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_6"/>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>New field</string>
Expand Down Expand Up @@ -342,7 +342,7 @@
</item>
</layout>
</item>
<item row="6" column="0">
<item row="7" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Fields list</string>
Expand Down Expand Up @@ -421,13 +421,20 @@
</layout>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QgsProjectionSelectionWidget" name="mCrsSelector" native="true">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="mGeometryWithZCheckBox">
<property name="text">
<string>Geometries with Z/M coordinate</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
Expand Down

0 comments on commit 64df114

Please sign in to comment.