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
157 stars 66 forks source link

Issue with creating pie wedges in Shape Tools for Telecom sectors creation #50

Closed anandarupan closed 1 year ago

anandarupan commented 1 year ago

There seems to be a minor challenge in creating sectors (Telecom) using the Pie Wedge option available in Shape Tools plugin. This was working earlier. Below is the snapshot of the inputs provided for creating the same.

image

The resulting output is given below.

image

I have been trying to identify if there's a procedural error from my side for quite some days now but finally decided to approach the plugin author and get clarified.

hamiltoncj commented 1 year ago

Radius is the distance from the point in terms of the unit radius which you have set to 180 meters. Is your center azimuth and azimuth width in degrees? From your screen shots I cannot tell what you are using for those two parameters other than to know that you are using an expression of some sort. I would need to know what that expression is and what your data looks like.

anandarupan commented 1 year ago

Hi, The center azimuth and the azimuth width provided in my input sheet is just an integer value in the CSV file. Since this wasn't working, I also tried providing 2 more columns with beginning azimuth and ending azimuth (delta between the 2 is 30). I assumed that the integer would be populated as degrees format (which was the case earlier when it was working).

Expression 1 (Center Azimuth) snapshot:

image

Expression 2 (Azimuth width) snapshot:

image

Also, given below is the attribute table showing the columns that are provided in my CSV file.

image

Pls feel free to seek what kind of inputs you would require from me in this subject and I would be glad to provide the same.

hamiltoncj commented 1 year ago

As far as I can tell you are doing everything correctly. I made a csv file of just the necessary fields and tried it myself and it worked correctly. Here is a snapshot.

image

I've attached the csv file. I guess the next question is what version of qgis are you using and on what operating system? Did you import the csv file as delimited text? I am assuming you did not save it to some other format. Are you using the latest version of the Shape Tools plugin?

towers.csv

anandarupan commented 1 year ago

Thanks for the feedback. I was also quite surprised as I have worked the same way earlier and it was just fine. I was using QGIS 3.14 (Pi) at that time and still have it. I started working on it again from last 2 weeks and somehow realized that it wasn't working like before. Suspecting that it could be compatibility issue between the plugin and the QGIS version, I had the QGIS version 3.28 (Firenze) installed 2 days back and still it was the same issue (even after uninstalling & reinstalling the plugin in both versions). Shape Tools plugin version also indicates that it is at latest (3.4.9) version.

I am using a Windows 11 OS based Dell machine and was importing the CSV file as a Delimited Text file (which is what I have been doing ever since I have been using QGIS).

anandarupan commented 1 year ago

I even tried using the Beginning & End Azimuth option with separate columns added in my input CSV file for those in addition to Center Azimuth & Beamwidth.

image

Beginning Azimuth detail snapshot:

image

Ending Azimuth detail snapshot:

image

anandarupan commented 1 year ago

The resulting output is given below if I use the Beginning & Ending Azimuth options.

image

hamiltoncj commented 1 year ago

Can you try the towers.csv file that I attached above and see if you get my results or something different? I don't have Windows 11 to test. Has this worked in the past with Windows 11? Is it possible to share your csv file or at least a portion that is exhibiting this behavior? I really don't know what is wrong at this point. Could you open up your python console "Plugins->Python Console" and type in these two commands and send me the results? I've never had an issue with this so I don't think there will be a problem.

import geographiclib geographiclib.__version__

anandarupan commented 1 year ago

I tried with the CSV file that you shared with the same set of Center Azimuth & Beamwidth selections but there is no change in the output. I am still getting just like how I raised in my 1st post.

image

I will share a portion of the CSV file which I have been using with you to see if you are also getting similar issue. Then, we would be able to identify if the issue is with the input CSV file.

QGIS Sample Input.csv

anandarupan commented 1 year ago

Below is the snapshot of the commands output from the python console as you requested

image

hamiltoncj commented 1 year ago

We have something strange going on. If you use the Assistant it fails in the way you have shown, but if you just select the field from "Field type" it works. I don't know if this is a QGIS bug or whether there is a difference in using the assistant. Once selected from "Field type" and then you look at it with Assistant, I see no differences.

image

anandarupan commented 1 year ago

Thank you for the quick identification. I tried it the way you suggested, it just works like before. Pls have a look below at the output which I have been trying to get for the past 2 weeks. Thank you very much for the prompt response and resolution.

image

However, I noticed that there is a catch. After selecting the field "Azimuth" & "Beamwidth" through the "Field Type" option, if we click on Assistant (just to confirm if it is indeed the same as what we chose), the output again gets rendered the way I shared in my initial post. Ideally, we should just choose from the Field type and then execute the vector creation.

hamiltoncj commented 1 year ago

I will investigate the Assistant and see if I can figure anything out. Both methods should give the same results. I will put in a QGIS ticket if it appears to be their problem.

anandarupan commented 1 year ago

Great, thanks for the feedback. Just now, another colleague got in touch with me with the same problem and he was surprised with the immediate fix which you had suggested. I will proceed to close this ticket if that is fine with you!

hamiltoncj commented 1 year ago

Go ahead and close it.

hamiltoncj commented 1 year ago

I took a closer look at the Assistant and it validates the input and output values. For example the Output 'from' and 'to' default to 1 and 10 so any output value less than 1 is set to 1 and any value greater than 10 is set to 10. That is way it was giving the wrong results. To use the assistant for this case you would need to set the Output 'from' and 'to' to -360 and 360 or possibly just 0 and 360 if the azimuth and beamwidth are never negative.

I'm not sure what the Input 'from' and 'to' does.