Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 33

Spatial Object Manipulation

Recommended resources

Hello! Welcome to your fifth lesson in the Spatial Data Fundamentals module.

In our previous lessons, we've learned how to transform latitude and longitude data into spatial point objects using the Create Points tool and how to visualize these objects effectively on a map with the Browse tool.

Today, we move from creating and viewing spatial data to actively manipulating it. This is where spatial analysis truly begins, as we start to answer business questions by creating new spatial relationships and objects from our existing data.

Learning Outcome: Manipulate spatial objects using tools like Buffer, Create Points, and Find Nearest.

By the end of this 60-minute lesson, you will be able to use this trio of tools to find proximate objects, create zones of influence, and build foundational spatial workflows.

1. The Building Blocks: Create Points and Find Nearest

Nearly every spatial analysis starts with spatial objects. As we've covered, the Create Points tool is your go-to for this when you have coordinate data.

Once you have points, a common task is to find which ones are closest to each other. For example: "Which 3 warehouses are closest to this store?" or "Find the nearest competitor to each of our locations." The Find Nearest tool is designed specifically for this purpose.

It works by taking two inputs:

  • T (Target): The object or objects you are starting from (e.g., your new store location).
  • U (Universe): The set of all possible objects you want to search within (e.g., all competitor locations).

Let's explore how this works with a practical example.

Alteryx Spatial Tools - Part 1 - Create Point & Find Nearest

This article from The Data School demonstrates how to use Create Points and then feed the result into the Find Nearest tool. It provides a clear, simple scenario to follow.

First, quickly review the section on the 'Create Point' tool to refresh your memory. Then, read the second half of the article, starting from the heading 'Find Nearest'. Focus on understanding the Target (T) and Universe (U) inputs, the main configuration options, and the new fields created in the output (FindNearestRank, DistanceKiometers, Direction).

As the article shows, the Find Nearest tool appends new fields to your target data, enriching it with information about the nearest objects from the universe, including the distance to them, their direction, and their rank (1st nearest, 2nd nearest, etc.).


2. Fine-Tuning Your Search with Find Nearest

The Find Nearest tool has several important configuration options that give you precise control over your analysis. These allow you to specify how many "nearest" objects to find and how far you're willing to look.

To explore these options in more detail, let's look at another resource.

Alteryx : Find Nearest Tool

This second article provides a closer look at the configuration window of the Find Nearest tool, including options that are critical for real-world scenarios, like using drive time.

Please read the section that begins 'In the Configuration Window you will see...'. Pay close attention to the explanations for 'How many nearest points to find?', 'Maximum Distance' (note the options for drive time and distance), and the 'Ignore 0 Distance matches' checkbox.

The ability to set a maximum search distance is crucial for performance and relevance. If you're looking for nearby coffee shops, you likely don't need to search the entire country. Furthermore, using drive time instead of straight-line distance can provide a much more realistic analysis for logistical planning.


3. Creating Areas with the Buffer Tool

Another fundamental way to manipulate a spatial object is to create a Buffer around it. A buffer is a zone or region that covers a given distance from a point, line, or polygon. Think of it as drawing a service area, a notification zone, or a trade area on a map.

For example, you could use the Buffer tool to:

  • Create a 2-mile radius around a store to see which customers fall within its delivery zone.
  • Generate a 500-foot zone around a pipeline to identify properties that might be affected by maintenance work.
  • Visualize a 1-km walkability radius around a new subway station.

The configuration for the Buffer tool is straightforward.

Alteryx Buffer Tool Configuration Panel
The configuration panel for the Alteryx Buffer tool. You select the spatial object field, then define the size of the buffer either as a specific value (e.g., 1 mile) or dynamically using a value from another field in your data.

As you can see in the BufferConfiguration image, you have a few key choices:

  • Spatial Field: Select the column containing the spatial object you want to buffer.
  • BufferSize: You can enter a Specific Value (e.g., 1 mile) that applies to all records, or you can use a value From Field, which allows you to create different-sized buffers for each record based on your data.
  • Units: You can specify the distance in Miles, Kilometers, Meters, or Feet.

The output of the Buffer tool is a new spatial object field containing a polygon.


4. Hands-On Practice

Let's combine these three tools to solve a simple business problem.

Scenario: A company is opening a new office in Chicago. They want to identify the two existing company locations that are closest to the new office and also visualize a 1.5-mile "local lunch" radius around the new office.

  1. Start a new workflow in Alteryx.
  2. Use a Text Input tool to create the existing office locations. Configure it with the following data:
Location Latitude Longitude
West Loop 41.8853 -87.6442
River North 41.8925 -87.6322
Lincoln Park 41.9160 -87.6489
The Loop 41.8789 -87.6262
  1. Use a second Text Input tool for the new office:
Location Latitude Longitude
New Office 41.8950 -87.6592
  1. Create Spatial Points:

    • Add a Create Points tool connected to your existing offices. Configure Longitude as the X Field and Latitude as the Y Field.
    • Add a second Create Points tool connected to your new office data and configure it the same way.
  2. Find the Nearest Locations:

    • Add a Find Nearest tool.
    • Connect the output of the "New Office" Create Points tool to the T (Target) input.
    • Connect the output of the "Existing Offices" Create Points tool to the U (Universe) input.
    • Configure the tool to find the 2 nearest points. Leave the maximum distance unlimited for now.
    • Add a Browse tool to the output of the Find Nearest tool to see the results.
  3. Create the Buffer Zone:

    • Add a Buffer tool connected to the output of the "New Office" Create Points tool.
    • In the configuration, set a Specific Value of 1.5 and select Miles as the units.
  4. Visualize Everything:

    • To see everything on one map, add a Union tool.
    • Connect the matched output (M anchor) of your Find Nearest tool to one input of the Union tool.
    • Connect the output of your Buffer tool to the other input of the Union tool.
    • Add a Browse tool after the Union tool and run the workflow.

In the final map, you should see the new office location, lines connecting it to its two nearest neighbors (West Loop and Lincoln Park), and a polygon representing the 1.5-mile buffer zone.


Conclusion

In this lesson, you've learned how to perform fundamental spatial manipulations. You can now not only create spatial points but also analyze their proximity to one another and generate new polygon objects that represent areas of influence.

Key Takeaways:

  • The Create Points tool is the first step for converting coordinate data into usable spatial objects.
  • The Find Nearest tool is essential for answering questions about proximity by identifying the closest objects from a "universe" to a "target."
  • The Buffer tool transforms points, lines, or polygons into larger polygon areas, perfect for defining service zones, trade areas, or other regions of interest.

These tools are building blocks you will use constantly in more advanced spatial analyses.

Preview of the Next Lesson:

The Find Nearest tool is great for finding which objects are closest and their distances. But what if you need to know the distance between many pairs of objects simultaneously, perhaps to create a full distance matrix between all your stores and warehouses? For that, Alteryx provides the Distance tool. In our next lesson, we will explore how to use this tool to perform bulk distance calculations.