Giter Site home page Giter Site logo

Comments (16)

simgislab avatar simgislab commented on August 26, 2024

moved from https://hub.qgis.org/issues/11586

from molusce.

KolesovDmitry avatar KolesovDmitry commented on August 26, 2024

We need more information for solve the issue.

The most probable cause is the difference in the initState and the finalState: seems that the initState has 3 classes but the finalState has 4 classes. But we need the input rasters to check it.

from molusce.

virginia13 avatar virginia13 commented on August 26, 2024

Hi all,

I got the same error when I click the bottom ‘updating the table’ in the tab ‘area changes’ (before to create the changes map). (The geometries were matched):

Traceback (most recent call last):
File "C:/Users/PPP/.qgis2/python/plugins\molusce\moluscedialog.py", line 393, in updateStatisticsTableDone
self.__drawTransitionStat()
File "C:/Users/PPP/.qgis2/python/plugins\molusce\moluscedialog.py", line 1007, in __drawTransitionStat
stat = self.inputs["crosstab"].getTransitionStat()
File "C:/Users/PPP/.qgis2/python/plugins\molusce\algorithms\models\crosstabs\manager.py", line 91, in getTransitionStat
deltas = finalArea - initArea
ValueError: operands could not be broadcast together with shapes (5,) (6,)

Both files (input and output) were created with the plugin ‘interpolation’, introducing the same coordinates for the output file and the same cell size. I have tried different combinations of input-output rasters created as I described before (all with matched geometry), and with one of the combinations the table was created. Unfortunately this combination does not work for me. (I cannot find the difference between the characteristics of the files that work, and the ones that do not work...) Do you know how could I avoid the error? I can send you the rasters if you need them.

Once I got to create the table in the tab ‘area changes’, when trying to create the changes map, I got the following error:

Traceback (most recent call last):
File "C:/Users/PPP/.qgis2/python/plugins\molusce\moluscedialog.py", line 416, in createChangeMap
self.analyst = AreaAnalyst(self.inputs["initial"], self.inputs["final"])
File "C:/Users/PPP/.qgis2/python/plugins\molusce\algorithms\models\area_analysis\manager.py", line 62, in init
raise AreaAnalizerError("List of categories of the first raster doesn't contains a category of the second raster!")
AreaAnalizerError

I would be very thankful if you could help me to solve the issues

Best regards
Virginia

from molusce.

KolesovDmitry avatar KolesovDmitry commented on August 26, 2024

Hello, Virginia,
I would be grateful if you provide an examle of your rasters. Could you please attach a pair of them (initial state and final state rasters)

from molusce.

virginia13 avatar virginia13 commented on August 26, 2024

Hello KolesovDmitry,
When I try to upload them here, it says that it does not support the files, so I have sent them to your email address

from molusce.

simgislab avatar simgislab commented on August 26, 2024

use dropbox and put links here after sharing

from molusce.

KolesovDmitry avatar KolesovDmitry commented on August 26, 2024

I recieved the rasters

from molusce.

virginia13 avatar virginia13 commented on August 26, 2024

Ok, thank you very much both; this is the link of dropbox anyway

https://www.dropbox.com/sh/yg6j4mg4tn1527a/AACZqvKZcL2rFLAyZzD-rI29a?dl=0

from molusce.

KolesovDmitry avatar KolesovDmitry commented on August 26, 2024

Hello, Virginia,
I tested your rasters and find one amazing thing: the input/output rasters are float-point. Molusce was developed to handle integer rasters only (we can process discrete input values, but not continues). It is not a bug, it is the main idea of the molusce models:

  • initial/final rasters are land-use coverage types of a territory (for example 1=folest, 2=water, 3=urban, ..., in this case float-point values like "1.5" are meaningless).
  • molusce models changes in land-use types (for example forest -> urban) using a set of factors. The factors can be float type (for example, factor 'distance to road' is continues).

So I have a couple of questions for you: what are your init/final rasters? Are they really continues?

from molusce.

virginia13 avatar virginia13 commented on August 26, 2024

Hi Dmitry,

(I do not know much about Gis, not much -or anything- about programming either, so I apoligize first if I do not use the appropriate words :).

Thank you very much for your fast and precise answer.

I did not know really how the program works. I tried for example to calculate the correlations, and with the Cramer's said that the data should be converted into categorical (because of the kind test), but when calculating the Pearson's correlations did not say anything, so I thought it worked also with float -points.

The rasters are calculated interpolating the results of a survey campaign related with the perception of the environment, and now they are not continuous:
The answers of the questions were rated in a 7 points Likert's scale. (1=very bad, 4=neutral, 7=excellent). We made a vectorial layer of points, each point corresponding to the location of the interviewees. The attributes of the layer were the different questions, and physical parameters measured. And with this, the different rasters were created interpolating values.
The initial raster represented the answers to one question of the first campaign developed (interpolated), the final raster could be the mean values of the answers of the first campaign made in an specific area (with similar features for our porposes), or the answers of the same question in second campaign to evaluate the changes.

