Skip to main content
Best Answer

Dynamic Schema - Small Integers Converted to Boolean Values

  • March 19, 2019
  • 3 replies
  • 72 views

Forum|alt.badge.img

Hi,

I am reading SHP files and writing them out into a file geodatabase, using Dynamic Schema Definition.

All the features are being dropped. It seems that one SHP attribute "FAST_TRACK" (Small Integer - 0 for all features) is being read by FME as Boolean value (string: false):

 

WARN |FileGDB Writer: The `Fast_Track' attribute could not be written. The containing feature has been dropped

2019-03-19 09:58:31| 1.3| 0.0|WARN |Attribute(string) : `Fast_Track' has value `false'

 

Can you please advise how to force FME not to read the zero value as false?

 

Thanks, Monika

Best answer by takashi

The logical type in Shapefile (originally from DBF) format is not a numeric type, it represents logical true or false.

On the other hand, File Geodatabase format doesn't support logical type, and ArcGIS treats logical type as Short Integer type.

In FME, the Shapefile reader maps a value from logical type in Shapefile to 'fme_boolean' ('true' or 'false'), and Esri Geodatabase (File Geodb) [GEODATABASE_FILE] writer maps 'fme_boolean' to Short Integer in File Geodatabase format ('true' -> non-0, 'false' -> 0). I think the [GEODATABASE_FILE] writer could convert a logical value to a numeric value automatically.

However, in my observation, Esri Geodatabase (File Geodb Open API) [FILEGDB] writer doesn't seem to map 'fme_boolean' to Short Integer as expected. I suppose that you are using [FILEGDB] writer.

A workaround is to change the writer from [FILEGDB] to [GEODATABASE_FILE] if possible.

Or, if you have to use [FILEGDB] writer anyway, convert the logical attribute value to numeric ('true' -> non-0, 'false' -> 0) with the AttributeValueMapper before writing.

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.

3 replies

takashi
Celebrity
  • March 19, 2019

I don't think FME converts the value read from a numeric type field in a Shapefile dataset to a string value 'false'. What data type is shown for the 'Fast_Track' field in the Shapefile reader feature type?


takashi
Celebrity
  • Best Answer
  • March 19, 2019

The logical type in Shapefile (originally from DBF) format is not a numeric type, it represents logical true or false.

On the other hand, File Geodatabase format doesn't support logical type, and ArcGIS treats logical type as Short Integer type.

In FME, the Shapefile reader maps a value from logical type in Shapefile to 'fme_boolean' ('true' or 'false'), and Esri Geodatabase (File Geodb) [GEODATABASE_FILE] writer maps 'fme_boolean' to Short Integer in File Geodatabase format ('true' -> non-0, 'false' -> 0). I think the [GEODATABASE_FILE] writer could convert a logical value to a numeric value automatically.

However, in my observation, Esri Geodatabase (File Geodb Open API) [FILEGDB] writer doesn't seem to map 'fme_boolean' to Short Integer as expected. I suppose that you are using [FILEGDB] writer.

A workaround is to change the writer from [FILEGDB] to [GEODATABASE_FILE] if possible.

Or, if you have to use [FILEGDB] writer anyway, convert the logical attribute value to numeric ('true' -> non-0, 'false' -> 0) with the AttributeValueMapper before writing.


Forum|alt.badge.img
  • Author
  • March 20, 2019

The logical type in Shapefile (originally from DBF) format is not a numeric type, it represents logical true or false.

On the other hand, File Geodatabase format doesn't support logical type, and ArcGIS treats logical type as Short Integer type.

In FME, the Shapefile reader maps a value from logical type in Shapefile to 'fme_boolean' ('true' or 'false'), and Esri Geodatabase (File Geodb) [GEODATABASE_FILE] writer maps 'fme_boolean' to Short Integer in File Geodatabase format ('true' -> non-0, 'false' -> 0). I think the [GEODATABASE_FILE] writer could convert a logical value to a numeric value automatically.

However, in my observation, Esri Geodatabase (File Geodb Open API) [FILEGDB] writer doesn't seem to map 'fme_boolean' to Short Integer as expected. I suppose that you are using [FILEGDB] writer.

A workaround is to change the writer from [FILEGDB] to [GEODATABASE_FILE] if possible.

Or, if you have to use [FILEGDB] writer anyway, convert the logical attribute value to numeric ('true' -> non-0, 'false' -> 0) with the AttributeValueMapper before writing.

Hi @takashi

thanks a lot, changing the writer from open FGDB to GEODATABASE worked.

Much appreciated.

Monika