Skip to main content
Solved

How to get data type of fields/attributes in a shp file

  • October 22, 2020
  • 3 replies
  • 279 views

Looking to drop a shp file into workspace and extract the data type of each field. e.g. Address.shp may have fields StreetName (text) and StreetNumber (int). I would like to be able to extract the type for each field:

StreetName - fme_char(254)

StreetNumber - fme_int32

 

I understand that FME maps the Data Types from different files based on the reader being used to an equivalent FME Data Type https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/!FeatureTypeProperties/attribute_types.htm

Best answer by ebygomm

Another option is to use FeatureReader to read the shapefile and choose to read Schema features only. The schema is returned as a list, so you would need a list exploder to break each list element into multiple features.

View original
Did this help you find an answer to your question?

3 replies

oscard
Influencer
Forum|alt.badge.img+21
  • Influencer
  • October 22, 2020

There is a Reader called Schema. I think it would give you the info you are looking for.


ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • Best Answer
  • October 22, 2020

Another option is to use FeatureReader to read the shapefile and choose to read Schema features only. The schema is returned as a list, so you would need a list exploder to break each list element into multiple features.


  • Author
  • October 22, 2020
ebygomm wrote:

Another option is to use FeatureReader to read the shapefile and choose to read Schema features only. The schema is returned as a list, so you would need a list exploder to break each list element into multiple features.

I think this way works the best for my use, as I can just drop in one shape file and specify a user parameter in the FeatureReader transformer to extract the schema from it.


Reply


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