Smart M.App discussions

Looking for answers in regards to M.Apps, M.App Exchange or M.App Studio? Smart M.App Tech Discussion board is where you can search, ask your questions and assist others by sharing your knowledge. Join the conversation, connect, contribute and share.
Showing results for 
Search instead for 
Do you mean 
Reply
Occasional Contributor
Posts: 7
Registered: ‎11-01-2020
Accepted Solution

Re: Criteria operator configuration problem

Dear @mvardovs 

 

Thank so much for your response

 

When I test the model you provided, the output image is created but it does not display as an overlay on the map. Instead the map pans to the location of the image but the image does not show.

Please, see attached Print-Screen (Recipe_test_Result.png).

 

When I create a new map and add the image from the “Content” list, before I click add the thumbnail of the output image shows that it is as expected.

Please, see attached Print-Screen (Output_thumbnail).

 

However, when I click “add” the image does no display on the map although the map pans to the correct geographic location.

When I extend the “Layers” list, the output image layer exists on the list (name: Test_10), but it does not show on the map.

Please, see the attached Print-Screen (Map_layers).

 

There is something preventing the image to draw correctly on the map. Can you please help me with this.

Thank you so much for your time

Occasional Contributor
Posts: 7
Registered: ‎11-01-2020

Criteria operator configuration problem

Hello

 

I am using "Critria" operator in a recipe on "Spatial Workshop"

 

I keep getting an image with a single value in all pixels.

 

I think the reason for that is: There is only one condition and there is no "Default" condition.

 

But, I do not know how to configure a "Default" row. When I type "Default" in a row, it disappears after clicking "OK". It does not show on the conditions list. and this empty row is causing an error: "Can not load data of type IMAGINE.ConditionList ".

 

When I click the help icon of the Criteria operator, it shows a webpage reading "Error: The document you are looking for has been moved or deleted".

 

So, I can not get to the detailed way of configuring this operator.

 

Thank you for your help.

Technical Evangelist
Posts: 156
Registered: ‎07-04-2016

Re: Criteria operator configuration problem

Dear @AhAly ,

 

How many classes do you have defined? Are they having different values specified in Class column?

 

E.g. in the below example that creates categorized NDVI map, it outputs a thematic raster with 6 classes, each has it's own number and condition defined with the range of NDVI values per class 

 

NDVI.png

 

The Default condition you've mentioned is used in background for 0 class to define the NoData areas.

 

Attaching here the model you can load to Spatial Workshop and compare to your configuration.

Kind Regards,
Marina Vardovska
Hexagon Geospatial Support
Occasional Contributor
Posts: 7
Registered: ‎11-01-2020

Re: Criteria operator configuration problem

Dear @mvardovs 

 

Thank you so much for your response.

 

In fact, I have only one class in the critria.

 

I am using this operator to define a rigion that stisfies defined conditions of (elevation, slope, aspect).

So, my expected out put is only one calss plus the (0) or (Default) class.

 

So, my conditions as in the attached image "criteria"

 

When I run the recipe like this I get a single-value image (one cless only).

 

When try to define a "Default" new line by typing "Default" or "NoData" and click "OK", the word I typed is not saved. When I open the operator properties agian, I see a blank line with no condition (like in my secound image "blank line") which causes an error when I validate the recipe.

 

Can you plaese tell me how I get around this.

 

Thank you for your time

 

Technical Evangelist
Posts: 156
Registered: ‎07-04-2016

Re: Criteria operator configuration problem

Dear @AhAly ,

 

I would expect the condition in criteria.png to be correct. You define only one class, therefore you'll get single-value image + transparent NoData area. 

 

You don't need to manually define the Default/NoData value. As I have mentioned, it is hardwired to the Criteria operator and assigns the NoData to 0 class. 

 

Since NoData can be transparent, how do you define that your image doesn't have the background (0) class? 

 

Or maybe you want the NoData to be visible (not transparent)? If this is the case, you will need to add the Opacity attribute with 1 value for both 0 and 1 rows. Attaching example model here.

Kind Regards,
Marina Vardovska
Hexagon Geospatial Support
Occasional Contributor
Posts: 7
Registered: ‎11-01-2020

Re: Criteria operator configuration problem

[ Edited ]

Dear @mvardovs 

 

Thank you for your help.

Unfortunately, I am still facing some difficulty in my output display.

In my attached recipe (Palm_Sign_rec.json), my input image is a raster DEM with pixel values ranging app. Bt. (60:3000) of Float Data type. As attached in my Print-Screen (Input_image.png).

 

The output images looks at first sight of a single value, and the General tab of Metedata reads its pixel values Min=Max=Mean=1 , and Type= Thematic, Data type = signed 32-bit.

But, further inspection of the “Pixel data” tab, reveals that there are two values (1) and (48 in red font color). So, there is a single layer with a background as shown in my Print-screen (Output_image.png).

How can I get my image to display properly?

Thank you so much for your time..

Technical Evangelist
Posts: 156
Registered: ‎07-04-2016

Re: Criteria operator configuration problem

[ Edited ]

Dear @AhAly ,

 

I am not sure I understand why you think it is displayed wrongly. You have created single class image in your Criteria, so all pixels that are true for the defined condition will be assigned to that class. Those pixels will have value of 1 (the class number you defined in Criteria), the rest of pixels that don't meet the condition will be set to NoData (in red font as you have mentioned).

 

The only what I would change there is output data type to Unsigned 1bit, since your image is having only 2 values: class 1 + NoData

 

Criteria.png

 

So technically the result you've got is expected. Could you please provide more details on what are you trying to get at the end, so maybe Criteria operator is actually not what you need?

Maybe you want to output original pixel values that meet the defined condition, not the thematic image with one class?

 

Kind Regards,
Marina Vardovska
Hexagon Geospatial Support
Occasional Contributor
Posts: 7
Registered: ‎11-01-2020

Re: Criteria operator configuration problem

Thank you for your reply

 

What I mean by display problem is that after the “Test Recipe” is executed, the image does not appear as overlay on the base map. The map zooms to the image area but the image does not appear. (like wht happens with other recipes).

 

Also, when I download the image to my PC and open it in ERDAS IMAGINE, it shows like a single color gray image (not a white class on a black background as when I built this model in Spatial Modeler).

Please, Check my attached (output_gray_image).

 

I got the correct output, but it does not display on the screen as it should.

 

What do you think I can do for the image to display correctly.

 

Thank you so much for your help

Staff
Posts: 1,132
Registered: ‎10-18-2015

Re: Criteria operator configuration problem

sorry, can you please provide more details? It is not clear what environment you are using. We are in the M.App Enterprise discussion board, but so far I've seen only screenshots from Imagine and you mention Spatial Workshop, which is a bit confusing.

The valuable help provided by Marina does apply to both platforms, but it would be better if you can clarify your use case, to further scope our responses.

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Technical Evangelist
Posts: 156
Registered: ‎07-04-2016

Re: Criteria operator configuration problem

Dear @AhAly ,

 

I would suspect the cause to be in not defined output data type, which is Unsigned 1 bit, rather than Signed 32-bit.

 

Also if you want data to be displayed in particular color, it needs to be attached to attribute table. Same with black background, if you want it to be NOT transparent you need to add Opacity attirubute with value of 1.

 

I have modified your model and attached here. Could you please check if it gives you expected output?

 

Spatial Workshop.png

Kind Regards,
Marina Vardovska
Hexagon Geospatial Support