Hexagon Geospatial
MENU

GeoMedia

Search for an answer, post a question, or answer other users' questions in our GeoMedia support discussions. This discussion board is a great way to collaborate with industry peers around the world. It is intended for discussion and support of the GeoMedia Desktop and Add-on applications.
Showing results for 
Search instead for 
Do you mean 
Reply
Staff
Posts: 95
Registered: ‎03-01-2017
Accepted Solution

Atttibute based symbols and NULL() function

Hi everyone

 

I was working in GeoMedia 2016 v16.1with attribute based Symbols and noticed that the NULL() function is not being recognized in an IF-Syntax.

 

I'm working with a Point feature and a Font Style type for the Symbols.

If the attribute "date" is empty, then no symbol should be displayed at all. If not, then the attribute value of "date" should be displayed. 

 

The Syntax IF(date IS NULL; ''; date) works as expected.

When I use IF(date IS NULL; NULL(8); date) the default value or symbol is being displayed instead of no symbols at all. It seems like the NULL() function doesn't work for this purpose. Is this working as designed or is the NULL() function supposed to be working here as well?

 

 

The commands IF(date IS NULL; NULL; date) , IF(date IS NULL; NULL(date); date) , IF(date IS NULL; date=NULL; date) do not work neither.

 

I also encountered issues when setting the font color. I tried to use nested syntaxes

 

Thanks for any inputs

Cristina

 

Regular Contributor
Posts: 207
Registered: ‎05-25-2016

Re: Atttibute based symbols and NULL() function

Hi Cristina

 

I'm not quiet sure I understand correctly what you want to do or what you expect with your expression.

 

The expression IF(date IS NULL; NULL(8); date) is the same as 'date'.

 

If you don't want to display the symbol in the case of date IS NULL, use for the attribute based symbol option "displayable" the expression "date IS NULL" (or in a long for beginners more readable version: IF(date IS NULL; TRUE(); FALSE()) ).

 

Best regards,

hesrah

 

 

Staff
Posts: 5
Registered: ‎03-08-2016

Re: Atttibute based symbols and NULL() function

If you are trying to display the date if it is not NULL or some other attribute if the date is not NULL, then do the following.

 

For the FontSyle in the advanced tab set the Displayable property expression to: Input.MyDate=NULL(Date) where MyDate is the date field of your input feature.  Then in the CharacterString property set the expression to: FORMATATTRIBUTE(Input.MyDate) where the MyDate is the field that you want to display.

 

Staff
Posts: 95
Registered: ‎03-01-2017

Re: Atttibute based symbols and NULL() function

Thanks a lot for your replies.

 

Maybe I didn't make myself clear enough, I'm sorry. 

 

What I was trying to find out is the difference between the two expressions, as I was expecting IF(date IS NULL; NULL(8); date) to give the same result as IF(date IS NULL; ''; date).

In case of IF(date IS NULL; ''; date) no symbol at all is being displayed when date IS NULL, which is what I want.

In case of IF(date IS NULL; NULL(8); date) the Default Value is being displayed as Symbol when date IS NULL. If the condition date IS NULL is evaluated to true for a specific data point, then the function NULL(8) should return a "NULL-value". So why is the default value being displayed instead? 

Regular Contributor
Posts: 207
Registered: ‎05-25-2016

Re: Atttibute based symbols and NULL() function

NULL is not really a value in a strict sense.

So you can't say what an application is doing with this "value" in general. In theory NULL as boolean is not TRUE and not FALSE, it's UNKNOWN. So the application and/or the database server defines how it handle this.

In the case of GeoMedia symbology NULL is mapped to the default value - obviously. You have to map NULL with an expression to a "real" value, like discussed.

Frequent Contributor
Posts: 110
Registered: ‎11-10-2015

Re: Atttibute based symbols and NULL() function

Hi,

 

In the responses you have the solution of your problem. It is not possible do achieve what you want to do with only one expression, but you can combine style properties to achieve it

 

In your case :

  • You can define a "simple" expression for the text on the CharacterString property : FORMATTATTRIBUTE(Input.Date)
  • You display this text (or not) by creating an expression on the Displayable property of the font style IF(Input.Date IS NULL, FALSE(), TRUE())

Regards

Technical Evangelist
Technical Evangelist
Posts: 318
Registered: ‎02-03-2016

Re: Atttibute based symbols and NULL() function

Cristina, you have perhaps run into a side-effect of a fix introduced with 16.0, which was first described in the Impacts section of the Release Guide for 16.1 (and also in 16.2).  I'll paste that info in here.  - Hal

 

 

Boolean Expressions with Attribute-Based Symbology

When an expression is evaluated in the context of the map display system (e.g. in an attribute-based definition for a style property), and that expression yields a Boolean data type with a NULL value, then that NULL value is now returned as expected.  This is important because some Boolean style properties (e.g. Displayable) are defined as “if missing, then true”.  If the expression were to return a value of FALSE rather than NULL, then a NULL value cannot be received by the style property.

However when such an expression is evaluated in any other context (e.g. in the computation of a functional attribute), then the NULL value is converted to FALSE in order to simulate previous behaviour and minimize impact.

Techniques that may be used for accommodating the new 16.0 behavior include:

  • Use the ISNULL(value, valueIfNull) function. This returns “value” if it is not NULL, and “valueIfNull” if it is NULL.
  • Use the “value IS NULL” operator to test whether “value” is or is not NULL. This operator returns only TRUE or FALSE.
Staff
Posts: 95
Registered: ‎03-01-2017

Re: Atttibute based symbols and NULL() function

Thanks all! 

I think the best idea is indeed to set an expression for the 'displayable' option instead. 

 

And thanks for posting Release Guide Section, Hal. I wasn't aware of that fix, or side-effect of a fix Smiley Happy

 

 

 

Highlighted
Regular Contributor
Posts: 207
Registered: ‎05-25-2016

Re: Atttibute based symbols and NULL() function

Btw: It's documented in the new Release Guide 16.2 (p. 7) now: Release Guide GeoMedia 16.2

 

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.