Code Monkey home page Code Monkey logo

qgis-js's Introduction

qgis-js

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

Version: 0.0.5 (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 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
double-conversion (3.3.0)
Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles.
Website - Source code
egl-registry (2022-09-20)
the EGL API and Extension Registry
Website - Source code
exiv2 (0.28.1)
Image metadata library and tools
GPL-2.0-or-later Website - Source code
expat (2.6.0)
XML parser library written in C
MIT Website - Source code
freetype (2.13.2)
A library to render fonts.
FTL OR GPL-2.0-or-later 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.3)
Geometry Engine Open Source
LGPL-2.1-only Website
gumbo (0.10.1)
An HTML5 parsing library in pure C99
Apache-2.0 Website - Source code
inih (57)
Simple .INI file parser
BSD-3-Clause Website - Source code
json-c (2023-08-12)
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.2)
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
libpng (1.6.40)
libpng is a library implementing an interface for reading and writing PNG (Portable Network Graphics) format files
libpng-2.0 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.10.1)
A library for reading, creating, and modifying zip archives.
BSD-3-Clause Website - Source code
litehtml (0.6.0)
litehtml is the lightweight HTML rendering engine with CSS2/CSS3 support.
BSD-3-Clause Website - Source code
nlohmann-json (3.11.3)
JSON for Modern C++
MIT Website - Source code
opengl-registry (2022-09-29)
the API and Extension registries for the OpenGL family APIs
Website - Source code
opengl (2022-12-04)
Open Graphics Library (OpenGL)[3][4][5] is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics.
pcre2 (10.42)
Regular Expression pattern matching using the same syntax and semantics as Perl 5.
BSD-3-Clause Website - Source code
proj (9.3.1)
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.7)
Qt Cryptographic Architecture (QCA).
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
qt5compat (6.6.1)
The module contains unsupported Qt 5 APIs
Website
qtbase (6.6.1)
Qt Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.
Website
qtkeychain (0.14.0)
(Unaffiliated with Qt) Platform-independent Qt5 API for storing passwords securely
BSD-3-Clause Website - Source code
qtsvg (6.6.1)
Qt SVG
Website
qttools (6.6.1)
Qt Tools
Website
sqlite3 (3.45.0)
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.1)
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

qgis-js's People

Contributors

amuedespacher avatar boardend avatar wonder-sk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qgis-js's Issues

Opacity change latency

Hello, I have been tinkering with the repo and was seeing how it can do with layered historical imagery for comparing effects of flooding https://max-mapper.github.io/journal/maps/?repo=max-mapper/journal/mapdata/ec-floods

One issue is an adjustment to a single layer opacity e.g.

layer.opacity = 50 // WebGLTileLayer
source.clear(); // QgisXYZDataSource
layer.getRenderer().clearCache(); 
layer.changed();

... causes a full re-render which can take many seconds, especially on Android. I was just curious if there is a way to cache or avoid the rerender and make opacity adjustments feel instant. Thank you for any advice!

OpenLayers Integration: Remove XYZ Debug mode

Based on the feedback of Andreas Hocevar, we should remove the debug mode in QgisXYZDataSource and use createImageBitmap(imageData) directly and apply it with imageTile.setImage(imageBitmap) to get rid of the unnecessary 2D context creation.

Make sure labels and symbols do not get cut off in XYZ Tiles mode

If a label or a map symbol (e.g. a point marker) ends up being near the edge of a tile, it may get cut off: it only shows in one tile, but not on the neighboring tile.

QGIS server users also have this problem, and they set non-zero tile buffer (e.g. 100 pixels) in project settings:

image

QGIS server code then takes care of expanding the extent to add the extra buffer, something like this:

int tileBufferPixels = QgsProject::instance()->readNumEntry( QStringLiteral( "WMSTileBuffer" ), QStringLiteral( "/" ), 0 );
double buffer = tileBufferPixels * tileExtentWidthMapUnits / tileWidthPixels;
mapSettings.setExtentBuffer( buffer );

Loading a project fails with RuntimeError: index out of bounds

Here's the test project: test_project.zip

Loading it will emit this error:

Uncaught (in promise) RuntimeError: index out of bounds
    loadProject https://qgis-js.dev.schmuki.io/assets/wasm/qgis-js.js line 6867 > Function:8
    <anonymous> https://qgis-js.dev.schmuki.io/assets/index-5d3bd54b.js:120
    r https://qgis-js.dev.schmuki.io/assets/index-5d3bd54b.js:1
    n https://qgis-js.dev.schmuki.io/assets/index-5d3bd54b.js:1
    async* https://qgis-js.dev.schmuki.io/assets/index-5d3bd54b.js:120
[qgis-js.wasm:5700853:1](https://qgis-js.dev.schmuki.io/assets/wasm/qgis-js.wasm)
    <anonymous> https://qgis-js.dev.schmuki.io/assets/index-5d3bd54b.js:120
    AsyncFunctionThrow self-hosted:856

Initial high CPU load on Firefox

When Firefox is loading the qgis-js WebAssembly module, one core is 100% busy for some time. This is likely something FF does internally when loading such a large .wasm module:

  • The high CPU load goes towards zero after some time (~4min on my machine). The website is still working/responsive after that and stays idle when doing more render calls
  • The same thing happens with the 0.0.3 version, see https://boardend.github.io/qgis-js-baseline/
  • The same thing happens if I just return 0 in the main function
  • This behavior was observed in FF on Ubuntu Wayland and X11, also on FF on Windows 11
  • FF profiler only shows that the PollWrapper is busy polling
  • Hard to judge, but it seems that other larger Qt projects show similar behavior, although not as extreme as in qgis-js:

integrating qgis into expressJs based web application for tiff images

I am working on an expressJS based web application which is primarily intended to object detection from tiff images. As of now, i am using openseadragon for loading the tiff images inside the application but it takes too much time. So i had a thought of using QGIS interface inside my application for loading the tiff images.
can anyone help with this?

Can projects ship thier own fonts?

This question came up by @andreasneumann while testing out some own projects. See the notes in the Qt6 WebAssembly reference for context.

A real cool solution would be the proposed Local Font Access API by Google. Qt did some integration, but the API is only available in Chromium based browsers and behind a flag for the time of writing. So probably not the solution for qgis-js.

What we could do is to scan the uploaded folder for any known/supported font file extensions and add those via addApplicationFontFromData to the runtime.

QGIS layers within layer groups with visibility=false cannot be displayed

If a QGIS project has a layer group set to visible==false, setting the visibility of the individual layers to true in QGIS-js does not render the layers on the map.

Steps to reproduce:

  • Create a QGIS project
  • Create a layer group with at least one layer, and set it to invisible (via the checkbox in the layer list)
  • Open the QGIS project with QGIS-js (e.g. on demo site)
  • Try to switch on the layer that is in the group

Actual result:

  • Layer is not displayed on the map

Expected result:

  • Layer is displayed on the map

Example:
(last two layers should render a choropleth map)
qgis-js-invisible_layers

qgis-js/utils - loadRemoteProjects cannot handle basePaths

When running a website on a different base path than root (e.g. "/qgis-demo"), loading remote projects does not work; it always expects files to be located at "/projects".

Steps to reproduce:

  • Set up e.g. a Vue.js app with Vite, configure a base path
  • Install and set up qgis-js and @qgis-js/utils
  • Use the useProjects composable to load remote projects
  • Try to open a remote project

Actual result:

Expected result:

  • Projects should be able to be opened also when running on a base path. This could e.g. be configured through an .env variable, or through a setting when using the useProject hook

Make map view more responsive (larger map view) - or full-screen mode

It would be great to have either a "full-screen" mode or a more responsive map view.

On my relatively large screen I only get a small map view - see screenshot below

grafik

Alternatively (or in addition) it would be cool to have a "full-screen" button for the map.

Of course this is all "low priority" - but maybe not that hard to implement.

Relative SVG files do not render

The attached project uses SVG files for rendering points. The SVG files are in a subfolder and are attached as relatives paths. However, they don't render correctly, but the question mark replacement symbol is shown instead.

This is how they should render:

grafik

and this is how they render in qgis-wasm:

grafik

Is this an issue with the epxression engine or relativ paths treatment, or the wasm file system?

Support for FeatureInfo (Identify tool)

It would be good if there could be feature info support (Identify tool) in the JS-QGIS API.

QGIS has different identify-tools modes:

  • Current layer
  • Top-Down, Stop at first
  • Top-down (and return results for all layers)
  • Interactive layer choice

grafik

For the web mapping context I think that the middle two versions (Top-Down, Stop at first; Top-down) would make most sense.

It would be great if this could support the QGIS expression engine and HTML for the display of feature info. See the "Display" section in the Layer properties:

grafik

That way we can be really flexible, with the mixture of HTML and QGIS expression support.

Layer opacity below 1 results in unwanted graying effect

When setting the opacity of a map layer to some value below 1 (e.g. 0.5), the map layer is displayed in a gray-ish color.

Steps to reproduce:

Actual result:

  • Map layer is displayed with a grayish tint.

Expected result:

  • When reducing the layer opacity, the layer should maintain its original color quality, becoming more transparent without a gray overlay. The colors should remain true to their original hue, and only in terms of transparency.

Tested both with the sample project "village" and an own QGIS project.

Example:
Opacity = 1:
opacity-1

Opacity < 1:
opacity-below-1

Global Variables not supported

Many global variables are not supporte, such as:

  • @map_scale
  • @qgis_platform
  • @qgis_os_name
  • @qgis_locale
  • @qgis_release_name
  • @qgis_version

etc.

Tested with writing out the variables with COALESCE in a label.

See also issue #26

Demo-Viewer - Input for preview timeout doesn't allow keyboard input

image

In the above window, the input text widget where one can enter a preview timeout value, the widget doesn't allow keyboard input. Only the Arrow up/down widgets work. To change the value from 200 to 300ms would mean a hundred klicks, because the step is one millisecond.

OpenLayers Integration: Larger tile sizes for higher resolution monitors

It would be useful to render larger tiles for high-dpi monitors.

One could have a switch depending on the screen size. E.g. when a browser window is larger than 2000 px on either width or height, then the tile size could switch from 256 px tiles to 512 px tiles.

of course, this is also low priority.

Loading a WMS/WMTS layer causes infinite loop

If the QGIS project uses a WMS / WMTS layer, the project loading will get stuck, with this warning being emitted all the time:

QEventLoop::WaitForMoreEvents is not supported on the main thread without asyncify

This is likely due to the fact that the WMS provider is doing a synchronous blocking GetCapabilities call in the constructor.

Map themes in QGIS should be exposed to the JS API

The JS interface should support the following functionality:

  • listing of all map themes in the project
  • switch visibility of layers and styles according to a map theme provided in the API

That way we can add predefined combinations of layer visibilities and/or style combinations without having the user to switch many layers one after the other.

grafik

See also QgsMapThemeCollection Class

qgis-js/utils - loadLocalProject does not handle promise rejections

Steps to reproduce:

  • Use the loadLocalProject function of @qgis-js/utils
  • When the system dialog to select a folder pops up, cancel it

Actual result:

  • Error "Uncaught (in promise) DOMException: The user aborted a request." appears
  • Rejected promise is not handled

Expected result:

  • Promise rejection is handled

Hints:

const loadLocalProject = async (): Promise<LocalProject> => {
  try {
    const entries: LocalEntries = await openLocalDirectory({
      recursive: true,
      mode: "read",
    }) as LocalEntries;
    const localProject = new LocalProject(fs, entries);
    return localProject;
  } catch (error) {
    console.error(error);
    throw error;
  }
};
  • This would allow to better handle e.g. user abortions in the UI.

Loading expressions throws RuntimeError

When using a QGIS project containing vector tiles layer with a couple of styling rules, it failed to load with this RuntimeError:

qgis-js.wasm:0x56fcf5 Uncaught (in promise) RuntimeError: memory access out of bounds
    at QgsExpressionNodeFunction::QgsExpressionNodeFunction(int, QgsExpressionNode::NodeList*) (qgis-js.wasm:0x56fcf5)
    at exp_parse(expression_parser_context*) (qgis-js.wasm:0x54bcd8)
    at parseExpression(QString const&, QString&, QList<QgsExpression::ParserError>&) (qgis-js.wasm:0x54e28d)
    at QgsExpression::QgsExpression(QString const&) (qgis-js.wasm:0x55145b)
    at QgsProperty::loadVariant(QVariant const&) (qgis-js.wasm:0x9d9bd2)
    at QgsPropertyCollection::loadVariant(QVariant const&, QMap<int, QgsPropertyDefinition> const&) (qgis-js.wasm:0x9dfd97)
    at QgsAbstractPropertyCollection::readXml(QDomElement const&, QMap<int, QgsPropertyDefinition> const&) (qgis-js.wasm:0x9dce89)
    at QgsSymbolLayerUtils::loadSymbolLayer(QDomElement&, QgsReadWriteContext const&) (qgis-js.wasm:0x447961)
    at QgsSymbolLayerUtils::loadSymbol(QDomElement const&, QgsReadWriteContext const&) (qgis-js.wasm:0x4455a1)
    at QgsSymbolLayerUtils::loadSymbols(QDomElement&, QgsReadWriteContext const&) (qgis-js.wasm:0x45d3f7)

QgsExpressionNodeFunction tries to lock a recursive mutex, maybe that's the reason (possibly related to #3 which also fails when locking mutex, but with a different error message)

Vector / raster tiles layer throws error when rendering

Rendering of vector tiles or raster tiles throws a RuntimeError "operation does not support unaligned accesses"

First there are a couple of suspicious warnings from QgsNetworkAccessManager code:

qgis-js.js:1631 qt.core.qobject.connect: QObject::connect(QgsNetworkAccessManager, Unknown): invalid nullptr parameter
qgis-js.js:1631 qt.core.qobject.connect: QObject::connect(QgsNetworkAccessManager, QgsNetworkAccessManager): invalid nullptr
qgis-js.js:1631 qt.core.qobject.connect: QObject::connect(QgsNetworkAccessManager, Unknown): invalid nullptr parameter

In case of raster tile layer: (wms provider with xyz service type)

qgis-js.worker.js:68 RuntimeError: operation does not support unaligned accesses
    at QBasicMutex::lockInternal(int) (qgis-js.wasm:0x1b4a57)
    at QRecursiveMutex::tryLock(int) (qgis-js.wasm:0x1b48f4)
    at QgsNetworkAccessManager::setupDefaultProxyAndCache(Qt::ConnectionType) (qgis-js.wasm:0x581770)
    at QgsNetworkAccessManager::instance(Qt::ConnectionType) (qgis-js.wasm:0x57f546)
    at QgsTileCache::tile(QUrl const&, QImage&) (qgis-js.wasm:0x1884371)
    at QgsWmsProvider::draw(QgsRectangle const&, int, int, QgsRectangle&, double&, QgsRasterBlockFeedback*) (qgis-js.wasm:0x194d54e)
    at QgsWmsProvider::readBlock(int, QgsRectangle const&, int, int, void*, QgsRasterBlockFeedback*) (qgis-js.wasm:0x1953332)
    at QgsRasterDataProvider::block(int, QgsRectangle const&, int, int, QgsRasterBlockFeedback*) (qgis-js.wasm:0xd2108a)
    at non-virtual thunk to QgsRasterDataProvider::block(int, QgsRectangle const&, int, int, QgsRasterBlockFeedback*) (qgis-js.wasm:0xd22314)
    at QgsSingleBandColorDataRenderer::block(int, QgsRectangle const&, int, int, QgsRasterBlockFeedback*) (qgis-js.wasm:0xd86462)

In case of vector tile layer:

qgis-js.worker.js:68 RuntimeError: operation does not support unaligned accesses
    at QBasicMutex::lockInternal(int) (qgis-js.wasm:0x1b4a57)
    at QRecursiveMutex::tryLock(int) (qgis-js.wasm:0x1b48f4)
    at QgsNetworkAccessManager::setupDefaultProxyAndCache(Qt::ConnectionType) (qgis-js.wasm:0x581770)
    at QgsNetworkAccessManager::instance(Qt::ConnectionType) (qgis-js.wasm:0x57f546)
    at QgsTileDownloadManagerWorker::queueUpdated() (qgis-js.wasm:0xa2df28)
    at QtPrivate::QSlotObject<void (QgsTileDownloadManagerWorker::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (qgis-js.wasm:0xa2dbae)
    at QMetaCallEvent::placeMetaCall(QObject*) (qgis-js.wasm:0xe9091)
    at QObject::event(QEvent*) (qgis-js.wasm:0xebd08)
    at QCoreApplicationPrivate::notify_helper(QObject*, QEvent*) (qgis-js.wasm:0xb65fe)
    at QCoreApplication::notify(QObject*, QEvent*) (qgis-js.wasm:0xb66c5)

Colors in QGIS wasm in chromium look less bright (washed out)

grafik

It seems like Chrome does some color management which results in slightly dumper (less vivid) colors - when compared to QGIS Desktop and Firefox wasm rendering. One can see at in the blue of the rivers or the orange tones of the polygons above the shaded relief.

This is more an observation and not so much a bug.

@boardend : how to you transfer the rendered images from QGIS wasm to OpenLayers? As a JPEG or PNG encoded file? Can we influence color management in chrome?

Update to latest QGIS version

At the time of writing we are on QGIS 3.32.1 and the newest version would be 3.36.3

We should find a way to update to the latest QGIS version periodically (or even better automatically)

Currently we have some nasty patches in build/vcpkg-ports/qgis-qt6, which (will probably) prevent a smooth update to the latest QGIS version. We should move as much as possible upstream and bring the rest in a form, so that it is easily updatable

@qgis-js/utils is not usable for external projects

Importing import { useProjects } from "@qgis-js/utils" only works when the internal Vite configuration is in place. Otherwise Vite will report:

Could not resolve "public/projects"

    node_modules/@qgis-js/utils/dist/qgis-js-utils.js:340:8:
      340 β”‚         "public/projects"
          β•΅         ~~~~~~~~~~~~~~~~~

  You can mark the path "public/projects" as external to exclude it from the bundle, which will
  remove this error. You can also add ".catch()" here to handle this failure at run-time instead of
  bundle-time.

This doesn't make sense for external usage. Will have to find another solution or remove this feature from the @qgis-js/utils package.

Reported by @amuedespacher, CC @andreasneumann

Raster layer with a remote COG fails to load

When using a QGIS project that contains a cloud-optimized GeoTIFF (COG) on a remote server, it fails with a runtime error:

qgis-js.wasm:0x4792c6f Uncaught (in promise) RuntimeError: memory access out of bounds
    at strlen (qgis-js.wasm:0x4792c6f)
    at std::__2::basic_string<char, std::__2::char_traits<char>, std::__2::allocator<char>>::basic_string[abi:v15006]<std::nullptr_t>(char const*) (qgis-js.wasm:0x932371)
    at CPLString::CPLString(char const*) (qgis-js.wasm:0x23aeac1)
    at cpl::VSICurlHandle::GetFileSizeOrHeaders(bool, bool) (qgis-js.wasm:0x242d5d3)
    at cpl::VSICurlHandle::GetFileSize(bool) (qgis-js.wasm:0x244222a)
    at cpl::VSICurlHandle::Exists(bool) (qgis-js.wasm:0x242f73e)
    at cpl::VSICurlFilesystemHandlerBase::Stat(char const*, stat*, int) (qgis-js.wasm:0x243cb26)
    at VSIStatExL (qgis-js.wasm:0x23e16c8)
    at GDALOpenInfo::GDALOpenInfo(char const*, int, char const* const*) (qgis-js.wasm:0x3d7e2c7)
    at GDALOpenEx (qgis-js.wasm:0x3db2ab9)

We are using our custom implementation of /vsicurl that uses emscripten's fetch API to do the requests.

It is strange that it crashes on some string construction. In the gdal sandbox this works fine (https://github.com/wonder-sk/wasm-gdal-sandbox), but the whole test case there runs in a worker thread because of the blocking networking calls.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.