@@ -54,15 +54,6 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
54
54
55
55
QGis::WkbType layerWKBType = vlayer->wkbType ();
56
56
57
- // no support for adding features to 2.5D types yet
58
- if ( layerWKBType == QGis::WKBLineString25D || layerWKBType == QGis::WKBPolygon25D ||
59
- layerWKBType == QGis::WKBMultiLineString25D || layerWKBType == QGis::WKBPoint25D || layerWKBType == QGis::WKBMultiPoint25D )
60
- {
61
- QMessageBox::critical ( 0 , tr ( " 2.5D shape type not supported" ), tr ( " Adding features to 2.5D shapetypes is not supported yet" ) );
62
- stopCapturing ();
63
- return ;
64
- }
65
-
66
57
QgsVectorDataProvider* provider = vlayer->dataProvider ();
67
58
68
59
if ( !( provider->capabilities () & QgsVectorDataProvider::AddFeatures ) )
@@ -131,7 +122,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
131
122
double x = savePoint.x ();
132
123
double y = savePoint.y ();
133
124
134
- if ( layerWKBType == QGis::WKBPoint )
125
+ if ( layerWKBType == QGis::WKBPoint || layerWKBType == QGis::WKBPoint25D )
135
126
{
136
127
size = 1 + sizeof ( int ) + 2 * sizeof ( double );
137
128
wkb = new unsigned char [size];
@@ -141,7 +132,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
141
132
memcpy ( &wkb[5 ], &x, sizeof ( double ) );
142
133
memcpy ( &wkb[5 ] + sizeof ( double ), &y, sizeof ( double ) );
143
134
}
144
- else if ( layerWKBType == QGis::WKBMultiPoint )
135
+ else if ( layerWKBType == QGis::WKBMultiPoint || layerWKBType == QGis::WKBMultiPoint25D )
145
136
{
146
137
size = 2 + 3 * sizeof ( int ) + 2 * sizeof ( double );
147
138
wkb = new unsigned char [size];
@@ -268,7 +259,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
268
259
269
260
if ( mode () == CaptureLine )
270
261
{
271
- if ( layerWKBType == QGis::WKBLineString )
262
+ if ( layerWKBType == QGis::WKBLineString || layerWKBType == QGis::WKBLineString25D )
272
263
{
273
264
wkbsize = 1 + 2 * sizeof ( int ) + 2 * size () * sizeof ( double );
274
265
wkb = new unsigned char [wkbsize];
@@ -292,7 +283,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
292
283
position += sizeof ( double );
293
284
}
294
285
}
295
- else if ( layerWKBType == QGis::WKBMultiLineString )
286
+ else if ( layerWKBType == QGis::WKBMultiLineString || layerWKBType == QGis::WKBMultiLineString25D )
296
287
{
297
288
wkbsize = 1 + 2 * sizeof ( int ) + 1 + 2 * sizeof ( int ) + 2 * size () * sizeof ( double );
298
289
wkb = new unsigned char [wkbsize];
@@ -337,7 +328,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
337
328
}
338
329
else // polygon
339
330
{
340
- if ( layerWKBType == QGis::WKBPolygon )
331
+ if ( layerWKBType == QGis::WKBPolygon || layerWKBType == QGis::WKBPolygon25D )
341
332
{
342
333
wkbsize = 1 + 3 * sizeof ( int ) + 2 * ( size () + 1 ) * sizeof ( double );
343
334
wkb = new unsigned char [wkbsize];
@@ -374,7 +365,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
374
365
375
366
memcpy ( &wkb[position], &y, sizeof ( double ) );
376
367
}
377
- else if ( layerWKBType == QGis::WKBMultiPolygon )
368
+ else if ( layerWKBType == QGis::WKBMultiPolygon || layerWKBType == QGis::WKBMultiPolygon25D )
378
369
{
379
370
wkbsize = 2 + 5 * sizeof ( int ) + 2 * ( size () + 1 ) * sizeof ( double );
380
371
wkb = new unsigned char [wkbsize];
0 commit comments