Just before your writer, insert a NoFeaturesTester. Send the OUTPUT port to the GeoJSON writer. Then send the NOINPUT feature to a Text File writer with the same name as the GeoJSON output. You may want to introduce the attribute "text_line_data" with a space first.
Thanks David, it seems like it worked out.
I might have another problem. What I want now is that when there's no attribute that pass my transformers, I want this in my GeoJSON writer :
[]
and nothing else. I don't know if it is possible tho. @david_r
Thanks for the answer.
I might have another problem. What I want now is that when there's no attribute that pass my transformers, I want this in my GeoJSON writer :
[]
and nothing else. I don't know if it is possible tho. @david_r
Thanks for the answer.
Simply set text_line_data to "o]" rather than a space.
I'll make another exemple for you. If aspvhn_traversier has attribute in his transformers, the GeoJSON writer will write : {
"type" : "FeatureCollection",
"name" : "aspvhn_traversier",
"features" : [
{
"type" : "Feature",
"geometry" : {
"type" : "Point",
"coordinates" : [ -69.726550367, 48.1395144222 ]
},
"properties" : {
"Traverse" : "Point_traversier",
"gaodoreclg" : "Baie-Sainte-Catherine/Tadoussac"
}
}
But, if aspvhn_municipalite has no attributes, I just want to have this :
[].
I don't want this :
{
"type" : "FeatureCollection",
"name" : "aspvhn_entraves",
"features" : []
}
I hope i'm being more clear. Once again, thanks David.