bstroebl / DigitizingTools

A QGIS plugin, that subsumes different tools useful during digitizing sessions
GNU General Public License v2.0
22 stars 9 forks source link

Improve Snapping for QGIS 3 #17

Closed jumanbar closed 5 years ago

jumanbar commented 7 years ago

Hi! I'm trying to use this plugin, particularly the Extract Part tool ("Split off one part and add it as a new feature"), but it doesn't seem to do anything. I tried clicking inside a part of a polygon, making lines, and more, but nothing happens. I think the Fill gap doesn't work either.

System: Ubuntu 16.04

QGIS version               2.14.5-Essen      QGIS code branch          Release 2.14
Compiled against           Qt 4.8.7          Running against Qt        4.8.7
Compiled against GDAL/OGR  1.11.3            Running against GDAL/OGR  1.11.3
Compiled against GEOS      3.5.0-CAPI-1.9.0  Running against GEOS      3.5.0-CAPI-1.9.0 r4084
PostgreSQL Client Version  9.5.2             SpatiaLite Version        4.3.0a
QWT Version                5.2.3             PROJ.4 Version            492
QScintilla2 Version        2.9.1
bstroebl commented 7 years ago

Hi, both tools work here as expected (QGIS 2.14.7 on Ubuntu 16.04) but only if the layer and the project CRS match. So please set the project's CRS to your layer's CRS and try again. I cannot remember if that was an issue in former QGIS releases. I would be glad if you shared the results of the test.

jumanbar commented 7 years ago

It worked all right. I'll say the obvious, that the tool should warn you that the project and layer CRSs mismatch.

The same behavior occurred with the Fill gap tool.

Thanks a lot!

bstroebl commented 7 years ago

Good to know it's working. What would you expect:

jumanbar commented 7 years ago

Honestly, I would expect it to work even if the project CRS didn't match the layer's, but I understand that maybe that's not possible or very troublesome to implement. If that's not possible, I would rather have a warning after I click in the map. The disabled tool with a warning might work, but I'm not visualizing it clearly.

bstroebl commented 7 years ago

The problem comes from snapping, I think that the snap index is not projected, which probably makes sense. IMHO when digitizing project and layer CRS should match.

jumanbar commented 7 years ago

I would have the same CRS for the project as in the layer, but since I use the Open Layers plugin (with Google Satellite) as the background against which I'm digitizing, I must use EPSG:3857 (WGS84/Pseudo Mercator) or else get everything wrongly located (don't ask me why, it doesn't make sense to me, but what do I know).

Maybe I should save as all my layers with the Pseudo Mercator projection, but doing it just to match the open layers plugin doesn't seem like a sensible option.

bstroebl commented 7 years ago

I would propose to save in PseudoMercator and reproject to the destination CRS when being finished.

jumanbar commented 7 years ago

I'm considering it.

For the time being, I'm just occasionally needing the Digitizing Tools plugin, so it's not too bothersome to keep my layers as they are, and switch the project CRS once in a while, as needed.

bstroebl commented 7 years ago

can you snap to your layer with the regular tools?

jumanbar commented 7 years ago

I'm not sure about what you mean with "snap to your layer", but yes, the regular tools work fine even with CRS mismatch. That includes digitizing with snapping to vertex, segments or both, topological editing and snapping on intersection (ie: all the "Snapping and Digitizing tools").

bstroebl commented 7 years ago

That's what I meant. Probably I have to check if there are better snap methods in the api now. Will have to redo the plugin for QGIS 3 anyways.

jumanbar commented 7 years ago

Thanks for all the trouble.

bstroebl commented 5 years ago

Hi @jumanbar, could you please check if the issue is fixed in current master (QGIS 3 needed)?

jumanbar commented 5 years ago

Hi! Such a long time!

Well, this is my setting now (I'm on Windows 10 Pro). I do not work regularly with QGIS, btw, but I'm glad if I can be of help.

Versión de QGIS 3.0.0-Girona
Revisión del código de QGIS 001c80b0c3
Compilado contra Qt 5.9.2
Ejecutándose contra Qt 5.9.2
Compilado contra GDAL/OGR 2.2.3
Ejecutándose contra GDAL/OGR 2.2.3
Compilado contra GEOS 3.5.0-CAPI-1.9.0
Ejecutándose contra GEOS 3.5.0-CAPI-1.9.0 r4084
Versión del cliente PostgreSQL 9.2.4
Versión de SpatiaLite 4.3.0
Versión de QWT 6.1.3
Versión de QScintilla2 2.10.1
Versión de PROJ.4 493

I've tried some of the tools. Didn't try them all because I don't really have a ton of time available. This are my results:

Tool Layer & Project CRS mismatch Layer & Project CRS match
Split 1 part & add it as new feature* Doesn't work Works
Split features Works Works
Merge features Works Works
Exchange attributes between selected features** ? ?

: when the feature is single part, it creates a new empty* feature. Probably not a desirable behavior.

**: Didn't do anything or I didn't understand how to use it.

bstroebl commented 5 years ago

Hi @jumanbar and thanks for testing. The latest changes are not on plugins.qgis.org (i.e. not installable via manage and install plugins...) but in this github repo. You would have to check it out and install manually (copy the files to the appropriate location).

Split 1 part & add it as new feature: when the feature is single part, it creates a new empty feature.

I cannot reproduce this behaviour, could you explain?

Exchange attributes between selected features

See the wiki for an explanation

jumanbar commented 5 years ago

You would have to check it out and install manually (copy the files to the appropriate location).

I don't know how to do that. Where is that location? I tried searching inside the C:\Program Files\QGIS 3.0 folder but didn't find anything related to DigitizingTools.

bstroebl commented 5 years ago

Should be in C:\Users\, maybe in ApplicationData\QGIS\QGIS3\profiles\default\python\plugins (I have no running QGIS3 on Win currently) This assumes you are using the default user profile.

jumanbar commented 5 years ago
Tool Layer & Project CRS mismatch Layer & Project CRS match
Split multi-part feature to single part (interactive mode) Works Works
Split selected multi-part feature to single part Works Works
Split 1 part & add it as new feature* Doesn't work Works
Split features Works Works
Merge features Works Works
Exchange attributes between selected features Works Works

*: when the feature is single part, it creates a new empty feature. Probably not a desirable behavior.

Explanation of *:

When the feature is single part and I use Split 1 part & add it as new feature tool, the following happens:

I can test the remaining tools in the near future.

bstroebl commented 5 years ago

This behaviour may be not desirable but it is in line with QGIS general behaviour. Use delete part on any signle-part feature and the feature is still there but has an empty geometry.