38 lines
1.3 KiB
Bash
Executable File
38 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# Local Verification Script for Syria Landmarks
|
|
# To be run on the Mac terminal
|
|
|
|
set -e
|
|
|
|
echo "📊 --- Local Syria Data Audit ---"
|
|
|
|
# 1. Total Count
|
|
TOTAL=$(docker compose exec -T db psql -U mapuser -d mapdb -t -c "SELECT count(*) FROM places_syria;")
|
|
echo "📍 Total Landmarks: $TOTAL"
|
|
|
|
# 2. Category Distribution
|
|
echo "🗂️ Category Distribution:"
|
|
docker compose exec -T db psql -U mapuser -d mapdb -c "
|
|
SELECT category, count(*) as count
|
|
FROM places_syria
|
|
GROUP BY category
|
|
ORDER BY count DESC
|
|
LIMIT 10;
|
|
"
|
|
|
|
# 3. Spatial Bounds Check (Damascus region)
|
|
echo "🌍 Spatial Check (Damascus):"
|
|
DM_COUNT=$(docker compose exec -T db psql -U mapuser -d mapdb -t -c "
|
|
SELECT count(*) FROM places_syria
|
|
WHERE latitude BETWEEN 33.4 AND 33.6 AND longitude BETWEEN 36.2 AND 36.4;
|
|
")
|
|
echo "🏙️ Landmarks in Damascus area: $DM_COUNT"
|
|
|
|
# 4. Generate Export if user is satisfied
|
|
echo "💾 Generating SQL Export..."
|
|
docker compose exec -T db pg_dump -U mapuser -d mapdb -t places_syria --data-only --inserts > infrastructure/docker/postgis/syria_export.sql
|
|
|
|
echo "--------------------------------"
|
|
echo "✅ Verification complete. Export saved to: infrastructure/docker/postgis/syria_export.sql"
|
|
echo "If you are happy with the results, run sync_to_server.sh to push the data."
|