Skip to main content
Solved

Extract Polygons from Json file

  • 18 July 2024
  • 2 replies
  • 40 views

Hi Guys, 

I have recently using FME and would like to know if anyone can help me explain how to extract the polygons from a JSON file. I intend to create a workspace, but it does not extract what I need. Also, I have read a few similar questions about this topic but still do not have a solution. 

The file is the following one:

Also, I have attached my workspace with much of the work :(

 

If there is anyone who can help me much appreciate it.

2 replies

Badge +41

What you have is GeoJSON. Steps to parse this:

  • JSONFragmenter to split the featureNodes.
    • json["data"]["featureNodes"][*]
  • JSONExtractor to get the geometry from the featureNodes.
    • json["geometry"]
  • GeometryReplacer to replace the geometry attribute with a geometry

    • GeoJSON

  • CoordinateSystemSetter to assign coordinatesystem.

    • EPSG:4326

The trick to find the correct query in the JSON transformers is to first point to a file with the json, generate the query by selecting what you need and then change the file to the attribute.

 

Attached sample workspace.

Badge +1

Thank so much @nielsgerrits for your help and explain the process. it was what I was looking for. 

Reply