2026-09-01 –, Ran1
Computing a representative point that is guaranteed to lie inside a geometry is essential for labeling, geocoding, and spatial indexing.
This talk introduces "interior-point", an open-source project that ports the JTS (Java
Topology Suite) InteriorPoint algorithm to both TypeScript and Rust/WASM.
Background
The "interior point" (or "representative point") problem - finding a point guaranteed to lie inside a given geometry - is a fundamental operation in GIS. It is used for polygon labeling, address geocoding, and spatial indexing. In Japan, the Digital Agency's mojxml2geojson tool uses GEOS's PointOnSurface function (via Python GDAL bindings) to compute representative points for cadastral parcel polygons. These representative points are published as part of the national Address Base Registry master data.
Motivation
While JTS and GEOS provide a robust solution, there is growing demand for performing such geospatial computations directly in the browser - for interactive web mapping, etc. The presenter previously gave a talk at FOSS4G Asia 2023 on GEOS-WASM ("GEOS runs on web browsers - WebAssembly power for geospatial analysis"), exploring the feasibility of running GEOS in the browser via WebAssembly. Building on that experience, this project takes a different approach: rather than compiling a large C++ library to WASM, port the specific algorithm we need - JTS's scanline-based InteriorPoint - directly to TypeScript and Rust.
The Project Status & Future Work
The project was just started and still needs enough tests with various data.
* WebSite: https://sanak.github.io/interior-point/
* GitHub: https://github.com/sanak/interior-point
I am planning a browser-based benchmark suite comparing accuracy and performance of multiple interior point / point-on-surface implementations:
- JSTS (JavaScript port of JTS)
- wasmts (JTS compiled to WASM)
- geos-wasm (GEOS compiled to WASM, GEOSPointOnSurface)
- georust/geo (interior_point - a different implementation in Rust)
- Turf.js (pointOnFeature)
This comparison will help the community understand the trade-offs between pure-JS, WASM-compiled, and algorithm-specific approaches for browser-based geospatial computing.
interior-point (JTS Interior Point algorithm port to TypeScript and Rust/WASM)
I make my conference contribution available under the CC BY 4.0 license. The conference contribution comprises the abstract, the text contribution for the conference proceedings, the presentation materials as well as the video recording and live transmission of the presentation:- Geospatial Developer, Geolonia, Inc.
- pgRouting PSC member, contributor (docker-pgrouting, pgRoutingLayer, etc.)
- OSGeoLive Japanese translator, contributor
- GitHub: https://github.com/sanak