Skip to content
Permalink
Browse files

Fix #10747 - Don't force multi type on point features

Ref #10672 - Commited fix to force multitypes on shapefiles
  • Loading branch information
NathanW2 committed Sep 28, 2014
1 parent 4de0d83 commit a8ce3565f79ec013eb91ca7c91c3a10b4eb857df
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/app/qgisapp.cpp
@@ -5965,9 +5965,10 @@ void QgisApp::editPaste( QgsMapLayer *destinationLayer )
// convert geometry to match destination layer
QGis::GeometryType destType = pasteVectorLayer->geometryType();
bool destIsMulti = QGis::isMultiType( pasteVectorLayer->wkbType() );
if ( pasteVectorLayer->storageType() == "ESRI Shapefile" )
if ( pasteVectorLayer->storageType() == "ESRI Shapefile" && destType != QGis::Point)
{
// force destination to multi if shapefile
// force destination to multi if shapefile if it's not a point file
// Should we really force anything here? Isn't it better to just transform?
destIsMulti = true;
}
if ( destType != QGis::UnknownGeometry )

5 comments on commit a8ce356

@3nids

This comment has been minimized.

Copy link
Member

@3nids 3nids replied Sep 28, 2014

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

This comment has been minimized.

Copy link
Member Author

@NathanW2 NathanW2 replied Sep 28, 2014

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

This comment has been minimized.

Copy link
Member

@3nids 3nids replied Sep 29, 2014

yes, your fix seems perfect to me.

@pcav

This comment has been minimized.

Copy link
Member

@pcav pcav replied Sep 29, 2014

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

@3nids

This comment has been minimized.

Copy link
Member

@3nids 3nids replied Sep 29, 2014

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.
You can’t perform that action at this time.