Hop Geometry Calculator
1. Geometry Calculator
The Geometry Calculator adds row-wise geometry calculations to Apache Hop. Every input row provides a geometry; the transform evaluates exactly one configured operation and adds one scalar output field, for example an area, a coordinate, an extent value or a validity flag.
1.1. Description
The transform accepts native Hop geometry values and geometry-compatible text or binary fields. It is designed for pipelines that derive measurements or diagnostics from geometries without an overlay, edit or reprojection step:
-
measurements:
AREA,LENGTH,PERIMETER,WIDTH,HEIGHT -
coordinates:
X,Y,Z,CENTROID_X,CENTROID_Y,INTERIOR_POINT_X,INTERIOR_POINT_Y -
extent:
XMIN,YMIN,XMAX,YMAX -
metadata and diagnostics:
GEOMETRY_TYPE,NUM_POINTS,NUM_GEOMETRIES,IS_EMPTY,IS_VALID,IS_VALID_REASON,IS_VALID_ERROR_TYPE,IS_VALID_LOCATION_X,IS_VALID_LOCATION_Y,IS_SIMPLE,IS_SIMPLE_LOCATION_X,IS_SIMPLE_LOCATION_Y,SRID
Exactly one calculation is configured per transform. Chain several Geometry Calculator transforms to add more than one result to a row.
1.2. Input
The transform is a regular transform: it consumes one incoming row per row and returns the same rows with one added output field. It does not require a specific upstream transform.
Supported geometry sources:
-
native geometry values (
ValueMetaGeometry) provided by the Geometry Type plugin -
StringandBinaryfields whose name containsgeom,geometry,wktorwkb -
WKT and EWKT text
-
WKB bytes and WKB hex text
SQL/MM curve types (CIRCULARSTRING, COMPOUNDCURVE, CURVEPOLYGON, MULTICURVE, MULTISURFACE) are parsed and preserved, including across isolated plugin class loaders.
The input field can be selected explicitly or left empty: an empty selection enables the automatic field detection, which resolves the geometry field by field name and value metadata.
1.3. Options
The transform dialog shows the following fields:
+==============================================================================+ | Geometry Calculator | | | | Name | | [ Geometry Calculator ] | | | | Input geometry field [ geometry v ] | | Operation [ Area (Measurements) v ] | | Output field [ area ] | | Output type [ NUMBER v ] | | Error mode [ RETURN_NULL v ] | | | | Status: geometry field detected on the input. | | | | [ OK ] [ Cancel ] | +==============================================================================+
| Option | Description | Default |
|---|---|---|
|
Input geometry field |
Name of the field that holds the geometry. Leave empty to detect the field automatically. |
(empty, auto-detect) |
|
Operation |
The calculation to apply, see Operations. |
|
|
Output field name |
Name of the added output field. |
|
|
Output type |
Hop type of the output field, see Output. |
|
|
Error mode |
|
|
1.3.1. Operations
| Operation | Result |
|---|---|
|
|
Area of polygonal geometries. |
|
|
Length of lineal and polygonal geometries. |
|
|
Perimeter of polygonal geometries. |
|
|
Extent of any parseable geometry; |
|
|
Coordinate of non-empty points; |
|
|
Centroid of non-empty valid geometries. |
|
|
Interior point of any parseable geometry; |
|
|
Envelope of any non-empty parseable geometry. |
|
|
Geometry type name; SQL/MM curves report |
|
|
Coordinate and geometry counts of any parseable geometry, including empty geometries. |
|
|
|
|
|
JTS validation result for any parseable geometry. |
|
|
Validation message of invalid geometries ( |
|
|
Stable symbolic name such as |
|
|
Scalar coordinates of the validation error; |
|
|
Simplicity result and its error location; locations are |
|
|
SRID of the geometry; |
1.4. Output
The transform adds exactly one output field.
| Operation group | Allowed output types |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Value semantics:
-
nullinput values producenulloutput values -
empty geometries stay distinguishable from
null -
empty geometries are valid and simple; use
IS_EMPTYto detect them -
all calculations use the units and the CRS of the input geometry as-is
-
measurements of SQL/MM curves use the segmented JTS representation, see Limitations
1.5. Supported engines
| Engine | Status |
|---|---|
|
|
Supported; the released plugin is verified against this engine in CI. |
|
|
Not part of the test matrix. |
|
Remote |
Requires the same plugin and Geometry Type installation on the Hop server. |
|
Beam engines ( |
Not part of the test matrix. Geometry values are provided by the Geometry Type plugin and are not a Beam-native schema. |
The transform does not restrict engines itself; the table describes the verified and tested scope.
1.7. Error handling
| Mode | Behaviour |
|---|---|
|
|
Parse, type and compatibility failures produce |
|
|
The first parse, type or compatibility failure raises a |
1.8. Limitations
-
No reprojection and no unit conversion: calculations use the geometry and its CRS as-is.
-
One calculation per transform; chain transforms for more results.
-
No formula parser, no overlay or edit operations.
-
AREA,PERIMETER,WIDTHandHEIGHTare planar calculations in the units of the geometry. -
SQL/MM curves are preserved, but scalar calculations use the densified linear JTS representation that the curve classes expose through their JTS superclass.
LENGTH,AREAand similar operations are segment-based, not analytic circle or arc calculations. -
Validation and simplicity locations are exposed as scalar
X/Yvalues only; no geometry output is produced.