Skip to main content

Custom Transformer: FeatureCrossJoiner

  • November 29, 2024
  • 5 replies
  • 65 views

bwn
Evangelist
Forum|alt.badge.img+26
  • Evangelist

One thing wish FeatureJoiner had was a CROSS JOIN / Cartesian Product mode to create every permutation of Feature Set A vs Feature Set B  (Eg.  When creating To-From Lines between every possible Origin Point and every possible Destination Point).

Custom Transfomer FeatureCrossJoiner is not anything really radical in how it gets FeatureJoiner to do this by creating a temporary dummy Cross Join attribute, but perhaps simplifies the process for some users.

https://hub.safe.com/publishers/bwn/transformers/featurecrossjoiner

 

5 replies

ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • November 29, 2024

It might be nice to adapt so that you could choose between a full cross join, i.e permutations, or combinations

 

Create a table with all possible pairings of numeric values from input table. | Community


david_r
Celebrity
  • November 29, 2024

You can use the InlineQuerier to do cross joins out of the box:

 


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • November 29, 2024
david_r wrote:

You can use the InlineQuerier to do cross joins out of the box:

 

The FeatureJoiner method gives you a few more options for handling geometries. It’s also needed if you’ve self imposed a rule of no python or inlinequeriers when doing advent of code :-)


david_r
Celebrity
  • November 29, 2024
ebygomm wrote:
david_r wrote:

You can use the InlineQuerier to do cross joins out of the box:

 

The FeatureJoiner method gives you a few more options for handling geometries. It’s also needed if you’ve self imposed a rule of no python or inlinequeriers when doing advent of code :-)

It’s difficult to argue against self-imposed restrictions ;-)


bwn
Evangelist
Forum|alt.badge.img+26
  • Author
  • Evangelist
  • November 29, 2024
david_r wrote:

You can use the InlineQuerier to do cross joins out of the box:

 

Yup, and similarly use InlineQuerier for exactly that. 😉   I get the impression though that in the Community that there is a mix of just not knowing about InlineQuerier for alternative SQL methods, or they find writing the SQL daunting, or maybe be lazy like me and just want a workspace shortcut to just quickly pop 1 x Transformer onto the workspace, connect 2 x connectors and not have to write anything else 😉

Plus as ​@ebygomm notes, FeatureJoiner has thing like automatically putting the Schema back into Bulk Mode, it can be faster in a lot of circumstances too if the upstream Features are in Bulk Mode and can Aggregate the Left/Right Geometry.  But yes, I use both for Cross Joins depending on circumstances.

Again, nothing earth-shattering:just something to be able to avoid a couple of AttributeCreators and an AttributeRemover, and an alternative to point users to with the occasional Cross Join questions that come up.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings