Looks like you should be using the GeoJSON writer rather than the text writer. That way you can also leave out the JSONTemplater.
If needed, you should first use the GeometryReplacer to convert the WKT to an FME geometry.
Looks like you should be using the GeoJSON writer rather than the text writer. That way you can also leave out the JSONTemplater.
If needed, you should first use the GeometryReplacer to convert the WKT to an FME geometry.
thank you david . i tried using geojson writer but still i get the different output. below is the screenshot of desired output.
thank you david . i tried using geojson writer but still i get the different output. below is the screenshot of desired output.
Can you show us what you got using the GeoJSON writer?
Can you show us what you got using the GeoJSON writer?
sure . this is the output i am getting using the Geojson writer.
My input has two geometry columns as geometry 1 and geometry 2 which is a same geometry but with time stamps .
Any particular reason for storing the geometries as text attributes in addition to the regular GeoJSON geometry definition?
Also I'm not sure GeoJSON allows for multiple geometries such as this. Is there any chance that you create an aggregate geometry of geometry_1 and geometry_2 and use that instead?
Hi @gis2020, I think this workflow generates your desired result if each input feature contains a line geometry.
JSONTemplater Root Expression:
{|
fme:process-features("SUB")
|}
JSONTemplater SUB Expression:
{
"geometry"||fme:get-attribute("_count") : fme:get-json-attribute("_geometry")
}
Alternatively, this would work as well.
JSONTemplater Root Expression:
{|
for $g at $i in fme:get-json-list-attribute("_list{}._geometry")
return
{
"geometry"||$i : $g
}
|}