I have been thinking on how to solve it. In our case it does not matter much the specific value asigned to a cell of the raster. (It has no sense so say that in an specific point the people would probably give a rating of 6.54). The objective of the maps are to give an idea of the opinion of people (positive-high, positive-low, and so on...), and the objective of using Molusce is to study the variables that can influence the responses, and represent the 'prediction' considering this variables ...

So, I could asign the same integer values (5.63 -->6, 4.32 -->4, and so on)to the cells. Or if I want more precision or nicer visual representation, I could multiply the values of the answers before interpolating by 10, 100...( 56, 43 would be possible values...or 563,432), and convert the raster into categorical data

Do you think that it could work? Could the use for example 700 different values make the calculation process longer than the use of 7?

Thanks again
Virginia

-----Messaggio originale-----
Da: Dmitry Kolesov [mailto:[email protected]]
Inviato: ven 01/05/2015 7.50
A: nextgis/molusce
Cc: Virginia PUYANA ROMERO
Oggetto: Re: [molusce] Error with calculate area changes in QGIS v2.6 (#4)

Hello, Virginia,
I tested your rasters and find one amazing thing: the input/output rasters are float-point. Molusce was developed to handle integer rasters only (we can process discrete input values, but not continues). It is not a bug, it is the main idea of the molusce models:

  • initial/final rasters are land-use coverage types of a territory (for example 1=folest, 2=water, 3=urban, ..., in this case float-point values like "1.5" are meaningless).
  • molusce models changes in land-use types (for example forest -> urban) using a set of factors. The factors can be float type (for example, factor 'distance to road' is continues).

So I have a couple of questions for you: what are your init/final rasters? Are they really continues?


Reply to this email directly or view it on GitHub:
#4 (comment)

from molusce.

KolesovDmitry avatar KolesovDmitry commented on August 26, 2024

Next week I'll write a function for check types of initial and final state rasters. It will prevent calculation on continues rasters, but it certainly will not help you to model your data :)
As far as I see, MOLUSCE can't help you much in your work -- MOLUSCE is developed for different problems. As far as I understand your description, I would advice

  1. find the difference between the final and initial rasters
    Diff = final - init
  2. build regression Diff ~ factors.
    I'll write more about it to your email address.

from molusce.

somaiyehnasrollahzadeh avatar somaiyehnasrollahzadeh commented on August 26, 2024

Hi Dear Demitry
I have the same problem about value in Molusce plugin.
may i know how was the solution fo your problem ?

from molusce.

KolesovDmitry avatar KolesovDmitry commented on August 26, 2024

The latest version of the plug-in has code for Virginia's issue. (The issue was fixed two years ago).
So you (probably) have other cause for the error message.
Could you provide us full information about your case? (The error message, types of input rasters etc)

from molusce.

somaiyehnasrollahzadeh avatar somaiyehnasrollahzadeh commented on August 26, 2024

from molusce.

Agnes438 avatar Agnes438 commented on August 26, 2024

2020-06-24T14:33:15 1 Traceback (most recent call last):
File "C:/Users/praveen/.qgis2/python/plugins\molusce\moluscedialog.py", line 444, in updateStatisticsTableDone
self.__drawTransitionStat()
File "C:/Users/praveen/.qgis2/python/plugins\molusce\moluscedialog.py", line 1058, in __drawTransitionStat
stat = self.inputs["crosstab"].getTransitionStat()
File "C:/Users/praveen/.qgis2/python/plugins\molusce\algorithms\models\crosstabs\manager.py", line 79, in getTransitionStat
initArea = tab.getSumRows()
File "C:/Users/praveen/.qgis2/python/plugins\molusce\algorithms\models\crosstabs\model.py", line 125, in getSumRows
crosstable = self.getCrosstable()
File "C:/Users/praveen/.qgis2/python/plugins\molusce\algorithms\models\crosstabs\model.py", line 86, in getCrosstable
if self._T == None:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Hi Sir, I am getting this error msg while calculating changes. can u help me to find where I am making mistake?

from molusce.

oliviervanwarmerdam avatar oliviervanwarmerdam commented on August 26, 2024

Hola,
I do have the same error as Agnes438.

File "C:/Users/praveen/.qgis2/python/plugins\molusce\algorithms\models\crosstabs\model.py", line 125, in getSumRows
crosstable = self.getCrosstable()
File "C:/Users/praveen/.qgis2/python/plugins\molusce\algorithms\models\crosstabs\model.py", line 86, in getCrosstable
if self._T == None:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Is there a way to solve this one?
Really looking to your answer!!

Regards, Olivier

from molusce.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.