Skip to main content
Question

Building nested GEOJson

  • March 28, 2018
  • 3 replies
  • 25 views

Forum|alt.badge.img

Hello,

I am starting using FME Workbench and it's amazing!

A quick question as I can't manage to achieve what I would like.

Basically I am starting with 2 features, Airports and Runaways. I have a OneToMany relations between those 2 features.

What I would like to do is in that my final GEOJson looks like bellow, meaning that the list of my runaways with their properties + geometry if needed are nested into the Airport feature.

I managed well using InlineQuerier to have the data I need and execute the join I need the thing I don't know is what is the flow to build properly the GEOJson as I want.

 

{
"type" : "FeatureCollection",
"name" : "Airports",
"features" : [
{
"type" : "Feature",
"geometry" : null,
"properties" : {
"someAirportProperty" : "someAirportValue",
"runaways": [
{
"someRunawayProperty": "someRunawayValue"
}
]
}
},
]
}
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
  • 7843 replies
  • March 28, 2018

Hi @jacquint, the JSONTemplater might help you. To make a template expression, requires to know what attributes the input features have.

[Addition] If you want to get a more specific answer, clarify the structure of attributes in the input features corresponding to desired GeoJSON schema you have posted, using tables like this example.

Attributes of Airport Feature (example)

Attribute NameAttribute Value (exmaple)NoteairportId1unique IDsomeAirportPropertysomeAirportValue Attributes of Runway Feature (example)Attribute NameAttribute Value (example)NoteairportId1specify an airport which this runway belongs tosomeRunwayPropertysomeRunwayValue

 


Forum|alt.badge.img
  • Author
  • 14 replies
  • March 29, 2018

Hi @takashi !

Thank you very much for your answer!

I am gonna dig into the JSONTemplater component and let you know.

Best regards,

Thomas.


Forum|alt.badge.img
  • Author
  • 14 replies
  • March 29, 2018

Hi @takashi !

I finally managed to achieve what I wanted! This tool is just amazing!

I used JSONTemplater + sub template + fme:process-features and IDs of relation between my 2 features.

I will probably come back with other questions as much as I will dig into the tool but from now we can consider this question solved!

Thank you again.