Skip to main content
Question

Building nested GEOJson


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"
					}
				]
			}
		},
	]
}

3 replies

takashi
Influencer
  • 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
  • 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
  • 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.


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