-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only convert geometries to provider type when provider does strict ty…
- Loading branch information
Showing
1 changed file
with
14 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d19ed1c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jef-n Hi Jurgen, I tested the fix on 2.18.10 nightly and it seems to work fine in general. I was anyway (by pure chance) "able" to still get a case where the copy/paste operation fails with the
Errors: ERROR: 1087 feature(s) not added - geometry type is not compatible with the current layer.
message.
This happens when you copy/paste feature between layers in different projects, and does not happen if the operation is done within the same project.
I found that while triaging
https://issues.qgis.org/issues/16822
that also shows another problem: copy/pasting between table in different projects does not retains the attributes, while is ok if the operation is done within the same project.
d19ed1c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pasting to shape files?
d19ed1c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. The tables are identical copies, and there is no issue if the operation is done within the same project (both regarding the error message on save and the lost attributes).
d19ed1c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Point features?
d19ed1c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. Didn't tried with other type of geometries. I did tried anyway with 2.14.16 and the operation works fine regarding the geometries (but still does not retain the attributes).
d19ed1c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Jurgen, better open/re-open a ticket as a reminder or there is something "in the work"?
d19ed1c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit doesn't touch point features - it just cures the regression introduced with the referenced commit.
doesStrictFeatureTypeCheck
returnsfalse
only for non-point shapefiles; because OGR is - or was at the point of it's introduction - as picky about single vs. multi geomety features in the point case as other data sinks; just with line strings and polygon it copes(/d?) with both.So
convertToProviderType
still kicks in with points andconvertToProviderType
doesn't convert multi to single geometries. I guess you are trying to paste multi points to a shapefile.d19ed1c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jef-n
sorry, upon further tests the issue appears description appears to be different from what I wrote yesterday.
With 2.18.10 nightly and a specific point dataset (attached, just make a clone of it to test) the copy/paste/save operation fails even within the same qgis project/instance (don't know why yesterday it seemed to fail only when done between separate instances of QGIS).
With the same dataset the operation works in 2.14, works in 2.18.10 and then it broke in 2.18.10-nigthly and master.
I cannot replicate with other datasets, so it can be an edge case, but is indeed a regression. Will file a ticket to not forget about it.
points.zip
d19ed1c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here it goes https://issues.qgis.org/issues/16870