Skip to content

Add ST_OffsetCurve #821

Description

@yharby

ST_OffsetCurve (offset a line to one side by a distance) is a common PostGIS construction missing from duckdb-spatial. GEOS already provides GEOSOffsetCurve_r, and its joinStyle and mitreLimit arguments are the same enums the styled ST_Buffer variant already maps, so this is close to a clone of styled ST_Buffer minus the cap style.

Signature Notes
ST_OffsetCurve(line, distance) defaults quad_segs 8, join round, mitre_limit 5
ST_OffsetCurve(line, distance, quad_segs, join_style, mitre_limit) full styled form

Positive distance offsets to the left of the directed line, negative to the right (GEOS convention).

join_style GEOS Esri offsetHow (for ArcGIS porters)
round GEOSBUF_JOIN_ROUND esriGeometryOffsetRounded
mitre GEOSBUF_JOIN_MITRE esriGeometryOffsetMitered
bevel GEOSBUF_JOIN_BEVEL esriGeometryOffsetBevelled

Implementer tip, the 5 argument variant has 5 columns and DuckDB core ships no 4 or 5 column executor helper (only Unary, Binary, Ternary, and larger). The styled ST_Buffer already handles this many arguments, so mirror that approach. PostGIS reference, ST_OffsetCurve in lwgeom_geos.c is a thin wrapper over the same call.

Open question, explicit numeric and keyword arguments like the styled ST_Buffer, or a PostGIS style parameter string. The explicit form looks more consistent with duckdb-spatial.

Sharing this as research in case it helps whoever picks it up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions