Skip to main content
This gem runs in .

Overview

Use the Buffer gem to take any polygon or line and expand or contract its boundaries. This can be useful for spatial analysis tasks like creating safety zones around hazardous areas, expanding service coverage areas, and analyzing proximity impacts.
The gem has a corresponding interactive gem example. See Interactive gem examples to learn how to run sample pipelines for this and other gems.

Prerequisites

  • Add ProphecyDatabricksSqlSpatial version 0.0.3 or higher to your project.
  • Run Databricks Runtime 17.1 or higher. (This requirement is due to the use of Databricks’ ST geospatial functions.) Other SQL warehouse providers are not supported for this gem.

Input and Output

The Buffer gem accepts the following inputs and output.
PortDescription
in0Input dataset containing the source points in WKT format for which you want to find the nearest points.
outOutput dataset that contains two columns: input with the original geometry, and output with the transformed geometry.
Input geometries must be in Well-known Text (WKT) geometric format. Use the PolyBuild gem to create lines and polygons in this format from latitude and longitude coordinates.

Parameters

Configure the Buffer gem using the following parameters.
ParameterDescription
Geometry columnColumn containing the polygon or line you want to expand or contract.
DistanceAmount of distance to expand or contract each geometry. Use negative distances to create inward buffers (shrinking geometries).
UnitsUnit of measurement for the distance you defined.

Example

Let’s say you’re working with a transportation dataset and need to create safety corridors around major highways. You have highway routes as polylines and want to create 3 mile buffer zones on both sides of each road for noise impact analysis.
  1. Add a Buffer gem to your pipeline canvas.
  2. Attach an input that includes the highway routes as polylines in a routes column.
  3. Open the gem configuration interface.
  4. For Geometry column, select the routes column from the input table.
  5. For Distance, input 3.
  6. For Units, select Miles.
  7. Save and run the gem.

Result

The output will contain both the original routes and your transformed highway routes.