<div dir="ltr">Hello all,<br><br>An update on the grid fetching and worker questions from the January proj.js thread. The latest release of proj-wasm (0.1.0-alpha9, <a href="https://www.npmjs.com/package/proj-wasm">https://www.npmjs.com/package/proj-wasm</a>) addresses them as follows:<br><br>Grid fetching now works in browsers and Node.js without curl in the build. PROJ runs entirely inside workers, and grids come through PROJ's network callback API backed by synchronous HTTP requests, which workers permit. In Node.js, a small fetch worker bridges those synchronous callbacks to Node's async http.<br><br>The WASM build is now fully single-threaded, with no pthreads. (Pthreads ends up requiring SharedArrayBuffer and COOP/COEP headers, which limits the usability of the WASM build to certain environments only.) Instead, parallelism now comes from a pluggable pool of workers, each running its own module instance, with PROJ contexts pinned to workers. The demo runs this pool with network grids enabled: <a href="https://willcohen.github.io/clj-proj/">https://willcohen.github.io/clj-proj/</a><br><br>This is a slightly different path from Javier's <a href="https://github.com/jjimenezshaw/wasm-proj">https://github.com/jjimenezshaw/wasm-proj</a>, which is exercising the ENABLE_EMSCRIPTEN_FETCH option from <a href="https://github.com/OSGeo/PROJ/pull/4627">https://github.com/OSGeo/PROJ/pull/4627</a>. I still like the idea of trying to use that -- it definitely seems cleaner and less like reinventing the wheel -- but I still want PROJ to be able to nab grids without requiring that webpages be served with a particular set of headers.<br><br>I've also since moved this worker plumbing into reusable libraries (<a href="https://github.com/willcohen/clj-native">https://github.com/willcohen/clj-native</a> and <a href="https://github.com/willcohen/worker-router">https://github.com/willcohen/worker-router</a>), and proj-wasm can adopt an external pool the caller supplies. This is how backproj (live demo at <a href="https://willcohen.github.io/backproj/">https://willcohen.github.io/backproj/</a>), which uses proj-wasm to back-project custom CRSes onto MapLibre, coordinates wasmts geometry operations (JTS compiled to wasm) and proj-wasm projection operations in one worker pool.<br><br>Now that these are settled and the mechanisms to build and hook into PROJ on wasm are abstracted out, I plan to reuse them for a similar wasm build of GDAL, hopefully without re-embedding PROJ inside it.<br><br>With PROJ, JTS (via wasmts), and eventually GDAL, I'm hoping that most GIS functionality can happen client side in the browser!<br><br>Will</div>