Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Esri Vector Tile format & tileserver GL #6765

Closed
AnaBelgun opened this issue Apr 27, 2023 · 8 comments
Closed

Support for Esri Vector Tile format & tileserver GL #6765

AnaBelgun opened this issue Apr 27, 2023 · 8 comments
Assignees

Comments

@AnaBelgun
Copy link
Member

AnaBelgun commented Apr 27, 2023

This ticket is to record the work for supporting the Esri Vector Tile format.

@sixlighthouses
Copy link
Contributor

Initial testing of protomaps renderer was positive. However after looking into labelling and the current state of protomaps (no longer under active development) it was decided in discussion with Crispy to implement a new Mapbox Vector tiles imagery provider.

@AnaBelgun
Copy link
Member Author

Pete is working on setting up the tileserver GL to work with magda

@AnaBelgun AnaBelgun changed the title Support for Esri Vector Tile format Support for Esri Vector Tile format & tileserver GL May 9, 2023
@AnaBelgun
Copy link
Member Author

15 May 23:

  • protomaps is still in use for other vector tiles use case (e.g. GeoJSON)
  • Esri Vector Tiles is using MVT implementation
  • in dev atm; not production ready yet
  • next steps:
  1. work out the performance issues and scaling
  2. write up the updated version of what support Terria has for vector tiles

@sixlighthouses
Copy link
Contributor

sixlighthouses commented May 16, 2023

Protomaps, MVTs and Vectors Oh My

Overview

Currently we use ProtomapsImageryProvider to read several vector formats and rasterize them on the fly for use in Leaflet and Cesium viewers. This approach works well for rendering of geometry and very simple labelling. Modern Javascript map viewers however are tuned for rendering vectors directly and the Mapbox Vector Tile specification allows for complex and expressive labelling. nb: the ArcGIS Vector Tile protocol implements the Mapbox Vector Tile spec. ProtomapsImageryProvider was not made with complex labelling in mind, so therefore does not support the kind of visualisations required by customers such as NSW Digital Twin basemaps.

Cesium's github repo has an open issue since 2014 discussing the support of vector data see hereTo summarize that discussion -- using the approach taken by Protomaps and tileserver-gl is the only current option. It is acknowledged a better approach would be to render directly to the Cesium managed canvas but there are no plans for this work to be undertaken as yet.

Proposed Short Term Approach - tileserver-gl

tileserver-gl was developed by MapTiler to provide a server side solution to reading vector tiles and providing raster tiles on the fly. Configuration is used to point tileserver-gl to an MVT service as a datasource (in our current use case ArcGIS VectorTile services), tileserver-gl then proxies the requests to the datasource exposed to the client application as raster (png, wbp, jpg) {z}/{x}/{y} tiles. tileserver-gl uses MapLibre native to acheive this, therefore it does support the full MVT spec. We currently have a POC running in NSW Digital Twin Dev

3 of the basemaps in this Terria instance
- NSW Basemap Light Grey
- NSW Basemap Topographic
- NSW Basemap Hybrid
are implementing this approach.

This POC exposes 2 issues that need addressing before we publish to production
1. Performance -- tileserver-gl is running in Docker, some performance tuning is required to provide end users with an acceptable experience.
2. Maximum zoom scale -- as the ArcGIS Vector service does not return below zoom level 17, requests to tileserver-gl return blank tiles.

Alternate Solutions

  1. Extend ProtomapsImageryProvider to support full MVT spec -- at first this seemed the most straight forward. However to build on the current approach would be a complex piece of work and may lead to ongoing maintenance of the code as viewers and the MVT evolve. Additionally the maintainer of Protomaps is no longer working on the project and has in several issues pointed users to other solutions for more complex uses of vector data.
  2. Create new MVTImageryProvider base on tileserver-gl approach -- provides full implementation of MVT spec. Medium complexity task, would also lead to ongoing maintenance.
  3. Swap out Leaflet for MapLibre (or similar) map viewer that natively supports use of Vectors. High complexity inital task to remove use of Leaflet. Longer term benefits as use of vector data provides better end user experience. Also does not solve the issue for Cesium.

@TerriaJS TerriaJS deleted a comment from techmavengeospatial May 16, 2023
@sixlighthouses
Copy link
Contributor

Setting maximumLevel trait on the url-template layer alleviates the issue of blank tiles being generated below zoom level 17 -- change made and testable in dev

@AnaBelgun
Copy link
Member Author

Update 24 May:

  • not yet rolled up into Prod

@AnaBelgun
Copy link
Member Author

2 June 2023:

  • Server is in production now

@sixlighthouses
Copy link
Contributor

Summary for NSW DT

Terria.js has chosen TileServer as its preferred tool for rendering vector tiles, including support for ArcGIS Vector services. TileServer is an open-source map server contributed to the geospatial community by MapTiler. TileServer's robust caching mechanisms and optimized rendering algorithms ensure efficient rendering of vector data with complex styling, enabling Terria.js to deliver fast and responsive maps to NSW Digital Twin users. By leveraging TileServer's compatibility with various vector tile formats, including ArcGIS Vector Tiles, Terria.js offers an enhanced mapping experience that empowers users to explore and utilize the geospatial data provided by the NSW government effectively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants