Skip to main content
Solved

how to create multiple geometries fron one json file

  • March 21, 2018
  • 4 replies
  • 81 views

f.kemminje
Contributor
Forum|alt.badge.img+11

Hi Team,

In my case, there are multiple geometries coordinates in one json file. I need to create multiple geometries and write to shp file. Sample json file attached.

in this file there are multiple geometry blocks, I should iterate thru json and create geometris.

help will be appreciated

Best answer by takashi

Hi @fkemminje, the "JSONResult" object in the document is basically conforming to GeoJSON feature collection format, but each feature object doesn't have "type" member (value is "Feature") unfortunately.

If you insert "type" member to every feature, you can ten convert them to individual features having geometry and attributes with the JSONFragmenter.

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.

4 replies

lars_de_vries
Forum|alt.badge.img+10

I created an FME workspace that reads your file. See attachment.

 

I read the text-file with a Text File Reader and the parameter 'Read Whole File at Once' set to 'Yes'. Next I used a JSONFragmenter to get the separate features. Finally I used a GeometryReplacer to create the geometries.

I created the workspace with the version 2017.1.2.1

read-geojson.fmw


takashi
Celebrity
  • Best Answer
  • March 21, 2018

Hi @fkemminje, the "JSONResult" object in the document is basically conforming to GeoJSON feature collection format, but each feature object doesn't have "type" member (value is "Feature") unfortunately.

If you insert "type" member to every feature, you can ten convert them to individual features having geometry and attributes with the JSONFragmenter.


f.kemminje
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • March 22, 2018

@takashi

@lars_de_vries

thank you


lars_de_vries
Forum|alt.badge.img+10

@takashi

@lars_de_vries

thank you

you're welcome!