Spatial Modeler Discussions

Gain, exchange, and share knowledge, or discuss topics with other Hexagon Geospatial Product pioneers and experts to get the most out of Hexagon Geospatial products.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Regular Contributor
Posts: 326
Registered: ‎11-16-2015
Accepted Solution

Union not passing both geometries

Hi. Using the union operator in SM, if I pass features directly to it it works fine. However, if a do something to the features in the stream before the operator it only outputs the first features. See attached for model and data. Cheers, Johnnie.

Highlighted
Regular Contributor
Posts: 326
Registered: ‎11-16-2015

Re: Union not passing both geometries

So, looks like it's a Geometry issue (thanks Marina). The Union Features operator requires the GeometryFieldName to be defined as Geometry to work properly. See attached for solution. J

Highlighted
Technical Evangelist
Technical Evangelist
Posts: 397
Registered: ‎02-03-2016

Re: Union not passing both geometries

If the Union Features operator is hardcoded to assume/expect geometry fields named "Geometry" then that is a bug and should be submitted as a support ticket.  But what I suspect is going on, is that it simply does not match the geometry fields because they have different names.

 

Study the information in the Union Features operator help topic that begins with "Fields are matched by name (case-insensitive comparison) and data type."  Fields from two sets of features are never assumed to be the same (and therefore unionable) unless they share the same name.  The solution is to ensure that the original geometry field name (whatever it may be) is carried through by all prior operators to the point of submission to the union.

 

This can be done in at least two ways:

 

  1. You can directly control the name of the geometry field output from prior operators to retain the same name as the input geometry, rather than the default name.  This is smart to do for efficiency sake if you have no ongoing use for the original geometry and wish the new geometry to replace it anyway.
  2. You can rename the geometry field afterward via the Rename Attributes operator.

- Hal

 

Highlighted
Technical Evangelist
Posts: 149
Registered: ‎07-04-2016

Re: Union not passing both geometries

Many thanks to Hal for explaning how Union function works. For ERDAS IMAGINE users it is useful to keep in mind that geometry is just another attribute of a particular type.

 

Meanwhile, there appeared to be an issue with how Rename Attributes operator renames the geometry field names, so for now Functional Attributes can be used to automatically match the geometry field names of 2 features. Example (model attached as well):

 

union.png

Kind Regards,
Marina Vardovska
Hexagon Geospatial Support