• Stars
    star
    164
  • Rank 230,032 (Top 5 %)
  • Language
    TypeScript
  • License
    GNU General Publi...
  • Created about 1 year ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

QGIS core ported to WebAssembly to run it on the web platform

qgis-js

QGIS core ported to WebAssembly to run it on the web platform

Version: 0.0.1 (based on QGIS 3.32.1)

qgis-js Repository | qgis-js Website

โš ๏ธ๐Ÿงช Work in progress! Currently this project is in public beta and only does very basic things like loading a QGIS project and rendering it to an image (see Features and Limitations)

๐ŸŒฑ๐Ÿ‘‹ Help wanted! Please try out your QGIS projects and report issues and ideas on GitHub. We are also warmly welcoming contributions to this project (see Contributing)

About

This project provides recipes to compile QGIS core and its dependencies to WebAssembly using Emscripten, CMake and vcpkg.

qgis-js provides a JavaScript/TypeScript API to interact with QGIS, load projects and render beautiful QGIS-based maps on the web platform (see Features).

Please note that our focus is currently on making the QGIS core usable. The project does not aim to bring the full QGIS desktop application, GUI library, or Python bindings (see Limitations).

๐Ÿ“š See the qgis-js Website or ./docs for more detailed information

Packages

Package Description npm
qgis-js The qgis-js API (which also ships the .wasm binary) qgis-js on npm
@qgis-js/ol OpenLayers sources to display qgis-js maps @qgis-js/ol on npm
@qgis-js/utils Utilities to integrate qgis-js into web applications @qgis-js/utils on npm

Getting started

Example Source code StackBlitz
๐Ÿ“ Using the qgis-js API example docs/examples/qgis-js-example-api Open the "Using the qgis-js API" example in StackBlitz
๐Ÿ—บ๏ธ Minimal OpenLayers example docs/examples/qgis-js-example-ol Open the "Minimal OpenLayers" example in StackBlitz

Compatibility

A modern desktop browser is needed. At the moment we only support/test Chromium-based browsers (>= 95) and Firefox (>= 100)

๐Ÿ“š See docs/compatibility.md for more details

Features

This project is a work in progress. Currently it provides the following features:

  • QGIS core (and its dependencies) compiled to WebAssembly
    • JavaScript/TypeScript API to interact QGIS core
  • Loading of QGIS projects
  • Non-blocking rendering of QGIS maps/tiles to ImageData
  • Optional OpenLayers integration

Limitations

Compared to the native build of QGIS, there are various limitations:

  • The API surface is very limited at the moment
  • Network-based layers (e.g. WMS, WFS, WMTS, XYZ, COG, Vector Tiles) are not supported at the moment
  • No Python (PyQGIS) available
  • No Qt GUI provided
  • Some providers that need to communicate with a server using sockets will probably never work without proxies (e.g. PostgreSQL)

How to build qgis-js

๐Ÿ’ก NOTE: To just use qgis-js you don't need to build it yourself, you can install it from npm. See the provided Packages.

Install dependencies

Install the following system packages (on Ubuntu 22.04):

sudo apt-get install pkg-config ninja-build flex bison

Install Qt6:

  • Download the Qt Online Installer

    • You need a free Qt account to use the installer
  • Install at least the following 6.5.2 packages:

    • WebAssembly (multi-threaded)
      • Qt 5 Compatibility Module

Alternativly you can use Another Qt installer (aqt) with Python

  • Patch Qt installation
    • Run build/scripts/qt-patches.sh to patch the Qt installation
      • Set QGIS_JS_QT env var if you're not using ~/Qt/6.5.2

Install dependencies with pnpm:

npx pnpm install

This will also invoke ./qgis-js.ts -v install on "postinstall" which

  • downloads and installs emsdk in build/emdsk
  • downloads and installs vcpkg in build/vcpkg
  • boostraps vcpkg and downlaod the ports sources

see also build/scripts/install.sh for manual installation

Compile qgis-js (and its dependencies) with Emscripten

npm run compile
  • Can also be ivoked with compile:debug or compile:release, see Build types
  • Will take about 30 minutes on a modern machine to compile all the vcpkg ports during the first run... โ˜•
  • see also build/scripts/compile.sh for manual compiltion

Build qgis-js packages

You want to compile with a Release build type first

npm run compile:release

After successful compilation, you can build the packages with Vite:

npm run build

see the packages listed at the beginning of this README

Development

You probably want to compile with a Dev or Debug build type first

npm run compile:dev

Start a Vite development server:

npm run dev

Open your browser at http://localhost:5173

Libraries

