Skip to content

Commit a8ce356

Browse files
committedSep 28, 2014
Fix #10747 - Don't force multi type on point features
Ref #10672 - Commited fix to force multitypes on shapefiles
1 parent 4de0d83 commit a8ce356

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5965,9 +5965,10 @@ void QgisApp::editPaste( QgsMapLayer *destinationLayer )
59655965
// convert geometry to match destination layer
59665966
QGis::GeometryType destType = pasteVectorLayer->geometryType();
59675967
bool destIsMulti = QGis::isMultiType( pasteVectorLayer->wkbType() );
5968-
if ( pasteVectorLayer->storageType() == "ESRI Shapefile" )
5968+
if ( pasteVectorLayer->storageType() == "ESRI Shapefile" && destType != QGis::Point)
59695969
{
5970-
// force destination to multi if shapefile
5970+
// force destination to multi if shapefile if it's not a point file
5971+
// Should we really force anything here? Isn't it better to just transform?
59715972
destIsMulti = true;
59725973
}
59735974
if ( destType != QGis::UnknownGeometry )

5 commit comments

Comments
 (5)

3nids commented on Sep 28, 2014

@3nids
Member

The problem is that you never know with shapefiles if they are multi or not, hence the idea of forcing multi.
Or do you have another idea how to handle this?

(backport to 2.4?)

NathanW2 commented on Sep 28, 2014

@NathanW2
MemberAuthor

So destIsMulti is not right with shapefiles?

Forcing multi-type break copy and paste for point files so I don't think we should force it here.

3nids commented on Sep 29, 2014

@3nids
Member

yes, your fix seems perfect to me.

pcav commented on Sep 29, 2014

@pcav
Member

IMHO the default shouold be POINT, not MULTIPOINT, used only in very specialized cases. Multipoints are really a PITA, almost always.

3nids commented on Sep 29, 2014

@3nids
Member

for any other sources than shapefiles, it is based on the layer definition. If layer is single, transformation is to single.
But for shapefiles, the multi-type is undefined, hence we need to force the conversion to multi. This does not cause any trouble since there is no distinction between single- and multi-line/polygon in the format. But, apparently, this is not the case for points. This commit is fixing the case for the points.

Please sign in to comment.