Skip to main content
Question

Split Json file from GeoJSON files

  • April 18, 2018
  • 3 replies
  • 55 views

Forum|alt.badge.img

Hi!

I am converting GIS data to GeoJSON files. Currently the GeoJSON files are within the JSON file. Is it possible to separate the JSON file so I can see the GeoJSON files along with the JSON file. Essentially, it would look like the image attached.

Thank you for any help!

David

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
  • April 18, 2018

Hi @david_prosack88, looks like you attempt to create individual GeoJSON datasets corresponding to each feature type in the source GIS dataset. If so, I think you can directly create desired GeoJSON files using a GeoJSON writer with Fanout Dataset configuration. See here to learn more about the Fanout: Separating Output Data with Fanout

 

If you want to know a way to split an existing JSON document containing GeoJSON objects into individual GeoJSON parts anyway, please explain the structure of the JSON document specifically.


Forum|alt.badge.img

Hi @david_prosack88, looks like you attempt to create individual GeoJSON datasets corresponding to each feature type in the source GIS dataset. If so, I think you can directly create desired GeoJSON files using a GeoJSON writer with Fanout Dataset configuration. See here to learn more about the Fanout: Separating Output Data with Fanout

 

If you want to know a way to split an existing JSON document containing GeoJSON objects into individual GeoJSON parts anyway, please explain the structure of the JSON document specifically.

Thanks for the response @takashi. I've been trying to separate the GeoJSON files using the fanout dataset configuration, but I cannot get the expression to work. I tried separating by feature name, but I just get file extensions. How can I separate by extension? Such as .geojson.

 

 

Thanks,

 

David

 


takashi
Celebrity
  • April 19, 2018

Hi @david_prosack88, looks like you attempt to create individual GeoJSON datasets corresponding to each feature type in the source GIS dataset. If so, I think you can directly create desired GeoJSON files using a GeoJSON writer with Fanout Dataset configuration. See here to learn more about the Fanout: Separating Output Data with Fanout

 

If you want to know a way to split an existing JSON document containing GeoJSON objects into individual GeoJSON parts anyway, please explain the structure of the JSON document specifically.

You can set any file extension in the Fanout expression. For example, if an attribute called "fme_feature_type" stores your desired destination feature type name (i.e. file name without extension),  this Fanout expression should work as expected.

 

@Value(fme_feature_type).geojson