Library License Links
exiv2 (0.28.0)
Image metadata library and tools
GPL-2.0-or-later Website - Source code
expat (2.5.0)
XML parser library written in C
MIT Website - Source code
gdal (3.7.1)
The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data
Website - Source code
geos (3.11.2)
Geometry Engine Open Source
LGPL-2.1-only Website
inih (57)
Simple .INI file parser
BSD-3-Clause Website - Source code
json-c (2022-06-26)
A JSON implementation in C
MIT Website - Source code
libgeotiff (1.7.1)
Libgeotiff is an open source library on top of libtiff for reading and writing GeoTIFF information tags.
MIT Website - Source code
libiconv (1.17)
GNU Unicode text conversion
Website
libjpeg-turbo (3.0.1)
libjpeg-turbo is a JPEG image codec that uses SIMD instructions (MMX, SSE2, NEON, AltiVec) to accelerate baseline JPEG compression and decompression on x86, x86-64, ARM, and PowerPC systems.
BSD-3-Clause Website - Source code
liblzma (5.4.4)
Compression library with an API similar to that of zlib.
Website - Source code
libspatialindex (1.9.3)
C++ implementation of R*-tree, an MVR-tree and a TPR-tree with C API.
MIT Website - Source code
libzip (1.9.2)
A library for reading, creating, and modifying zip archives.
BSD-3-Clause Website - Source code
nlohmann-json (3.11.2)
JSON for Modern C++
MIT Website - Source code
proj (9.3.0)
PROJ library for cartographic projections
MIT Website - Source code
protobuf (3.21.12)
Protocol Buffers - Google's data interchange format
BSD-3-Clause Website - Source code
qca (2.3.6)
Qt Cryptographic Architecture (QCA).
LGPL-2.1 Website - Source code
qgis (3.32.1)
QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
GPL-2.0 Website - Source code
qt6 (6.5.2)
Qt6 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.
LGPL-3.0 Website - Source code
qtkeychain (0.14.0)
(Unaffiliated with Qt) Platform-independent Qt5 API for storing passwords securely
BSD-3-Clause Website - Source code
sqlite3 (3.43.1)
SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.
blessing Website
tiff (4.6.0)
A library that supports the manipulation of TIFF image files
libtiff Website - Source code
zlib (1.3)
A compression library
Zlib Website - Source code

Build types

Dev build type

  • Optimized for fast link times during development
    • Symbols are present (e.g. meaningful stack traces)
    • Enables some Emscripten assertions
    • No DWARF debug info
  • Empty CMAKE_BUILD_TYPE in CMake

Debug build type

  • Optimized for debugging with DWARF in Chromium-based browsers
    • Includes symbols and DWARF debug info
    • Enables most Emscripten assertions
  • see docs/debugging.md on how to get started
  • Will take much longer to build than the default Dev build type
  • CMAKE_BUILD_TYPE=Debug in CMake

Release build type

  • Optimized for performance and minimal package size
    • No symbols, assertions or DWARF debug info
    • Minified JavaScript files
  • Will take much longer to build than the default Dev build type
  • CMAKE_BUILD_TYPE=Release in CMake

Contributing

Contributions welcome, see CONTRIBUTING.md for how to get started

License

GNU General Public License v2.0

More Repositories

1

QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
C++
10,526
star
2

QGIS-Documentation

QGIS Documentation
Python
423
star
3

qwc2-demo-app

QWC2 demo application
JavaScript
194
star
4

qwc2

QGIS Web Client 2 Components
JavaScript
159
star
5

QGIS-Web-Client

A web client for the QGIS Server project
JavaScript
148
star
6

QGIS-Enhancement-Proposals

QEP's (QGIS Enhancement Proposals) are used in the process of creating and discussing new enhancements for QGIS
110
star
7

QGIS-Processing

Example scripts, algorithms etc
Python
93
star
8

QGIS-Code-Examples

Examples as part of a tutorial series in C++
C++
91
star
9

QGIS-Android

The official repository for the QGIS port to Android
Java
90
star
10

QGIS-Django

Django project for QGIS related activities such as plugin repository
Python
88
star
11

pyqgis-api-docs-builder

Sphinx project to build python API documentation for QGIS
Python
86
star
12

QGIS-Mac-Packager

Scripts for Official QGIS MacOS Packages
Shell
50
star
13

QGIS-Training-Data

Data for QGIS Training Manual exercises
QML
45
star
14

homebrew-qgisdev

Homebrew recipes for QGIS and MacOS
Shell
39
star
15

QGIS-Website

Official Website for QGIS.org
Sass
26
star
16

QGIS-Resources

R
26
star
17

QGIS-workshop-old

QGIS Python Workshop From FOSS4G2012 in Denver
Python
12
star
18

pyqgis_wrappers

common functions to be used in pyqgis and python qgis plugins
Python
11
star
19

QGIS-Sysadmin

General repo for system related admin scripts (docker, apache etc etc). Also to be used for issues regarding general System Administration issues.
Python
9
star
20

QGIS-Server-PerfSuite

QGIS Server Performance test suite
HTML
8
star
21

QGIS-Sample-Data

Repo for QGIS Sample data (aka Alaska dataset), used in QGIS Documentation
Shell
7
star
22

QGIS-Promotion

Press and print material for promoting QGIS
6
star
23

demo.qgis.org

Demo site for QGIS
JavaScript
4
star
24

QGIS-Redmine-Hub

Redmine plugin for hub.qgis.org customization
Ruby
4
star
25

QGIS-Hub-Plugin

A QGIS plugins to fetch resources from the QGIS Hub
Python
4
star
26

QGIS-Compilation-Guide

Latex sources for QGIS Compilation Guide
TeX
3
star
27

qgis4.0_api

Tracker for QGIS 4.0 API related issues and developer discussion
3
star
28

QGIS-Stripe

QGIS website - Stripe integration
HTML
2
star
29

PSC

2
star
30

QGIS-Server-CertifSuite

Automated test suite to run teamEngine OGC tests against QGIS server
Python
2
star
31

donate.qgis.org

Static donations page for QGIS.ORG with cookie advisory
HTML
2
star
32

qgis-uni-navigation

Universal web components for seamless navigation between qgis projects
TypeScript
2
star
33

libdxfrw

C
1
star
34

doc-test

Tests for documentation
Python
1
star
35

marketing

1
star
36

qgis3_UIX_discussion

Issue list to sum up and discuss UI/UX related issues
1
star
37

api.qgis.org

This is a GitHub pages project for hosting API docs
1
star
38

Grant-proposals

Repository to be used for the submission of Grant proposals
1
star
39

QGIS-Presentations

List of presentations (or presentation links) shared by the QGIS community
1
star