Skip to main content
Question

Split Json file from GeoJSON files


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

3 replies

takashi
Influencer
  • 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
takashi wrote:

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
Influencer
  • April 19, 2018
takashi wrote:

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

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