Skip to content

Adding proof of concept for using a maplibre backend vs. OL #252

Closed
calebrob6 wants to merge 1 commit into
mainfrom
gobrrrrrrrrrrr
Closed

Adding proof of concept for using a maplibre backend vs. OL #252
calebrob6 wants to merge 1 commit into
mainfrom
gobrrrrrrrrrrr

Conversation

@calebrob6
Copy link
Copy Markdown
Contributor

Go-to ftw-inference-app/maplibre and check it out.

@m-mohr m-mohr requested review from ahocevar and m-mohr April 18, 2026 22:17
Copy link
Copy Markdown
Collaborator

@isaaccorley isaaccorley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just needs a formatting with prettier

Copy link
Copy Markdown
Collaborator

@ahocevar ahocevar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works. But the question is: why would we want to switch to MapLibre? The focus here is on raster data, and this is where OpenLayers really shines - with data tiles, on-the-fly raster styling and raster analysis. In addition to that, we have a team that is very experienced with OpenLayers.

The pull request shows the effort it takes to make raster data work with MapLibre. In OpernLayers, you just use the GeoTIFF source (or GeoZarr), add your desired styles, and are done - including the possibility to interact with the underlying data (get band values etc.).

And finally, since I'm "the OpenLayers guy", I have a strong interest in OpenLayers being used.

That said, I'm not in favor of replacing OpenLayers with MapLibre here.

@m-mohr
Copy link
Copy Markdown
Collaborator

m-mohr commented Apr 20, 2026

@ahocevar For context, the app is loading the PMTiles very slow in some areas of the map with very dense fields, for example. https://fieldsofthe.world/ftw-inference-app/dev/#map=10.52/84.6538/24.0556/mode:global/threshold:0.3/year:2025

Caleb is saying that his app with MapLibre renders it much faster, thus created a PR for it over the weekend.

Can we improve the situatiuon on the OpenLayers side to render faster?

Personally, I think we should first optimize the PMTiles files because a tile with 10+MB is not a good choice in any case. On slower connections your browser may not freeze up, but the transfer is then the bottleneck and we should also care for this. So I think we should only integrate an additional mapping library (that someone needs to maintain, who's doing it?) if we can't optimize ol/ol-pmtiles/the PMTiles files enough to get it fast enough.

I also don't see any crashes happening with different browsers and computers, it just loads slower for me. That should be improved, no question, but I think the approach should be different than proposed in this PR.

Copy link
Copy Markdown
Collaborator

@m-mohr m-mohr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just ran it, and there are a couple of issues with this in comparison to the existing version:

  • The agreed switch between COG (aggregated values) + PMTiles (fields) was 10 (on OL), here it changes to the fields later. The data loads faster in MapLibre due to that, it just loads less data (probably level 11, not 10). It seems there's a disparity between MapLibre and OpenLayer with regards what zoom level 10 exactly means. See the screenshot attached, both libraries claim to be at ~10.2x and they switch roughly at that time in both cases, but show significantly different AOIs.
    grafik
    We could also switch to loading the fields later in OpenLayers to improve performance. Is that switch wanted or was that an unintentional side effect? Then this PR should probably be changed to load the data also earlier and we'd have to check what the performance gain is then (if any). (Thanks to @ahocevar in this interesting lecture about zoom levels in mapping libraries.)
  • There is no permalink for the view anymore, so sharing specific views is not possible anymore
  • A comparison between custom inference run and global predictions is not available any more.
  • The geocoding search is missing, no country boundaries, no labels, no switch between years.
  • The attribution for the S2 cloudless layer is not correct. We were specifically asked by EOX to correct it according to their TOS, so this is not optional.
  • No feedback mechanism.

Not sure whether this PR was meant to be a full replacement already or a draft and was meant to be improved to get the full functionality back. It is not in draft mode, thus not sure.

I think such a big change just two days before release is risky.

@m-mohr m-mohr marked this pull request as draft April 20, 2026 13:57
@calebrob6 calebrob6 closed this Apr 20, 2026
@m-mohr m-mohr deleted the gobrrrrrrrrrrr branch April 23, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants