Skip to content

Commit

Permalink
Rename data directory to assets
Browse files Browse the repository at this point in the history
  • Loading branch information
pka committed Jun 23, 2023
1 parent 34ccfb4 commit 87c8e5e
Show file tree
Hide file tree
Showing 26 changed files with 36 additions and 38 deletions.
1 change: 1 addition & 0 deletions data/.gitignore → assets/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/download
/maputnik
/*.bin
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions bbox-feature-server/src/datasource/gpkg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ mod tests {

#[tokio::test]
async fn gpkg_content() {
let pool = GpkgDatasource::new_pool("../data/ne_extracts.gpkg")
let pool = GpkgDatasource::new_pool("../assets/ne_extracts.gpkg")
.await
.unwrap();
let collections = pool.collections().await.unwrap();
Expand All @@ -264,7 +264,7 @@ mod tests {
#[tokio::test]
async fn gpkg_features() {
let filter = FilterParams::default();
let ds = GpkgDatasource::new_pool("../data/ne_extracts.gpkg")
let ds = GpkgDatasource::new_pool("../assets/ne_extracts.gpkg")
.await
.unwrap();
let info = GpkgCollectionInfo {
Expand Down
2 changes: 1 addition & 1 deletion bbox-feature-server/src/inventory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ mod tests {

#[tokio::test]
async fn inventory_scan() {
let inventory = Inventory::scan(&DatasourceCfg::from_path("../data")).await;
let inventory = Inventory::scan(&DatasourceCfg::from_path("../assets")).await;
// assert_eq!(inventory.collections().len(), 3);
assert!(inventory.collections().len() >= 3);
assert_eq!(
Expand Down
9 changes: 3 additions & 6 deletions bbox-map-server/src/wms_capabilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ mod test {

#[test]
fn umn() {
let s = r##"
<?xml version='1.0' encoding="UTF-8" standalone="no" ?>
let s = r##"<?xml version='1.0' encoding="UTF-8" standalone="no" ?>
<WMS_Capabilities version="1.3.0" xmlns="http://www.opengis.net/wms" xmlns:sld="http://www.opengis.net/sld" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ms="http://mapserver.gis.umn.edu/mapserver" xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd http://mapserver.gis.umn.edu/mapserver http://localhost/cgi-bin/mapserv?service=WMS&amp;version=1.3.0&amp;request=GetSchemaExtension">
<!-- MapServer version 7.4.3 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=RSVG SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS SUPPORTS=PBF INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE -->
Expand Down Expand Up @@ -338,8 +337,7 @@ mod test {

#[test]
fn qgis() {
let s = r##"
<?xml version="1.0" encoding="utf-8"?>
let s = r##"<?xml version="1.0" encoding="utf-8"?>
<WMS_Capabilities xmlns:sld="http://www.opengis.net/sld" version="1.3.0" xmlns="http://www.opengis.net/wms" xmlns:qgs="http://www.qgis.org/wms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd http://www.qgis.org/wms http://127.0.0.1:8080/wms/qgs/ne?SERVICE=WMS&amp;REQUEST=GetSchemaExtension">
<Service>
<Name>WMS</Name>
Expand Down Expand Up @@ -641,8 +639,7 @@ mod test {

#[test]
fn qgis_getprojectsettings() {
let s = r##"
<?xml version="1.0" encoding="utf-8"?>
let s = r##"<?xml version="1.0" encoding="utf-8"?>
<WMS_Capabilities xsi:schemaLocation="http://www.opengis.net/wms http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd http://www.qgis.org/wms http://127.0.0.1:8080/wms/qgs/ne?SERVICE=WMS&amp;REQUEST=GetSchemaExtension" xmlns="http://www.opengis.net/wms" xmlns:sld="http://www.opengis.net/sld" version="1.3.0" xmlns:qgs="http://www.qgis.org/wms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Service>
<Name>WMS</Name>
Expand Down
2 changes: 1 addition & 1 deletion bbox-routing-server/src/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ mod tests {

#[actix_web::test]
async fn test_route() -> Result<(), Error> {
let router = Router::from_gpkg("../data/railway-test.gpkg", "flows", "geom")
let router = Router::from_gpkg("../assets/railway-test.gpkg", "flows", "geom")
.await
.unwrap();
let app = test::init_service(
Expand Down
2 changes: 1 addition & 1 deletion bbox-routing-server/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ mod tests {

#[tokio::test]
async fn chgraph() {
let router = Router::from_gpkg("../data/railway-test.gpkg", "flows", "geom")
let router = Router::from_gpkg("../assets/railway-test.gpkg", "flows", "geom")
.await
.unwrap();

Expand Down
8 changes: 4 additions & 4 deletions bbox-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ Configuraton is read from `bbox.toml` and environment variables.

[[assets.static]]
# Static file serving
# Env var example: BBOX_ASSETS__STATIC='[{dir="data",path="data"}]'
# ./data/* -> http://localhost:8080/data/
# dir = "./data"
# path = "data"
# Env var example: BBOX_ASSETS__STATIC='[{dir="assets",path="assets"}]'
# ./assets/* -> http://localhost:8080/assets/
# dir = "./assets"
# path = "/assets"

[[assets.repo]]
# QGIS plugin repository
Expand Down
12 changes: 6 additions & 6 deletions bbox-tile-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Tile requests:

Run tile server without configuration:

cargo run -- serve ../data/liechtenstein.mbtiles
cargo run -- serve ../assets/liechtenstein.mbtiles

curl -o /tmp/tile.mvt http://localhost:8080/xyz/liechtenstein/14/8621/5759.mvt

Expand All @@ -70,7 +70,7 @@ Style JSON requests:

Map viewer examples:

x-www-browser http://127.0.0.1:8080/data/usergrid.html?debug=1
x-www-browser http://127.0.0.1:8080/assets/usergrid.html?debug=1

Map viewer template examples:

Expand Down Expand Up @@ -132,14 +132,14 @@ Stop MinIO:
### Using Maputnik for MVT styling

* Download latest public.zip from https://github.com/maputnik/editor/releases
* Unpack into ../data/ and rename public to maputnik
* Unpack into ../assets/ and rename public to maputnik

Open example:

http://localhost:8080/data/maputnik/index.html?style=http://localhost:8080/data/maplibre-style.json
http://localhost:8080/data/maputnik/index.html#11.0/47.0944/9.5076
http://localhost:8080/assets/maputnik/index.html?style=http://localhost:8080/assets/maplibre-style.json
http://localhost:8080/assets/maputnik/index.html#11.0/47.0944/9.5076

http://localhost:8080/data/maputnik/index.html?style=http://localhost:8080/xyz/mbtiles_mvt_fl.style.json
http://localhost:8080/assets/maputnik/index.html?style=http://localhost:8080/xyz/mbtiles_mvt_fl.style.json


### S3 upload benchmarks
Expand Down
26 changes: 13 additions & 13 deletions bbox.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ path = "/metrics"
#agent_endpoint = "localhost:6831"

[[datasource.directory]]
dir = "../data"
dir = "../assets"

#[[datasource.postgis]]
#url = "postgresql://t_rex:t_rex@127.0.0.1:5439/t_rex_tests"

[[assets.static]]
# Static file serving
# Env var example: BBOX_ASSETS__STATIC='[{dir="data",path="/data"}]'
# ./data/* -> http://localhost:8080/data/
dir = "./data"
path = "/data"
# Env var example: BBOX_ASSETS__STATIC='[{dir="assets",path="/assets"}]'
# ./assets/* -> http://localhost:8080/assets/
dir = "./assets"
path = "/assets"

[[assets.template]]
# Template file serving
Expand All @@ -61,15 +61,15 @@ path = "/qgisrepo"
[mapserver.qgis_backend]
# QGIS Server settings
# Environment variable prefix: BBOX_MAPSERVER__QGIS_BACKEND__
project_basedir = "../data" # Base dir for project files (.qgs, .qgz)
qgs.path = "/qgis" # WMS URL base path
qgz.path = "/qgz" # WMS URL base path
project_basedir = "../assets" # Base dir for project files (.qgs, .qgz)
qgs.path = "/qgis" # WMS URL base path
qgz.path = "/qgz" # WMS URL base path

[mapserver.umn_backend]
# UMN MapServer settings
# Environment variable prefix: BBOX_MAPSERVER__UMN_BACKEND__
project_basedir = "../data" # Base dir for project files (.map)
path = "/wms/map" # WMS URL base path
project_basedir = "../assets" # Base dir for project files (.map)
path = "/wms/map" # WMS URL base path

#[mapserver.mock_backend]
# Enable FCGI mockup backend (for testing)
Expand All @@ -85,14 +85,14 @@ path = "/wms/map" # WMS URL base path

#[[routing.service]]
#profile = "railway"
#gpkg = "../data/railway-test.gpkg"
#gpkg = "../assets/railway-test.gpkg"
#table = "flows"
#geom = "geom"

# -- custom grids --

[[tileserver.grid]]
json = "../data/custom-grid-lv95.json"
json = "../assets/custom-grid-lv95.json"

# -- tile source provider configuration --

Expand Down Expand Up @@ -140,4 +140,4 @@ params = "transparent=true"

[[tileserver.tileset]]
name = "mbtiles_mvt_fl"
mbtiles = { path = "../data/liechtenstein.mbtiles" }
mbtiles = { path = "../assets/liechtenstein.mbtiles" }
4 changes: 2 additions & 2 deletions docker/bbox/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ down:
docker compose --profile $(profile) down

loaddb:
#docker compose --profile processes run windmill_worker ogr2ogr -f PostgreSQL PG:'host=postgresql user=geodb password=$$PG_PASS dbname=geodb' /data/ne_extracts.gpkg
docker compose --profile processes run windmill_worker ogr2ogr -f PostgreSQL PG:"host=postgresql user=geodb dbname=geodb" /data/ne_extracts.gpkg
#docker compose --profile processes run windmill_worker ogr2ogr -f PostgreSQL PG:'host=postgresql user=geodb password=$$PG_PASS dbname=geodb' /assets/ne_extracts.gpkg
docker compose --profile processes run windmill_worker ogr2ogr -f PostgreSQL PG:"host=postgresql user=geodb dbname=geodb" /assets/ne_extracts.gpkg

resetdb:
docker stop bbox_postgresql_1
Expand Down
2 changes: 1 addition & 1 deletion docker/bbox/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
# - PGPASSWORD=$PG_PASS
volumes:
- ./bbox-full.toml:/var/www/bbox.toml:ro
- ../../data:/data
- ../../assets:/assets
- ../../plugins:/var/www/plugins:ro

postgresql:
Expand Down
2 changes: 1 addition & 1 deletion templates/maplibre.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<script>
var map = new maplibregl.Map({
container: 'map',
style: 'http://localhost:8080/data/{{ param }}-style.json',
style: 'http://localhost:8080/assets/{{ param }}-style.json',
center: [9.5076, 47.0944],
zoom: 11
});
Expand Down

0 comments on commit 87c8e5e

Please sign in to comment.