Skip to main content
Hey All,

 

 

So I have a pretty intense SQL function which I'm trying to conver into FME (for ease of maintenance). But I'm struggling to find a transformer which performs the same task as PostGIS' ST_Intersection.

 

 

I have a buffered road and I'm trying to overlay a road from a different datasource, and calculate the length of intersection. I've found spatial relator, but this only allows me to test whether or not there was a relationship, not the length of such a relationship.

 

 

Any help would be great.

 

 

Cheers

 

 

Hugh
Hi Hugh,

 

 

The Clipper or the LineOnAreaOverlayer might help you.

 

 

Takashi
... and see also the LengthCalculator to calculate the length of lines.
Hey Takashi,

 

 

The clipper worked a treat...cheers.

 

 

I have a second related query...I want my clippers to arrive before my clippees, but my clippees are read in to FME via an sql creator, and my clippers via a postgis reader. my clipper data is the first dataset read in, but still my sql creator and clippees are being read first. How can i delay the sql creator until after my clipper reader has finished reading its data?
Unfortunately you cannot control the processing order of the reader and the SQLCreator.

 

As a workaround, however, you can use a combination of Creator + SQLExecutor, instead of the SQLCreator.

 

If you set "yes" to the "Create At End" parameter of the Creator, it creates a feature after the reader has finished reading features. Then, the SQLExecutor works after receiving the initiator feature that was created by the Creator. 
Alternatively the FeatureHolder can also be a solution. If you insert a FeatureHolder between the SQLCreator and the Clipper's Clippee port, it will hold the clippees until all clippers arrival.

 

But it consumes memory to hold the clippee features. So I think the Creator + SQLExecotor is better, especially in the case where there are many clippees.
Hey Takashi,

 

 

The creator / sqlexecutor combination worked a treat...love it.

 

 

Really appreciate your help...fantasic tip!

Reply