Skip to main content
Solved

Interpretation empty attribute Shape


ronan
Contributor
Forum|alt.badge.img+6
  • Contributor

Hello,

I use FME to generate a PostGIS table from a Shape file.

When the value of an attribute type real is set =NULL, FME displays it as =0.

I don't know if the problem is due to :

  • A bug of FME (misunderstanding of NULL attribute)
  • A problem of the input Software that generate Empty string value : It should not be possible to generate empty string with numeric attributes?

Thanks

 

 

Best answer by ebygomm

ronan wrote:

Yes it seems like it depends on the softwares. For exemple here is the result with the same input using QGISCapture I don't know why the displying of NULL attribute is different depending on the software used. The problem is I cannot control the API generating the Shapefile.

It's risky to create shapefiles with nulls as is not officially supported and as you have seen are not treated consistently across different software. Chances are a shapefile is going to go near ESRI software (or FME) at some point data is going to be interpreted incorrectly. It looks like some software have added support for nulls as it is technically possible even though not officially supported. I think it's unlikely that null support will be added in FME.

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

7 replies

daraghatsafe
Forum|alt.badge.img

Hi @ronan​ 

Have you tried the NullAttributeMapper?

Daragh

 


ronan
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • January 28, 2021

Hi, thank you.

Yes I have tried but the problem is FME reads directly NULL values as = 0. But the value of the attribute=0 can exists also. The NullAttributeMapper cannot know when the input attribute is NULL or =0. I need to know when the value of the attribute =0 or = NULL.

I cannot change the value of the attribute of the Input Shape because the shape file is generated automically from an API using functions I cannot change.

Here is an exemple. You can look at the value of epitrf using QGIS for exemple (1=0, 1 = NULL) and using FME (Both =0).


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • January 28, 2021
ronan wrote:

Hi, thank you.

Yes I have tried but the problem is FME reads directly NULL values as = 0. But the value of the attribute=0 can exists also. The NullAttributeMapper cannot know when the input attribute is NULL or =0. I need to know when the value of the attribute =0 or = NULL.

I cannot change the value of the attribute of the Input Shape because the shape file is generated automically from an API using functions I cannot change.

Here is an exemple. You can look at the value of epitrf using QGIS for exemple (1=0, 1 = NULL) and using FME (Both =0).

If I open that file in ArcMap, epitrf is displayed as zero for both records, and querying epitrf is null returns no records, FME replicates this.

CaptureI can see as you do in QGIS that one is null and one is zero.

Shapefiles cannot actually support null values, so i think this is QGIS doing something differently.

 

https://desktop.arcgis.com/en/arcmap/10.3/manage-data/shapefiles/geoprocessing-considerations-for-shapefile-output.htm

 Capture 

 


ronan
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • January 28, 2021

Yes it seems like it depends on the softwares. For exemple here is the result with the same input using QGISCapture I don't know why the displying of NULL attribute is different depending on the software used. The problem is I cannot control the API generating the Shapefile.


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • Best Answer
  • January 28, 2021
ronan wrote:

Yes it seems like it depends on the softwares. For exemple here is the result with the same input using QGISCapture I don't know why the displying of NULL attribute is different depending on the software used. The problem is I cannot control the API generating the Shapefile.

It's risky to create shapefiles with nulls as is not officially supported and as you have seen are not treated consistently across different software. Chances are a shapefile is going to go near ESRI software (or FME) at some point data is going to be interpreted incorrectly. It looks like some software have added support for nulls as it is technically possible even though not officially supported. I think it's unlikely that null support will be added in FME.


ronan
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • January 28, 2021

Thanks a lot. Your answer is what I feared : The problem is due to a lack of interpretation of other softwares. A least, I know why, and yes, it is logical that FME won't be updated to adapt to a problem caused by other softwares... Thanks a lot


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • January 28, 2021
ronan wrote:

Thanks a lot. Your answer is what I feared : The problem is due to a lack of interpretation of other softwares. A least, I know why, and yes, it is logical that FME won't be updated to adapt to a problem caused by other softwares... Thanks a lot

I don't know whether it may be possible to read the shapefiles with python and get the distinction between not set and zero for the empty attributes, it's not something I've ever had cause to explore.


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