community
cancel
Showing results for 
Search instead for 
Did you mean: 

Engine Works Blog

Under the hood of Alteryx: tips, tricks and how-to's.
Alteryx
Alteryx

The problem:
Detailed spatial files look really good when zoomed in. Zoom out far enough with a large enough file and you'll need to run for a cup while that file loads. And when zoomed out, the detail of the polygons doesn't really matter, we just can't see it. Why waste time?

 

The solution:
Use more than 1 file dependent on the zoom level. We have been doing this for some time now, and it works great. When zoomed in tight, we show the detailed (large) spatial file. When zoomed out, we load a "GENERALIZED" file. This "GENERALIZED" file has been simplified. The resulting file has less detail but is also a much smaller file and will load much faster. A file that could be, and often is, about 25% the size of the detailed file works well for this.

 

How?
Up until very recently, our processes used Autodesk SDF Loader to generalize spatial files. This worked but required me to do some scripting, not to mention that I would need to make sure Autodesk SDF Loader was up to date on my machine. When we used .sdf files, this process was clunky but got us there when nothing else really would. Well, we don't much use .sdfs anymore, and the idea of creating and dealing with .sdf files just so I can use the Autodesk tool for generalizing is pure workaround. Now, I am a fan of workarounds, but Alteryx just so happens to be able to handle this job as simple as can be.

 

That's right, Alteryx!!
The generalize tool in Alteryx is very simple and easy to configure. The methodology behind it is superior as well. For our case here, we are looking to reduce the size of the original spatial file by about 25% (roughly). Using the detailed spatial file as your input, drop a Generalize tool onto the Alteryx Module Window and hook up to the input. Configure the Generalize tool by first selecting the spatial object field from the pull down. Next is the threshold setting combined with the units setting. I use Miles for units and a threshold of .04. So, what this means is that every node on the original line will be within .04 miles of the generalized line. I also check the 'Preserve Consistency for Entire Layer'. This assures us that common borders shared between polygons remain consistent. Drop an output tool onto the Window and configure the spatial object in that tool to use the 'Generalized' spatial object. Tweaking the size of the output file is as simple as adjusting the threshold. Nice and easy. Good luck, and have fun!

Labels