Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Handling polygon GeoJSON files in Alteryx

shaunkhoo
6 - Meteoroid

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/Downloading-and-working-with-GeoJSON/m...

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Using-geojson-with-Input-Tool/m-p/4389...

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!

16 REPLIES 16
shaunkhoo
6 - Meteoroid

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. 

shaunkhoo
6 - Meteoroid

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. 

TravisR
Alteryx Alumni (Retired)

@shaunkhoo I was actually working on preserving the attributes and got that part working too

shaunkhoo
6 - Meteoroid

That's awesome! Thanks @TravisR! Accepted as solution so that others can see this workflow too

johnfischbeck
7 - Meteor

Glad to help.

johnfischbeck
7 - Meteor

That would be a great routine.  Please share if you write it. 

svanhauwaert
5 - Atom

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]]]}

Labels