gustavowillam / SmartMapPlugin

Plugin Qgis3.10.x para interpolação utilizando Krigagem Ordinária (OK), Machine Learning (ML) e Geração de Zonas de Manejo
https://github.com/gustavowillam/SmartMapPlugin
GNU General Public License v3.0
52 stars 13 forks source link

ValueError: range() arg 3 must not be zero #3

Closed augustbjerkenLTH closed 3 years ago

augustbjerkenLTH commented 3 years ago

Hi,

First and foremost, thanks for a fantastic plugin. SmartMap is by far one of the better experimental plugins I've come across and I'm especially loving the fact that the model can be adjusted to accommodate both linear and exponential projections.

One question that has emerged though is how to handle NULL values when working with the plugin? I've lately been working on some long precipitation datasets, where occasionally some stations lack a given value. This creates a problem as I keep getting the following error message when importing the layer: "ValueError: range() arg 3 must not be zero".

While the plugin is clearly identifying the missing values, I don't know to approach this? Is the something obvious that I'm not seeing?

Kind regards August Bjerkén

BurgerPJ commented 3 years ago

Hi. Thank you for the plugin. I am very excited about using Kriging in QGIS. I receive the same error when I import data to the model, "ValueError: range() arg 3 must not be zero". I tried different datasets from various sources and even created a new point-vector SHP file. Please help on the issue. Smart-Map Plugin Version 1.0.0 / QGIS version 3.18.3 Installed as instructed: "Interpolate points to rasters with kriging in QGIS using the Smart-Map plugin" (https://www.youtube.com/watch?v=-Vv1cAhiSVk)

GeoJMac commented 3 years ago

Same problem with error message. After import, other tabs grayed out

allanerlikhman commented 3 years ago

Olá, parabéns pelo plugin. Estou com o mesmo erro.

Um erro ocorreu enquanto executava o código Python: ValueError: range() arg 3 must not be zero

Instalei de acordo com as instruções do manual.

Obrigado

gustavowillam commented 3 years ago

Usually, this error occurs because the layers imported in the plugin have the coordinates in lat/long. Make sure the files imported by Smart-Map have the coordinates in the UTM projection.

felippehsk commented 3 years ago

Hi @gustavowillam,

Saudacoes brasileiras!

I am currently in Canada and everywhere I go I preach about this mazing plugin you all put together. Nice work! Just to continue this discussion. A few people, including myself, experienced this error even when all the coordinates are in UTM projection. The error does not happen during the data Import, but when defining the "Outline Polygon".

Find HERE the data that should allow you to reproduce the error. Do not worry about the data density, the person that reported the error was actually interested on the Management Zones rather then the actual interpolation, but the plugin do not allow you to run the classification without interpolating the data first.

According to the analysis I performed, the error is seems to happen because the difference between X max and X min is very low. So when you run the code to calculate the number o cells, python throws this error. In my opinion, using a buffer for the bounding box should solve this issue (adding a buffer to the bounding box with or without using the Outline Polygon would be beneficial since there are a few fields which the results from the interpolation are a bit smaller than the field boundary itself).

Thank you in advance! I hope this helps to improve the plugin!

Abraco!

gustavowillam commented 3 years ago

Hi @felippehsk,

Thank you very much for your contributions. I used your data to reproduce the error and the problem was exactly what you reported. The issue of not using the data in the UTM projection system also generates the same error. Now the plugin only accepts coordinates in UTM. I have released an update which can be found in the QGIS repository (https://plugins.qgis.org/plugins/Smart_Map/) or on GitHub (https://github.com/gustavowillam/SmartMapPlugin/releases/download/v1. 1/Smart_Map.zip) for plugin version 1.1 to fix the problem. I hope this update can resolve the issue. Abraços!

felippehsk commented 3 years ago

@gustavowillam, thank you for looking into this!

It is a pleasure to help with the development of such a great plugin! I will test it out and let you know if this solves the issue!

Abracos!