1
0
foss4g-workshop/init-scripts/01-init-database.sql
dracic a5d9e32d9b OSM vector tile server setup with postgis and tegola
- Set up docker-compose with PostgreSQL/PostGIS and Tegola services
- Added initialization scripts for database setup and OSM data import
- Configured Tegola with vector tile layers for roads and buildings
- Included README with setup instructions and troubleshooting guide
2025-07-14 18:33:45 +02:00

23 lines
793 B
SQL

-- Initialize OSM database with PostGIS and hstore extensions
-- This script runs automatically when PostgreSQL container starts for the first time
-- Connect to the osm database
\c osm;
-- Enable PostGIS extension
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS postgis_topology;
-- Enable hstore extension for key-value storage
CREATE EXTENSION IF NOT EXISTS hstore;
-- Grant necessary permissions
GRANT ALL PRIVILEGES ON DATABASE osm TO postgres;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO postgres;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO postgres;
-- Set up proper ownership
ALTER DATABASE osm OWNER TO postgres;
-- Display confirmation
SELECT 'OSM database initialized successfully with PostGIS and hstore extensions' AS status;