Question

Spatial Filter: Rejecting candidates where filter is polygon, candidate is raster

  • 11 September 2015
  • 8 replies
  • 5 views

Hi all.

 

 

I'm running into a few troubles with my workbench.

 

 

I'm using a SpatialFilter to group ESRI Ascii grid files by the zone they fall under before mosaicing them.

 

 

However, when I run the workspace, all the Ascii files exit the spatial filter through the rejected port.

 

 

The projections of both data sources are the same and the rasters do interesect the polygon filter dataset.

 

 

Running FME 2015.1.1.0 64bit

 

 

Any advice would be greatly appreciated.

 

 

Thanks.

8 replies

Userlevel 4
Hi

 

 

Could it be a case of conflicting coordinate systems? Be sure that all features that enter the SpatialFilter have the exact same coordinate system definitions, or you might get unexpected results.

 

 

If that's not the case, as a workaround you could send the rasters through a BoundingBoxReplacer before the SpatialFilter. You can then merge the bounding boxes back with the rasters on their primary key (or use the value from a Counter) in a FeatureMerger.

 

 

David

 

 
Hi David, 

 

 

They were both set to the same and correct coordinate system. I ran it with the BoundingBoxReplacer and the SpatialFilter worked correctly then.

 

 

Have you ran into this before? Wondering if this is worth reporting to Safe Software as a bug.

 

 

Thanks
Userlevel 4
Hi

 

 

I'd report it, just in case. It will help them a lot if you can also send them a minimalist workspace (with some small sample data) that enables them to reproduce the issue.

 

 

David

Hi All, i had the same issue upgrading the SpatialFilter from a 2014 to 2016.1 version.

Use the option in the transformer Use Bounding Box, and set it to For Candidates only in my case and the filter worked again.

Badge +11

Thank you very much for reporting this issue, and I am glad to see some great discussion / feedback from the FME Community!

The SpatialFilter transformer does not accept features with raster geometry (i.e. fme_raster). The documentation was updated with the release of 2016.0 to indicate only point, line, area, and text features will be accepted as Candidates or Filters. The current workaround as indicated in this thread, is to either set the 'Use Bounding Box' parameter to "Yes", or to convert the feature to an accepted geometry before passing through this transformer (e.g. using the BoundingBoxReplacer).

Also new for FME 2016.0, the fme_rejection_code attribute is added to features output through the <Rejected> port. In this scenario where the raster is the Candidate feature, it is output with "INVALID_CANDIDATE_GEOMETRY_TYPE" as the fme_rejection_code value.

Please see this simple workspace template to highlight the incompatibility of rasters, and use of the 'Use Bounding Box' parameter: https://www.dropbox.com/s/bxz81w2urv9m569/geotiff2none.fmwt?dl=0

*Edit: After further investigation and testing with FME 2014 SP5 and FME 2015.0, raster features used to be accepted as Candidates. This behaviour was changed with the addition of the <Rejected> port in FME 2015.1 and newer. I will create a ticket with our development team to determine if this is expected, or if a bug was introduced.

 

Kind regards,

 

Rylan
Badge +11

Thank you very much for reporting this issue, and I am glad to see some great discussion / feedback from the FME Community!

The SpatialFilter transformer does not accept features with raster geometry (i.e. fme_raster). The documentation was updated with the release of 2016.0 to indicate only point, line, area, and text features will be accepted as Candidates or Filters. The current workaround as indicated in this thread, is to either set the 'Use Bounding Box' parameter to "Yes", or to convert the feature to an accepted geometry before passing through this transformer (e.g. using the BoundingBoxReplacer).

Also new for FME 2016.0, the fme_rejection_code attribute is added to features output through the <Rejected> port. In this scenario where the raster is the Candidate feature, it is output with "INVALID_CANDIDATE_GEOMETRY_TYPE" as the fme_rejection_code value.

Please see this simple workspace template to highlight the incompatibility of rasters, and use of the 'Use Bounding Box' parameter: https://www.dropbox.com/s/bxz81w2urv9m569/geotiff2none.fmwt?dl=0

*Edit: After further investigation and testing with FME 2014 SP5 and FME 2015.0, raster features used to be accepted as Candidates. This behaviour was changed with the addition of the <Rejected> port in FME 2015.1 and newer. I will create a ticket with our development team to determine if this is expected, or if a bug was introduced.

 

Kind regards,

 

Rylan
The behaviour of the SpatialFilter transformer has been reverted to accept raster features as 'Candidates'. Please test this out in FME 2017.0 Beta Build 17130 or newer -- available from our Downloads page!

 

 

Badge +10

I'm not sure why BoundingBox = Yes did not work for me but my features are from DGN. I used an attribute filter for features that fme_geometry=undefined and that worked for me. Now I have to validate how important these features are in my translation.

Badge +10

@mattenvsys

My two cents: whenever I work with filtering or clipping datasets (whether they are raster or vector), I make sure that they are opened up in FME Data Inspector together (using Add Dataset) to rule out any projection/coordinate system issues.

Reply