NationalSecurityAgency / qgis-shapetools-plugin

Shape Tools creates geodesic shapes and includes a number of geodesic tools for QGIS including the XY to Line tool, geodesic densify tool, geodesic line break, geodesic measure tool, geodesic measurement layer, geodesic scale, rotate and translate tool, and digitize points at an azimuth & distance tools.
GNU General Public License v2.0
154 stars 68 forks source link

multiPart detection isn't working #8

Closed jonahsullivan closed 6 years ago

jonahsullivan commented 6 years ago

I was doing some work to improve my QGIS Plugin, based on this excellent plugin.

I noticed that the method you use to detect whether a layer is a polygon or multipolygon doesn't work.

Here is a test multipolygon that doesn't work: testMultiPoly.zip, it silently fails.

It turns out you have to determine multipart/singlepart at the feature level rather than the layer level.

Also, I found another issue where the geometry type isn't recognised when the input geometry has z-values, the layer.wkbType() returns -2147483646, which doesn't map to any of the types, but that is probably not a problem this plugin can address.

jonahsullivan commented 6 years ago

Here is a polylineZ test shapefile if you want to mess around with the issue: testPolylineZ.zip.

hamiltoncj commented 6 years ago

John,

Thanks so much for letting know about this. I will start working on a fix.

BTW I still think that our projects are similar enough that we should consider merging efforts.

hamiltoncj commented 6 years ago

Jonah,

Sorry I called you John. I just put out a new release that addresses the first issue. I am now doing the multipart/singlepart check on the feature level. It works on my features and the one you sent me. Please check to make sure it works properly.

I will look at the polylineZ to see if I can figure out what to do with it or ask the developers what to do.

Thanks!!!

hamiltoncj commented 6 years ago

Jonah,

The polylineZ will be doable, but not today. layer.wkbType() returning -2147483646 is actually proper, but I will need to treat these as a separate case as there are a complete set of additional routines that need to be called to work with them. I will see what I can do next week.

jonahsullivan commented 6 years ago

I used the new version of the plugin from the QGIS Plugin Repository and it worked like a charm.