Solved

GeoJSON output order and NULL column


Badge +4

Hello,

my first problem: Writing a GeoJSON in the right order. Simple example:

I want a output in the order A,B,C (like I set it in the writer). But the GeoJSON file is A,C,B, because the first row in B is empty.

 

Second Problem: When the B column is empty. Only A and C is written. How can I get an empty column in the writer?

Thanks for your feedback!

icon

Best answer by takashi 24 July 2019, 00:47

View original

2 replies

Userlevel 2
Badge +17

Hi @connecter, I was not able to reproduce the first issue - wrong order of attributes. What version of FME are you using? Could you share a small workspace and source dataset example which can reproduce the issue?

Regarding the second issue - missing B, try assign Null to every missing B with the NullAttributeMapper transformer before writing.

Badge +4

Hi @takashi,

thank you for your answer. Both problems are solved with the NullAttributeMapper. The first issue exists, when B have no entry and it looks like:

"properties" : {
"A" : Hans,
"C" : Berlin
}

"properties" : {
"A" : Klaus,
"B" : 25,
"C" : Paris
}

The order of the column is A,C,B. With your help, the NullAttributeMapper create a B with "null".

Maybe the GeoJSON writer get an update with this option? It that case, its makes not much sense.

Reply