Hi,
I've just started working with GeoJSON files, and I've been finding it very inconvenient to handle on Alteryx. I've gone through the following articles, but the general advice seems to be "just import it as a JSON and parse it", which isn't helpful if you're dealing with polygons rather than points.
https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Alteryx-and-geojson/td-p/39265
https://community.alteryx.com/t5/Engine-Works-Blog/Alteryx-Spatial-Data-Output-GeoJSON/ba-p/2221
Can I know if there's anything currently in Alteryx or in the development pipeline to make this process easier? For example, the sf package in R reads in the GeoJSON file into a dataframe format with the spatial attributes in a geometry column (basically parsing it automatically for you). Something similar could be implemented in Alteryx. Until then, I will have to stick to R for any spatial analytics work involving polygons.
Thanks!
Solved! Go to Solution.
Hi @johnfischbeck, thanks for your help! I think this is a great workflow for processing GeoJSON files, especially since it retains the data on the polygon's properties as well. If I have a bit of time, I may write up a macro that automatically handles the processing of the properties as well so we don't have to hardcode it to specific variables.
Hi @TravisR, thanks for your help too! I think this was actually fairly elegant (and probably the best we can do with native Alteryx tools), although I noticed it didn't preserve the other properties in the GeoJSON file. Hopefully I'll get the time to write up a macro to do that automatically some time in the future.
@shaunkhoo I was actually working on preserving the attributes and got that part working too
That's awesome! Thanks @TravisR! Accepted as solution so that others can see this workflow too
Glad to help.
That would be a great routine. Please share if you write it.
Hey Stephen, happend to have to convert a geoJSON string and changing the datatype to SpatialObj in a select tool as you described worked right away. Below was a sample string / geoJSON. Hope all is well with you!
{"type":"MultiLineString","coordinates":[[[-93.2623169324206,44.974017554049],[-93.261878,44.973826]]]}