@@ -56,10 +56,10 @@ QgsNewSpatialiteLayerDialog::QgsNewSpatialiteLayerDialog( QWidget *parent, Qt::W
56
56
restoreGeometry ( settings.value ( QStringLiteral ( " Windows/NewSpatiaLiteLayer/geometry" ) ).toByteArray () );
57
57
58
58
mGeometryTypeBox ->addItem ( tr ( " Point" ), QStringLiteral ( " POINT" ) );
59
- mGeometryTypeBox ->addItem ( tr ( " Line" ), QStringLiteral ( " LINE " ) );
59
+ mGeometryTypeBox ->addItem ( tr ( " Line" ), QStringLiteral ( " LINESTRING " ) );
60
60
mGeometryTypeBox ->addItem ( tr ( " Polygon" ), QStringLiteral ( " POLYGON" ) );
61
61
mGeometryTypeBox ->addItem ( tr ( " MultiPoint" ), QStringLiteral ( " MULTIPOINT" ) );
62
- mGeometryTypeBox ->addItem ( tr ( " MultiLine" ), QStringLiteral ( " MULTILINE " ) );
62
+ mGeometryTypeBox ->addItem ( tr ( " MultiLine" ), QStringLiteral ( " MULTILINESTRING " ) );
63
63
mGeometryTypeBox ->addItem ( tr ( " MultiPolygon" ), QStringLiteral ( " MULTIPOLYGON" ) );
64
64
65
65
mAddAttributeButton ->setIcon ( QgsApplication::getThemeIcon ( QStringLiteral ( " /mActionNewAttribute.svg" ) ) );
@@ -147,6 +147,24 @@ QString QgsNewSpatialiteLayerDialog::selectedType() const
147
147
return mGeometryTypeBox ->currentData ( Qt::UserRole ).toString ();
148
148
}
149
149
150
+ QString QgsNewSpatialiteLayerDialog::selectedZM () const
151
+ {
152
+ if ( mGeometryWithZCheckBox ->isChecked () && !mGeometryWithMCheckBox ->isChecked () )
153
+ {
154
+ return QStringLiteral ( " XYZ" );
155
+ }
156
+ else if ( !mGeometryWithZCheckBox ->isChecked () && mGeometryWithMCheckBox ->isChecked () )
157
+ {
158
+ return QStringLiteral ( " XYM" );
159
+ }
160
+ else if ( mGeometryWithZCheckBox ->isChecked () && mGeometryWithMCheckBox ->isChecked () )
161
+ {
162
+ return QStringLiteral ( " XYZM" );
163
+ }
164
+
165
+ return QStringLiteral ( " XY" );
166
+ }
167
+
150
168
void QgsNewSpatialiteLayerDialog::checkOk ()
151
169
{
152
170
bool created = !leLayerName->text ().isEmpty () &&
@@ -366,11 +384,12 @@ bool QgsNewSpatialiteLayerDialog::apply()
366
384
367
385
QgsDebugMsg ( sql ); // OK
368
386
369
- QString sqlAddGeom = QStringLiteral ( " select AddGeometryColumn(%1,%2,%3,%4,2 )" )
387
+ QString sqlAddGeom = QStringLiteral ( " select AddGeometryColumn(%1,%2,%3,%4,%5 )" )
370
388
.arg ( quotedValue ( leLayerName->text () ),
371
389
quotedValue ( leGeometryColumn->text () ) )
372
390
.arg ( mCrsId .split ( ' :' ).value ( 1 , QStringLiteral ( " 0" ) ).toInt () )
373
- .arg ( quotedValue ( selectedType () ) );
391
+ .arg ( quotedValue ( selectedType () ) )
392
+ .arg ( quotedValue ( selectedZM () ) );
374
393
QgsDebugMsg ( sqlAddGeom ); // OK
375
394
376
395
QString sqlCreateIndex = QStringLiteral ( " select CreateSpatialIndex(%1,%2)" )
0 commit comments