How libgeos.wasm on this site was built ======================================= libgeos.wasm is GEOS 3.13.1 (https://libgeos.org), unmodified, licensed under the GNU Lesser General Public License version 2.1 (GEOS-LGPL-2.1.txt). Complete corresponding source: geos-3.13.1.tar.bz2, next to this file (as released at https://download.osgeo.org/geos/geos-3.13.1.tar.bz2; SHA-256 df2c50503295f325e7c8d7b783aca8ba4773919cde984193850cf9e361dfd28c). Toolchain: Emscripten 4.0.15 (LLVM 22). 1. Static libraries (position independent, WebAssembly exceptions): emcmake cmake -G Ninja -S geos-3.13.1 -B build -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DBUILD_BENCHMARKS=OFF \ -DBUILD_DOCUMENTATION=OFF -DBUILD_GEOSOP=OFF -DBUILD_ASTYLE=OFF \ "-DCMAKE_CXX_FLAGS=-fwasm-exceptions -fPIC" "-DCMAKE_C_FLAGS=-fwasm-exceptions -fPIC" ninja -C build geos geos_c 2. The shared library (an Emscripten "side module"), exporting the GEOS C API functions the stencil engine calls: em++ -O3 -fwasm-exceptions -sSIDE_MODULE=2 \ "-sEXPORTED_FUNCTIONS=[]" \ build/lib/libgeos_c.a build/lib/libgeos.a -o libgeos.wasm Exported functions: every GEOS*_r function of the GEOS C API that the engine calls (GEOS_init_r, GEOSArea_r, GEOSBoundary_r, GEOSBufferWithStyle_r, GEOSContains_r, GEOSContext_setErrorHandler_r, GEOSContext_setNoticeHandler_r, GEOSCoordSeq_create_r, GEOSCoordSeq_getSize_r, GEOSCoordSeq_getXY_r, GEOSCoordSeq_setXY_r, GEOSDifference_r, GEOSDistance_r, GEOSGeom_clone_r, GEOSGeom_createCollection_r, GEOSGeom_createLinearRing_r, GEOSGeom_createLineString_r, GEOSGeom_createPointFromXY_r, GEOSGeom_createPolygon_r, GEOSGeom_destroy_r, GEOSGeom_getCoordSeq_r, GEOSGeom_getXMax_r, GEOSGeom_getXMin_r, GEOSGeom_getYMax_r, GEOSGeom_getYMin_r, GEOSGeomGetX_r, GEOSGeomGetY_r, GEOSGeomTypeId_r, GEOSGetCentroid_r, GEOSGetExteriorRing_r, GEOSGetGeometryN_r, GEOSGetInteriorRingN_r, GEOSGetNumGeometries_r, GEOSGetNumInteriorRings_r, GEOSIntersection_r, GEOSIntersects_r, GEOSisEmpty_r, GEOSisValid_r, GEOSLength_r, GEOSMaximumInscribedCircle_r, GEOSOrientPolygons_r, GEOSPointOnSurface_r, GEOSPrepare_r, GEOSPreparedContains_r, GEOSPreparedGeom_destroy_r, GEOSSymDifference_r, GEOSTopologyPreserveSimplify_r, GEOSUnaryUnion_r). 3. A short licence notice (this file's location) is appended to the result as a WebAssembly custom section named "license". Custom sections are never executed; the GEOS code itself is exactly what step 2 produces. Using a modified GEOS --------------------- The stencil engine (bmf-engine.wasm) does not contain GEOS: it loads libgeos.wasm at run time as a separate shared library and calls it only through the GEOS C API above. You can build your own (modified) version of GEOS the same way and use it in place of ours, for example with your browser's developer tools ("local overrides") to substitute your libgeos.wasm for the one this site serves. Any build that exports the same C API functions is interface-compatible.