Question

featureReader and spatial filter parameter

  • 28 August 2018
  • 6 replies
  • 52 views

Badge +3

The featurereader is not giving the expected result when we use the spatial filter option

as you can see the polygon ( initiator) overlap with the shapefile, but as you can see the there is no output is there any setting we need to fix

Thanks

result


6 replies

Badge

There is a possibility that the data used as the filter and the data being read do not use the same coordinate system. If not, you should first convert the coordinate system so that the coordinate systems of the two are consistent.

Badge +3

There is a possibility that the data used as the filter and the data being read do not use the same coordinate system. If not, you should first convert the coordinate system so that the coordinate systems of the two are consistent.

@taojunabc

 

 

you are right the projections are not the same, but how could we read features in a projected coordinate if we do that then there is no need to featurereader I could use only a simple reader reproject the features then perform the spatial filter, I thought we could increase performance by using the featurereader
Userlevel 4
Badge +30

Hi @boubcher

If you try to set the new projection inside the transformer FeatureReader:

Thanks,

Danilo

Badge +3

Hi @boubcher

If you try to set the new projection inside the transformer FeatureReader:

Thanks,

Danilo

@danilo_fme

 

Hello Danilo

 

in order to get an accurate result, the spatial filter should be performed on projected geometry since the feature we are reading are located in different zones, how could we resolve this?

 

 

Userlevel 4
Badge +26
@taojunabc

 

 

you are right the projections are not the same, but how could we read features in a projected coordinate if we do that then there is no need to featurereader I could use only a simple reader reproject the features then perform the spatial filter, I thought we could increase performance by using the featurereader
I would suggest reprojecting the features going into the FeatureReader. You can alway reproject back. You should still see performance gains

 

 

Badge
@taojunabc

 

 

you are right the projections are not the same, but how could we read features in a projected coordinate if we do that then there is no need to featurereader I could use only a simple reader reproject the features then perform the spatial filter, I thought we could increase performance by using the featurereader
For the situation you describe, if the data you need to read is very large, using the featurereader can indeed improve performance significantly. Because it can only read and input the part of the feature overlap, and the normal reader+spatial filter will read all the data that needs to be read. You can use @virtualcitymatt's method to convert the feature used as a filter to the coordinate system before entering the FeatureReader.

 

 

However, using FeatureReader+Spatial Filter does not definitely improve performance. Because the FeatureReader is executed for each Initiator Feature, if the amount of Initiator data is also very large, then using the Normal Reader may result in better performance. Which solution is better to use, you need to test and compare according to your actual data. However, no matter which solution you use, you must first convert the coordinate system to ensure that the coordinate systems of the two are consistent.

 

 

Also note that with FeatureReader+Spatial Filter, if a feature to be read overlaps with multiple Initiator Features, the result of the read will include multiple duplicate features.

 

 

Reply