Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
871d2d3
Add TippecanoeService and install tippecanoe in worker image
nathanfranklin Jul 1, 2026
8cf68cd
Add VectorService.convert_to_geojson for vector file conversion
nathanfranklin Jul 2, 2026
697371c
Route vector file uploads through tippecanoe to PMTiles
nathanfranklin Jul 3, 2026
26cf130
Remove orphaned process_shapefile
nathanfranklin Jul 3, 2026
5bff97d
Fix vector PMTiles rendering end-to-end
nathanfranklin Jul 6, 2026
f860185
Fix comment
nathanfranklin Jul 7, 2026
c2f6272
Change tippecanoe params and log output
nathanfranklin Jul 7, 2026
4345416
Keep vector features visible at all zoom levels
nathanfranklin Jul 7, 2026
76f646b
Connect current system and path with vector feature
nathanfranklin Jul 22, 2026
ea41afc
Drop gpkg until we have a plan with styles
nathanfranklin Jul 24, 2026
5984bef
Merge branch 'main' into task/WG-321-fix-importing-for-geojson-shapef…
nathanfranklin Jul 24, 2026
1b4222f
Drop test and update comment
nathanfranklin Jul 24, 2026
8a3f5f2
Create and provide nightly public pmtiles archive for published DS maps
nathanfranklin Jul 29, 2026
3bc04fd
Fix comments
nathanfranklin Jul 29, 2026
1487221
Fix imports and formatting
nathanfranklin Jul 29, 2026
0730e22
Merge branch 'task/WG-321-fix-importing-for-geojson-shapefiles' into …
nathanfranklin Jul 29, 2026
9c1b8c5
Fix formatting
nathanfranklin Jul 29, 2026
4a3148c
Tweak tiling setting
nathanfranklin Jul 29, 2026
eebcbc7
Make leaner tiles via drop-densest and low-zoom simplification
nathanfranklin Jul 29, 2026
e8fbcde
slim feature props; move COG footprints to cogs.geojson
nathanfranklin Jul 30, 2026
0e04d9d
Move COG/vector layers to companion geojson; slim tile props
nathanfranklin Jul 30, 2026
1678f24
Merge branch 'main' into task/WG-703-public-designsafe-pmtiles
nathanfranklin Jul 31, 2026
a2f114b
Fix formatting
nathanfranklin Jul 31, 2026
cae117c
Skip large cogs/rectangles from PRJ-6361
nathanfranklin Jul 31, 2026
a919dc9
Fix skipping
nathanfranklin Jul 31, 2026
86494f4
add /assets/public location
nathanfranklin Aug 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions devops/local_conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ http {
~*file:///assets/([0-9]+)/ $1; # e.g. ?url=file:///assets/3/...
default "";
}

# Cache-Control for the public area: the versioned .pmtiles archives and their
# companion layer .geojson are immutable so can be cached hard; manifest.json
# changes nightly so it revalidates.
map $uri $public_asset_cache_control {
~*\.pmtiles$ "public, max-age=31536000, immutable";
~*\.geojson$ "public, max-age=31536000, immutable";
default "no-cache";
}
server {
include /etc/nginx/mime.types;
client_max_body_size 1g;
Expand Down Expand Up @@ -54,6 +63,41 @@ http {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

# Assets available to everyone -- currently only the PMTiles archive of
# all published DesignSafe projects (WG-703). A separate block from
# `location /assets` so it skips that block's auth_request.
location /assets/public/ {
alias /assets/public/;

# .pmtiles/.geojson aren't in the default mime.types; the consumer keys off them
types {
application/vnd.pmtiles pmtiles;
application/geo+json geojson;
application/json json;
}
default_type application/octet-stream;

gzip off;
add_header Accept-Ranges bytes always;

add_header Cache-Control $public_asset_cache_control always;

add_header Access-Control-Allow-Origin * always;
add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS" always;
add_header Access-Control-Allow-Headers "Range" always;
add_header Access-Control-Expose-Headers
"Content-Length, Content-Range, Accept-Ranges" always;

if ($request_method = OPTIONS) {
add_header Access-Control-Allow-Origin * always;
add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS" always;
add_header Access-Control-Allow-Headers "Range" always;
add_header Access-Control-Max-Age 86400 always;
add_header Content-Length 0 always;
return 204;
}
}

location /assets {
# Call geoapi to check access before serving file
auth_request /auth-check;
Expand Down
19 changes: 19 additions & 0 deletions geoapi/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from geoapi.models import User
from geoapi.routes import api_router
from geoapi.settings import settings
from geoapi.log import logger
from geoapi.db import litestar_sqlalchemy_config, managed_litestar_db_session
from geoapi.exceptions import (
InvalidGeoJSON,
Expand Down Expand Up @@ -296,8 +297,26 @@ async def retrieve_session_user_handler(
}


def _enqueue_published_ds_maps_cold_start(_app: "Litestar") -> None:
"""On startup, enqueue an initial published-DS-maps build if none exists yet."""
# tests exercise the full app lifespan via TestClient; don't auto-enqueue a
# real task (which would hit the live DesignSafe API) during the test run
if settings.APP_ENV == "testing":
return
from geoapi.tasks.published_ds_maps import enqueue_generation_if_missing

try:
enqueue_generation_if_missing()
except Exception:
# never let a cold-start convenience break app startup
logger.exception(
"Cold-start enqueue of published-DS-maps generation failed; continuing."
)


app = Litestar(
route_handlers=[api_router],
on_startup=[_enqueue_published_ds_maps_cold_start],
middleware=[
logging_middleware_config.middleware,
cookie_session_config.middleware,
Expand Down
6 changes: 6 additions & 0 deletions geoapi/celery_app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from celery import Celery
from celery.schedules import crontab
from datetime import timedelta
from geoapi.settings import settings

Expand Down Expand Up @@ -26,6 +27,7 @@
"geoapi.tasks.projects",
"geoapi.tasks.external_data",
"geoapi.tasks.file_location_check",
"geoapi.tasks.published_ds_maps",
)

# Define the queues
Expand Down Expand Up @@ -58,4 +60,8 @@
"task": "geoapi.tasks.external_data.refresh_projects_watch_users",
"schedule": timedelta(minutes=30),
},
"generate_published_ds_maps_pmtiles": {
"task": "geoapi.tasks.published_ds_maps.generate_published_ds_maps_pmtiles",
"schedule": crontab(hour=3, minute=0),
},
}
Loading
Loading