Geometric Types
Handle PostgreSQL geometric and spatial data types.
Overview
PostgreSQL geometric types include:
-
Point: (x,y) coordinates
-
Line: Linear equations
-
Box: Rectangular boxes
-
Path: Connected points
-
Polygon: Closed paths
-
Circle: Center and radius
Common Issues
Issue: Geometric Type Not Preserved
Symptom: Geometric values become NULL or corrupted.
Solution: Copy the column unchanged with the passthrough transformation (available in MASKING mode only):
tables:
- table_name_with_schema: "public.places"
transformations:
- columns: ["location"]
params:
type: passthrough
Issue: Cannot Transform Geometric Data
Symptom: "Cannot transform geometric type" errors.
Solution: Use scripting transformer for custom geometric transformations:
transformations:
- columns: ["location"] # POINT type
params:
type: scripting_transformer
language: JAVASCRIPT
script:
code: |
(ctx, originalRecord) => {
// Offset point by random amount
const location = originalRecord.get("location");
if (location == null) {
return location;
}
const parts = location.toString().replace('(', '').replace(')', '').split(',');
const x = parseFloat(parts[0]) + Math.random() * 0.01;
const y = parseFloat(parts[1]) + Math.random() * 0.01;
return '(' + x + ',' + y + ')';
}