3 个版本

新版本 0.6.1 2024年8月23日
0.6.0 2024年8月9日
0.6.0-beta12024年8月8日

#125 in 地理空间

Download history 211/week @ 2024-08-05 21/week @ 2024-08-12

232 每月下载量
bbox-server 中使用

MIT/Apache

165KB
4K SLoC

BBOX OGC API Features 服务

异步 OGC API Features 服务器实现。

功能

  • OGC API - Features - Part 1: Core 1.0
  • OGC API - Features - Part 2: Coordinate Reference Systems by Reference 1.0
  • OpenAPI 端点
  • 内置存储后端:PostGIS、GeoPackage
  • 输出格式:GeoJSON

配置

数据源

[[datasource]]
name = "t_rex_tests"
[datasource.postgis]
url = "postgresql://t_rex:[email protected]:5439/t_rex_tests"

[[datasource]]
name = "ne_extracts"
[datasource.gpkg]
path = "assets/ne_extracts.gpkg"

自动检测的集合

[[collections.postgis]]
url = "postgresql://t_rex:[email protected]:5439/t_rex_tests"

[[collections.directory]]
dir = "assets"

集合

[[collection]]
name = "populated_places"
title = "populated places"
description = "Natural Earth populated places"
[collection.gpkg]
datasource = "ne_extracts"
table = "ne_10m_populated_places"

使用自定义 SQL 查询

[[collection]]
name = "populated_places_names"
title = "populated places names"
description = "Natural Earth populated places"
[collection.gpkg]
datasource = "ne_extracts"
sql = "SELECT fid, name, geom FROM ne_10m_populated_places"
geometry_field = "geom"
fid_field = "fid"

使用方法

使用 bbox.toml 配置运行特征服务器

cargo run serve

或使用自定义配置

cargo run -- --config=bbox-pg.toml serve

检查集合

x-www-browser http://127.0.0.1:8080/collections

功能请求

curl -s http://127.0.0.1:8080/collections/populated_places/items | jq .

curl -s http://127.0.0.1:8080/collections/populated_places_names/items/2 | jq .

依赖项

~88MB
~1.5M SLoC