Skip to main content
This gem runs in .

Overview

Build spatial shapes from coordinate data by grouping and ordering points into either polygons (closed shapes) or polylines (open lines). Use this gem to convert raw latitude/longitude values into structured spatial geometries for mapping, analysis, or downstream geospatial operations.
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.

Input and Output

The PolyBuild gem accepts the following input and output.

Parameters

Configure the PolyBuild gem using the following parameters.
  • Sequence Polygon: Uses the POLYGON() format to create a closed shape.
  • Sequence Polyline: Uses the LINESTRING() format to create an open path.

Example

Assume you have the following routes table for public transportation routes.
To transform each route into a polyline geometry:
  1. Add the PolyBuild gem to your pipeline canvas.
  2. Connect the routes table to the PolyBuild input port.
  3. Open the PolyBuild gem configuration.
  4. For Build Method, select Sequence Polyline.
  5. For Longitude Column Name, select the longitude column.
  6. For Latitude Column Name, select the latitude column.
  7. For Group Field, select the route_id column.
  8. For Sequence Field, select the stop_schedule column.
  9. Save and run the gem.

Result

The PolyBuild gem outputs a table including a polyline for each route.