Skip to main content
Solved

Filter/Sample data from multiple gdb inside feature reader

  • August 31, 2023
  • 11 replies
  • 93 views

marta.podsiad
Supporter
Forum|alt.badge.img+9

Hi,

 

I have multiple gdb with feature classes. I would like to get one feature class per each gdb as a sample. The catch is that I do not want to read all data as it's massive. I would like to filter/sample it while reading something similar to SQL Creator

Best answer by nielsgerrits

Yes this is a known thing. One way to work around this is to use 2 FeatureReaders. Use the first one to read the schema only, use these as input for the second FeatureReader.

Attached sample workspace.

FeatureReaderSample(2021)

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

11 replies

nielsgerrits
VIP
Forum|alt.badge.img+62

In the FeatureReader you can set the Max Features to Read parameter to 1. I think this will result in one feature per featureclass.

 

If this results in only one feature for all featureclasses you can chain two FeatureReaders together, the first one reading the schema's, feeding it to the second one in Feature Types to Read.


marta.podsiad
Supporter
Forum|alt.badge.img+9
  • Author
  • Supporter
  • September 1, 2023

Hi, I have try to play with the Max Features number. Unfortunately, it reads the specified number of records from one feature only


nielsgerrits
VIP
Forum|alt.badge.img+62

Hi, I have try to play with the Max Features number. Unfortunately, it reads the specified number of records from one feature only

Yes this is a known thing. One way to work around this is to use 2 FeatureReaders. Use the first one to read the schema only, use these as input for the second FeatureReader.


nielsgerrits
VIP
Forum|alt.badge.img+62
  • Best Answer
  • September 1, 2023

Yes this is a known thing. One way to work around this is to use 2 FeatureReaders. Use the first one to read the schema only, use these as input for the second FeatureReader.

Attached sample workspace.

FeatureReaderSample(2021)


marta.podsiad
Supporter
Forum|alt.badge.img+9
  • Author
  • Supporter
  • September 1, 2023

Yes this is a known thing. One way to work around this is to use 2 FeatureReaders. Use the first one to read the schema only, use these as input for the second FeatureReader.

This is not going to work for me as I have 10 gdb with over 300 feature classes. Adding 300 feature classes in not really the solution


nielsgerrits
VIP
Forum|alt.badge.img+62

Yes this is a known thing. One way to work around this is to use 2 FeatureReaders. Use the first one to read the schema only, use these as input for the second FeatureReader.

Please check the sample workspace.

  • FeatureReader to find all *.gdb in directory.
  • FeatureReader to read schema's of all *.gdb in the directory.
  • FeatureReader to read every schema of all *.gdb in the directory, limited by number of features.

marta.podsiad
Supporter
Forum|alt.badge.img+9
  • Author
  • Supporter
  • September 1, 2023

Yes this is a known thing. One way to work around this is to use 2 FeatureReaders. Use the first one to read the schema only, use these as input for the second FeatureReader.

It works. Thank you very much for your help

 


nielsgerrits
VIP
Forum|alt.badge.img+62

Yes this is a known thing. One way to work around this is to use 2 FeatureReaders. Use the first one to read the schema only, use these as input for the second FeatureReader.

Cheers :)


marta.podsiad
Supporter
Forum|alt.badge.img+9
  • Author
  • Supporter
  • September 2, 2023

Yes this is a known thing. One way to work around this is to use 2 FeatureReaders. Use the first one to read the schema only, use these as input for the second FeatureReader.

I am just wondering if there is a way to get the size of each feature class in gdb

 


nielsgerrits
VIP
Forum|alt.badge.img+62

Yes this is a known thing. One way to work around this is to use 2 FeatureReaders. Use the first one to read the schema only, use these as input for the second FeatureReader.

Using a PythonCaller, arcpy and getcount you can, but nothing I know of FME only.


nielsgerrits
VIP
Forum|alt.badge.img+62

Yes this is a known thing. One way to work around this is to use 2 FeatureReaders. Use the first one to read the schema only, use these as input for the second FeatureReader.

This was harder than I expected, but I suck in Python so no surprises...

Make sure you have ArcGIS Pro installed and licensed. In the navigator under Scripting set Python Compatibility to Esri ArcGIS Python 3.6+.

Attached working sample.