<div dir="ltr"><div></div><div>Hi Will</div><div><br></div><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, 26 Aug 2026 at 17:00, Will Cohen via PROJ <<a href="mailto:proj@lists.osgeo.org">proj@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><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" target="_blank">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/" target="_blank">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" target="_blank">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" target="_blank">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></div></blockquote><div> </div><div>What headers are you talking about? I remember that at the beginning of my research I had to deal with COOP/COEP headers (and we were talking about it), but not when I published wasm-proj months ago (at least I removed that part of the code). I am not using any SharedArrayBuffer to talk with the web worker, just standard serializable messages. Am I missing any detail? Maybe emscripten is doing that internally, but it is only starting the web worker I explicitly start.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br>I've also since moved this worker plumbing into reusable libraries (<a href="https://github.com/willcohen/clj-native" target="_blank">https://github.com/willcohen/clj-native</a> and <a href="https://github.com/willcohen/worker-router" target="_blank">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/" target="_blank">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></blockquote><div><br></div><div>Thank you</div><div>Javier.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
_______________________________________________<br>
PROJ mailing list<br>
<a href="mailto:PROJ@lists.osgeo.org" target="_blank">PROJ@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/proj" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/proj</a><br>
</blockquote></div></div>