Skip to content

feat: GEOS-flavour ISO/EXTENDED curve WKB and spaced WKT I/O - #51

Merged
grootstebozewolf merged 2 commits into
feature/sfa-curve-rgrfrom
cursor/geos-curve-io-flavour-17bc
Aug 16, 2026
Merged

feat: GEOS-flavour ISO/EXTENDED curve WKB and spaced WKT I/O#51
grootstebozewolf merged 2 commits into
feature/sfa-curve-rgrfrom
cursor/geos-curve-io-flavour-17bc

Conversation

@grootstebozewolf

@grootstebozewolf grootstebozewolf commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Draft off #7 (feature/sfa-curve-rgr). Do not merge unless asked. Does not reopen the 2-D 8–12 reader PR. Does not join ConcaveHull. Does not touch Bar 2 / #38 / #27 / #47. No public noder. No invented DOI.

Tip: 3d785d29b765d04e7d63a785835d7aee1fd5cee4

Scope

Curve types 8–12 plus ISO/EXTENDED Z/M/ZM only. WKB 15–17 (Triangle / PolyhedralSurface / TIN) are not added — GEO-TIN waits Architect SIGN. Unknown type throws.

Contract

GEOS-as-reference (libgeos/geos main @ 737737db), ISO/IEC 13249-3 SQL/MM Spatial. No wkbCurve / wkbSurface.

Flavour API (matches GEOS WKBWriter::setFlavor):

  • WKBConstants.wkbExtended = 1 (default)
  • WKBConstants.wkbIso = 2
  • WKBWriter.setFlavor(int) / getFlavor()
  • WKBReader.detectFlavor(int typeInt) on read ((typeInt & 0xffff) / 1000 → 1=Z, 2=M, 3=ZM; plus SFSQL 0x80000000 Z / 0x40000000 M / 0x20000000 SRID)

ISO write: type+1000 Z, +2000 M, +3000 ZM. No SRID. Extended: types 8–12 plus EWKB bits and optional SRID.

WKT: spaced suffix CIRCULARSTRING Z (not glued). Reader accepts TYPEZ and TYPE Z. CompoundCurve / MultiCurve / CurvePolygon rings: LineString is bare (x y, …); CircularString stays tagged. CurvePolygon WKB rings are full child WKB (type header).

Writer honesty

Needed a fix on this draft. Core WKBWriter still flattened 8–12 via instanceof LineString / Polygon on starting ref b2861a08. This draft throws IllegalArgumentException (use CurveWKBWriter) instead of emitting wkbLineString=2. LinearRing→LineString remains the only collapse.

Tests

GeosCurveIOFlavourTest pins GEOS-compatible type words and WKT strings for the five curve types in 2-D, Z, M, ZM. Byte-level ISO CircularStringZ=1008 pin. Core writer must not emit type 2 for a CircularString. Types 15 / 16 / 17 stay Unknown WKB type.

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 16, 2026 17:21
Add WKBWriter.setFlavor(ISO|EXTENDED) matching GEOS (default Extended).
ISO writes type+1000/2000/3000 and omits SRID; Extended keeps EWKB bits.
Core WKBWriter refuses to flatten SQL/MM types 8-12. Curve WKT emits a
spaced Z/M/ZM suffix. Cite ISO/IEC 13249-3.

Co-authored-by: Jeroen Bloemscheer <grootstebozewolf@users.noreply.github.com>
This draft stays curve types 8-12 plus ISO/EXTENDED Z/M/ZM. Triangle,
PolyhedralSurface, and TIN are not added. Unknown type throws.

Co-authored-by: Jeroen Bloemscheer <grootstebozewolf@users.noreply.github.com>
@grootstebozewolf
grootstebozewolf marked this pull request as ready for review August 16, 2026 18:20
@grootstebozewolf
grootstebozewolf merged commit fa640cf into feature/sfa-curve-rgr Aug 16, 2026
4 checks passed
cursor Bot pushed a commit that referenced this pull request Aug 16, 2026
Export honesty stays on CurveWKBWriter type codes. Core ISO/EXTENDED
flavour and 8-12 refuse live on #7 after the #51 merge.

Co-authored-by: Jeroen Bloemscheer <grootstebozewolf@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Aug 16, 2026
MMF is WKB/WKT clean roundtrip. Drop overlay, hull, densify, and
Option C. Keep write honesty: WKT CompoundCurve members, toText,
GML/KML/GeoJSON refuse, TestBuilder clipboard/toWKT. Core WKB 8-12
refuse stays on #7 after #51. Cite ISO/IEC 13249-3.

Co-authored-by: Jeroen Bloemscheer <grootstebozewolf@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Aug 16, 2026
I/O identity, not op honesty. Types 8-12 + ISO 1008-3012.
Flavour stays on #51. Cite ISO/IEC 13249-3.

Co-authored-by: Jeroen Bloemscheer <grootstebozewolf@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Aug 16, 2026
Rebased on feature/sfa-curve-rgr @ fa640cf. #51 owns WKB 8-12
and ISO/EXTENDED Z/M/ZM. This draft keeps only write honesty
#51 does not own: WKT CompoundCurve members, toText, GML/KML/
GeoJSON refuse, TestBuilder toWKT/toGML/clipboard/saveWKT.
Cite ISO/IEC 13249-3. Do not merge.

Co-authored-by: Jeroen Bloemscheer <grootstebozewolf@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants