Building a Geospatial Server with BBOX Server

About BBOX Server Have you heard of the geospatial tool called BBOX Server? I was introduced to this tool by Kanahiro Iguchi after FOSS4G 2023 Prizren last year, and I've been curious about it ever since. BBOX Server is an open-source composable geospatial service that provides multiple components, including features, maps, tiles, assets, processes, and routing, that conform to OGC API standards. It has a built-in high-performance HTTP server, so it can efficiently process both static and dynamic location information data. It also implements QGIS Server, which previously required much effort to build, in an easy-to-use format. It supports a variety of data sources and formats, and it is also possible to use PostgreSQL (PostGIS). Components of BBOX Server There are currently six components in the BBOX Server. Presentation materials from FOSS4G 2023 Prizren 1. BBOX feature server This component provides geospatial data that conforms to the OGC API Features standard. It enables efficient data distribution, flexible filtering, and spatial searches via RESTful endpoints. 2. BBOX Map server This component generates and provides maps that conform to the OGC API Maps standard. It uses QGIS Server as a backend and supports OGC WMS 1.3 and OGC API Maps. It provides map tile and image rendering. 3. BBOX Tile server This is a geospatial data provisioning component that conforms to the OGC API Tiles standard and streamlines the delivery of raster tiles and vector tiles. It provides flexible tiles that utilize PMTiles, MBTiles, and QGIS Server. 4. BBOX Asset server This is an integrated file server that delivers static files and templates. It provides assets such as fonts, styles, and sprites. 5. BBOX Processes server This is a geographic processing task execution platform that conforms to the OGC API Processes standard. It supports synchronous and asynchronous processes and can execute various geographic analysis tasks via RESTful endpoints. 6. BBOX Routing server This experimental component provides a routing service that conforms to OGC API Routing (experimental). It provides a routing calculation function via a RESTful interface. In this article, I tried the "BBOX Map server" and "BBOX Tile server." Advance Preparation Preparing sample data The following was used as sample data in this article. I prepared a QGIS project file that combined my point, line, and polygon data with convenience store data from OpenStreetMap. Labels are also displayed during verification. sample data I also used PLATEAU data converted to PMTiles provided in the shi-works repository. As this data is large, please download it manually if you wish to use it. Store this data in an arbitrary directory. bbox_server ├── assets │ ├── plateau.pmtiles │ ├── pointdata.geojson │ ├── sample.gpkg │ └── sapporo.qgz └── bbox.toml Creating the configuration file To use BBOX Server, you can customize it in various ways by editing the configuration file called "bbox.toml". This article has created sample configuration files for WMS, raster tile, and vector tile distribution servers. You can find more details about this in the documentation. bbox.toml [mapserver.qgis_backend] # QGIS Server settings project_basedir = "assets" qgs.path = "/qgis" qgz.path = "/qgz" [[tileset]] # Raster tiles settings name = "sapporo" map_service = { project = "sapporo", suffix = "qgz", layers = "all" } [[tileset]] # Vector tiles settings name = "plateau" pmtiles = { path = "assets/plateau.pmtiles" } Building BBOX Server Installation & Startup First, install the BBOX Server. In this case, we will use Docker to start it locally. You can try out all the functions using the Docker image called "sourcepole/bbox-server-qgis." Move to the directory you prepared in the preliminary preparation, and start the BBOX Server. When it starts, the sample data and bbox.toml will be automatically placed. docker run -p 8080:8080 -v $PWD/bbox.toml:/var/www/bbox.toml:ro -v $PWD/assets:/var/www/assets:ro sourcepole/bbox-server-qgis After starting up, access "http://localhost:8080". If the BBOX Server top page is displayed, it is OK. Delivering in WMS format with QGIS Server Next, we will deliver in WMS format with QGIS Server and display in QGIS. This can also be used in WebGIS applications. Set the following URL in the WMS menu. http://localhost:8080/qgz/sapporo You can distribute in WMS format while maintaining the style of the QGIS project file. Distribute in raster tile format using QGIS Server Next, distribute in raster tile format using QGIS Server and display in QGIS. This can also be used in WebGIS applications. Set the following URL in the raster tile menu. http://localhost:8080/xyz/sapporo/{z}/{x}/{y}.png The data is distributed in raster tile format using the QGIS project file style. Distribute in vector t

Jan 13, 2025 - 12:06
 0
Building a Geospatial Server with BBOX Server

About BBOX Server

img

Have you heard of the geospatial tool called BBOX Server?

I was introduced to this tool by Kanahiro Iguchi after FOSS4G 2023 Prizren last year, and I've been curious about it ever since.

