<div dir="ltr"><div>Hi all</div><div><br></div><div>Recently I was wondering if it would be possible to have QGIS running natively in browser thanks to WebAssembly. Many hours later, I have a small, very rough, proof of concept:</div><div><a href="https://wonder-sk.github.io/wasm/qgis.html">https://wonder-sk.github.io/wasm/qgis.html</a></div><div><br></div><div>If you have a reasonably up-to-date browser, you should be able to browse the map - zoom in/out and move map, either with buttons or by dragging map and using mouse wheel. And you can switch to other demo projects (but not all work fully at this point).</div><div><br></div><div>For those that are not familiar with WebAssembly - the whole point here is that ALL the map rendering is happening in your browser, there is no server-side rendering going on. The demo QGIS projects get downloaded (as .qgz) together with the source data files (.gpkg, .shp, .tif or others) and all this gets loaded and processed by the browser.<br></div><div><br></div><div>How is the demo built: there's qgis core library with gdal/ogr provider and the usual dependencies (PROJ, GDAL, GEOS etc), all compiled to a single .wasm file using Emscripten. The output binary is over 30 MB, but it compresses well to ~12 MB with gzip. It is built on top of Qt6 and many hacks to get things somehow going. I have created a minimal C API (used from JavaScript) to load a QGIS project, do rendering to a QImage and then a bit of JavaScript to display the map image in HTML canvas and handle map navigation.</div><div><br></div><div>There is a long list of issues that would need to be solved in order to get something useful out of this, but I am really excited about the prospect of being able to run QGIS code natively in a web browser(!). WebAssembly is nowadays supported by over 90% web users according to <a href="https://caniuse.com/wasm">https://caniuse.com/wasm</a> - so it's quite widely available.<br></div><div><br></div><div>With some development effort, it will be possible to use WebAssembly to our advantage in various ways. Imagine that people could just go to <a href="http://qgis.org">qgis.org</a> and start their QGIS session in the web browser (without draining QGIS infrastructure - all code/rendering is run on the client!).<br></div><div><br></div><div>I am very keen to hear what you think about QGIS and WebAssembly. In the coming days I would like to also get the build system and my hacks available in a git repo, so that others can start to play with it...</div><div><br></div><div>Cheers</div><div>Martin</div><div><br></div></div>