@ohos-ports/loaders.gl-wkt
v4.5.4-beta.0
Published
Loader and Writer for the WKT (Well Known Text) Format (HarmonyOS port of @loaders.gl/[email protected])
Readme
@loaders.gl/wkt
This module contains a geometry loader for the following formats:
- Well-Known Text (WKT)
- Well-Known Text Coordinate Reference System (WKT-CRS)
- Well-Known Binary (WKB)
loaders.gl is a collection of framework-independent visualization-focused loaders (parsers).
HarmonyOS Port (@ohos-ports/loaders.gl-wkt)
This package is a port of @loaders.gl/wkt v4.5.4 published under
the @ohos-ports organization for the HarmonyOS / OpenHarmony Node.js ecosystem.
What is different from upstream v4.5.4
The @loaders.gl/wkt package itself is a thin delegation layer; its TWKB/WKB/WKT conversion logic
lives in the runtime dependency @loaders.gl/gis. Upstream @loaders.gl/[email protected] ships two encode
bugs (details in the gis port):
BinaryWriter._ensureSize()did not rebuildthis.dataViewafter resizing the buffer, makingTWKBWriter.encode/encodeSyncthrowRangeErroron first write.- The Polygon / MultiPoint / MultiLineString / MultiPolygon TWKB encoders passed
writeTwkbPointarguments in the wrong order, mutating caller geometry and producing negated deltas.
Therefore this port:
- replaces the runtime dependency
@loaders.gl/giswith@ohos-ports/[email protected](upstream gis 4.5.4 + the two fixes above, applied to ESM/CJS outputs and sources); - rewrites all
@loaders.gl/gisreferences in its owndist/(ESM + CJS) andsrc/outputs to@ohos-ports/loaders.gl-gis; - applies the same two fixes to the self-contained browser bundles
dist/dist.min.jsanddist/dist.dev.js(thedist/wkt-worker.jsworker bundle only inlines parse-side code and is unaffected).
Verified: 67/67 tests pass, including TWKBWriter.encode/encodeSync roundtrips for all geometry
types with input-mutation assertions.