BBOX Server is an open-source composable geospatial service that provides multiple components, including features, maps, tiles, assets, processes, and routing, that conform to OGC API standards. It has a built-in high-performance HTTP server, so it can efficiently process both static and dynamic location information data. It also implements QGIS Server, which previously required much effort to build, in an easy-to-use format. It supports a variety of data sources and formats, and it is also possible to use PostgreSQL (PostGIS).

Components of BBOX Server

There are currently six components in the BBOX Server.

img

Presentation materials from FOSS4G 2023 Prizren

1. BBOX feature server
This component provides geospatial data that conforms to the OGC API Features standard. It enables efficient data distribution, flexible filtering, and spatial searches via RESTful endpoints.

2. BBOX Map server
This component generates and provides maps that conform to the OGC API Maps standard. It uses QGIS Server as a backend and supports OGC WMS 1.3 and OGC API Maps. It provides map tile and image rendering.

3. BBOX Tile server
This is a geospatial data provisioning component that conforms to the OGC API Tiles standard and streamlines the delivery of raster tiles and vector tiles. It provides flexible tiles that utilize PMTiles, MBTiles, and QGIS Server.

4. BBOX Asset server
This is an integrated file server that delivers static files and templates. It provides assets such as fonts, styles, and sprites.

5. BBOX Processes server
This is a geographic processing task execution platform that conforms to the OGC API Processes standard. It supports synchronous and asynchronous processes and can execute various geographic analysis tasks via RESTful endpoints.

6. BBOX Routing server
This experimental component provides a routing service that conforms to OGC API Routing (experimental). It provides a routing calculation function via a RESTful interface.

In this article, I tried the "BBOX Map server" and "BBOX Tile server."

Advance Preparation

Preparing sample data

The following was used as sample data in this article.

I prepared a QGIS project file that combined my point, line, and polygon data with convenience store data from OpenStreetMap. Labels are also displayed during verification.

sample data

img

I also used PLATEAU data converted to PMTiles provided in the shi-works repository. As this data is large, please download it manually if you wish to use it.

img

Store this data in an arbitrary directory.

bbox_server
├── assets
│   ├── plateau.pmtiles
│   ├── pointdata.geojson
│   ├── sample.gpkg
│   └── sapporo.qgz
└── bbox.toml

Creating the configuration file

To use BBOX Server, you can customize it in various ways by editing the configuration file called "bbox.toml".

This article has created sample configuration files for WMS, raster tile, and vector tile distribution servers. You can find more details about this in the documentation.

bbox.toml

[mapserver.qgis_backend]
# QGIS Server settings
project_basedir = "assets"
qgs.path = "/qgis"
qgz.path = "/qgz"

[[tileset]]
# Raster tiles settings
name = "sapporo"
map_service = { project = "sapporo", suffix = "qgz", layers = "all" }

[[tileset]]
# Vector tiles settings
name = "plateau"
pmtiles = { path = "assets/plateau.pmtiles" }

Building BBOX Server

Installation & Startup

First, install the BBOX Server. In this case, we will use Docker to start it locally. You can try out all the functions using the Docker image called "sourcepole/bbox-server-qgis."

Move to the directory you prepared in the preliminary preparation, and start the BBOX Server. When it starts, the sample data and bbox.toml will be automatically placed.

docker run -p 8080:8080 -v $PWD/bbox.toml:/var/www/bbox.toml:ro -v $PWD/assets:/var/www/assets:ro sourcepole/bbox-server-qgis

After starting up, access "http://localhost:8080". If the BBOX Server top page is displayed, it is OK.

img

Delivering in WMS format with QGIS Server

Next, we will deliver in WMS format with QGIS Server and display in QGIS. This can also be used in WebGIS applications.

Set the following URL in the WMS menu.

http://localhost:8080/qgz/sapporo

img

img

You can distribute in WMS format while maintaining the style of the QGIS project file.

img

Distribute in raster tile format using QGIS Server

Next, distribute in raster tile format using QGIS Server and display in QGIS. This can also be used in WebGIS applications.

Set the following URL in the raster tile menu.

http://localhost:8080/xyz/sapporo/{z}/{x}/{y}.png

img

The data is distributed in raster tile format using the QGIS project file style.

img

Distribute in vector tile format using PMTiles

Finally, the data is distributed in vector tile format using PMTiles and displayed in QGIS. This can also be used in WebGIS applications.

Set the following URL in the vector tile menu.

http://localhost:8080/xyz/plateau/{z}/{x}/{y}.pbf

img

The sample data is distributed in vector tile format.

img

Related Articles

References
BBOX Server