Skip to main content
Question

Remove attribute columns with missing as only values

  • January 10, 2025
  • 1 reply
  • 48 views

victoriageo
Participant
Forum|alt.badge.img

Hi,

I have encountered a problem. I have built a script that reads in from several SHP files followed by multiple SpatialFilters against another SHP file (A). The aim of my script is to check which polygons from (A) intersect with any of the other SHP files. I never know how many polygons from (A) will intersect because it is regularly updated.

So, here is my problem. The result of this is a CSV and an SHP that contains the polygons that have intersected, and all the attributes from the SHP it checks against are appended. I want to remove all the attribute columns that contain only missing as values, but I have not been able to do that. The result can contain up to 25-30 different attributes! 

I have tried AttributeManager, NullAttributeMapper, and PythonCaller, but I can't make anything work.

Any suggestions would be very helpful!

1 reply

s.jager
Influencer
Forum|alt.badge.img+16
  • Influencer
  • January 10, 2025

I think I would try a Tester using Has a value, then use the  NoFeaturesTester to check if any of the 2 ports has no features coming through. Then based on that you can use the AttributeRemover.


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