This project automates the retrieval, processing, and visualization of bathymetry (underwater topography) data for New Jersey. The Makefile automates data downloading, contour generation, and uploading to a PostGIS database, while the docker-compose file sets up the database and supporting services. Finally, a web-based visualization is created using MapLibre GL to display the bathymetry data on a map.
- Makefile: Manages downloading, processing, and uploading data.
- docker-compose.yml: Defines the environment, including a PostGIS database, Martin (tile server), and Node.js for visualization.
- basic-map/app.js: Implements a MapLibre GL map to visualize the bathymetry contours.
- Docker & Docker Compose: To orchestrate services (PostGIS, Martin, and Node).
- Make: For running the processing tasks.
To initiate the environment with PostgreSQL (PostGIS) and other services, run:
docker compose up -dThis will:
- Start a PostGIS-enabled PostgreSQL instance to store contour data.
- Start a Martin tile server to serve data as vector tiles.
- Start a Node.js server to serve the MapLibre-based web application.
Download bathymetry DEM data, generate contour data, and upload it to PostGIS:
make allThis sequence:
- Downloads TIFF files from the NOAA server.
- Generates contour GeoJSON from TIFF files using
gdal_contour. - Uploads GeoJSON to PostGIS using
ogr2ogr. - Optimizes the PostGIS table by indexing spatial data.
Access the MapLibre visualization at:
http://localhost:5173
The application displays:
- Base Map: Provided by CARTO dark map tiles.
- Bathymetry Contours: Colored contours representing underwater elevation, styled based on depth.
make all: Complete pipeline (data download, contour generation, upload to PostGIS, optimization).make clean: Clears intermediate files (contours and uploads).make clean_all: Removes all generated data.
- data/: Contains subdirectories for raw TIFF files, generated contours, and uploads.
- basic-map/: Holds the MapLibre app code.
- pgdata/: Stores PostGIS data (mounted in Docker).
- PostGIS (
postgis): Hosts the bathymetry contour data. - Martin (
martin): Tile server for vector tiles, accessible athttp://localhost:3000. - Node.js (
node): Serves the MapLibre visualization app.
To customize PostgreSQL settings, adjust POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB in docker-compose.yml.