From 1e458ce87736a79b333d5e2f15beebfdaece9f91 Mon Sep 17 00:00:00 2001 From: Jasonfan28 Date: Thu, 5 Feb 2026 15:21:17 -0500 Subject: [PATCH 1/8] coomit --- __scripts__/bootstrap_data.sh | 6 ++++++ compose.yml | 20 +++++++------------- query02.sql | 9 +++++++++ query03.sql | 2 ++ query04.sql | 2 ++ query05.sql | 6 ++++++ query06.sql | 17 +++++++++++++++++ query07.sql | 17 +++++++++++++++++ query08.sql | 13 +++++++++++++ query09.sql | 10 ++++++++++ query10.sql | 6 ++++++ query11.sql | 3 +++ query12.sql | 4 ++++ query13.sql | 7 +++++++ query14.sql | 7 +++++++ 15 files changed, 116 insertions(+), 13 deletions(-) diff --git a/__scripts__/bootstrap_data.sh b/__scripts__/bootstrap_data.sh index 43526e13..14c4c770 100755 --- a/__scripts__/bootstrap_data.sh +++ b/__scripts__/bootstrap_data.sh @@ -3,6 +3,12 @@ set -e set -x +POSTGRES_HOST="localhost" +POSTGRES_PORT="5432" +POSTGRES_NAME="assignment1" +POSTGRES_USER="postgres" +POSTGRES_PASS='P123i,./g456' + SCRIPTDIR=$(readlink -f $(dirname $0)) DATADIR=$(readlink -f $(dirname $0)/../__data__) mkdir -p ${DATADIR} diff --git a/compose.yml b/compose.yml index 9837ac1f..37119444 100644 --- a/compose.yml +++ b/compose.yml @@ -2,14 +2,14 @@ services: db: image: postgis/postgis + ports: + - "5432:5432" environment: - POSTGRES_PASSWORD: postgres + POSTGRES_PASSWORD: P123i,./g456 + POSTGRES_DB: assignment1 healthcheck: # test: ["CMD-SHELL", "pg_isready -U postgres"] - test: [ - "CMD-SHELL", - 'psql -U postgres -d postgres -c "SELECT ST_Buffer( ST_SetSRID(''POINT(0 0)''::GEOMETRY, 4326), 1) AS geom ;"', - ] + test: [ "CMD-SHELL", 'psql -U postgres -d postgres -c "SELECT ST_Buffer( ST_SetSRID(''POINT(0 0)''::GEOMETRY, 4326), 1) AS geom ;"' ] interval: 5s timeout: 5s retries: 5 @@ -18,10 +18,7 @@ services: image: ghcr.io/weitzman-musa-geocloud/assignment01:main volumes: - .:/assignment01 - command: [ - "bash", "-c", - "cd /assignment01 && __entrypoints__/run_linter.sh -- ." - ] + command: [ "bash", "-c", "cd /assignment01 && __entrypoints__/run_linter.sh -- ." ] run-tests: image: ghcr.io/weitzman-musa-geocloud/assignment01:main @@ -36,7 +33,4 @@ services: POSTGRES_NAME: postgres volumes: - .:/assignment01 - command: [ - "bash", "-c", - "cd /assignment01 && npm install > /dev/null && __entrypoints__/run_tests.sh -- --rootDir /assignment01" - ] + command: [ "bash", "-c", "cd /assignment01 && npm install > /dev/null && __entrypoints__/run_tests.sh -- --rootDir /assignment01" ] diff --git a/query02.sql b/query02.sql index 2b7ad18b..5b63aaa1 100644 --- a/query02.sql +++ b/query02.sql @@ -10,6 +10,15 @@ */ -- Enter your SQL query here +select round( + (count_2022 - count_2021) * 100.0 / count_2021, + 2 +) as perc_change +from ( + select + (select count(*) from indego.trips_2021_q3) as count_2021, + (select count(*) from indego.trips_2022_q3) as count_2022 +) as counts diff --git a/query03.sql b/query03.sql index 83e9e369..5babeef6 100644 --- a/query03.sql +++ b/query03.sql @@ -6,3 +6,5 @@ */ -- Enter your SQL query here +select round(avg(duration), 2) as avg_duration +from indego.trips_2021_q3 diff --git a/query04.sql b/query04.sql index 8223f173..9f2996c9 100644 --- a/query04.sql +++ b/query04.sql @@ -6,3 +6,5 @@ */ -- Enter your SQL query here +select round(avg(duration), 2) as avg_duration +from indego.trips_2022_q3 diff --git a/query05.sql b/query05.sql index fba8f238..40de43b1 100644 --- a/query05.sql +++ b/query05.sql @@ -5,3 +5,9 @@ */ -- Enter your SQL query here +select max(duration) as max_duration +from ( + select duration from indego.trips_2021_q3 + union all + select duration from indego.trips_2022_q3 +) as all_trips diff --git a/query06.sql b/query06.sql index 1cb254bf..e9efea72 100644 --- a/query06.sql +++ b/query06.sql @@ -7,3 +7,20 @@ */ -- Enter your SQL query here +select + extract(year from start_time)::integer as trip_year, + extract(quarter from start_time)::integer as trip_quarter, + count(*) as num_trips +from indego.trips_2021_q3 +where duration < 600 +group by trip_year, trip_quarter + +union all + +select + extract(year from start_time)::integer as trip_year, + extract(quarter from start_time)::integer as trip_quarter, + count(*) as num_trips +from indego.trips_2022_q3 +where duration < 600 +group by trip_year, trip_quarter diff --git a/query07.sql b/query07.sql index 782eda5f..184c878e 100644 --- a/query07.sql +++ b/query07.sql @@ -6,6 +6,23 @@ */ -- Enter your SQL query here +select + extract(year from start_time)::integer as trip_year, + extract(quarter from start_time)::integer as trip_quarter, + count(*) as num_trips +from indego.trips_2021_q3 +where start_time::date != end_time::date +group by trip_year, trip_quarter + +union all + +select + extract(year from start_time)::integer as trip_year, + extract(quarter from start_time)::integer as trip_quarter, + count(*) as num_trips +from indego.trips_2022_q3 +where start_time::date != end_time::date +group by trip_year, trip_quarter diff --git a/query08.sql b/query08.sql index f35a9272..88e778c2 100644 --- a/query08.sql +++ b/query08.sql @@ -9,6 +9,19 @@ */ -- Enter your SQL query here +select + start_station as station_id, + st_point(start_lon, start_lat)::geography as station_geog, + count(*) as num_trips +from ( + select * from indego.trips_2021_q3 + union all + select * from indego.trips_2022_q3 +) as all_trips +where extract(hour from start_time) between 7 and 9 +group by start_station, start_lon, start_lat +order by num_trips desc +limit 5 /* diff --git a/query09.sql b/query09.sql index cc1d88d7..0eefde85 100644 --- a/query09.sql +++ b/query09.sql @@ -7,3 +7,13 @@ */ -- Enter your SQL query here +select + passholder_type, + count(*) as num_trips +from ( + select passholder_type from indego.trips_2021_q3 + union all + select passholder_type from indego.trips_2022_q3 +) as all_trips +group by passholder_type +order by num_trips desc diff --git a/query10.sql b/query10.sql index 56cd8442..df9da6bb 100644 --- a/query10.sql +++ b/query10.sql @@ -8,3 +8,9 @@ */ -- Enter your SQL query here +select + id as station_id, + geog as station_geog, + round(st_distance(geog, st_point(-75.192584, 39.952415)::geography) / 50) * 50 as distance +from indego.station_statuses +order by station_id diff --git a/query11.sql b/query11.sql index 36f6b65a..3d30ff62 100644 --- a/query11.sql +++ b/query11.sql @@ -5,3 +5,6 @@ */ -- Enter your SQL query here +select + round(avg(st_distance(geog, st_point(-75.192584, 39.952415)::geography)) / 1000) as avg_distance_km +from indego.station_statuses diff --git a/query12.sql b/query12.sql index 448ca091..e34d0bdf 100644 --- a/query12.sql +++ b/query12.sql @@ -6,3 +6,7 @@ */ -- Enter your SQL query here +select + count(*) as num_stations +from indego.station_statuses +where st_distance(geog, st_point(-75.192584, 39.952415)::geography) <= 1000 diff --git a/query13.sql b/query13.sql index ac9e192a..696c4b34 100644 --- a/query13.sql +++ b/query13.sql @@ -7,3 +7,10 @@ */ -- Enter your SQL query here +select + id as station_id, + name as station_name, + round(st_distance(geog, st_point(-75.192584, 39.952415)::geography) / 50) * 50 as distance +from indego.station_statuses +order by distance desc +limit 1 diff --git a/query14.sql b/query14.sql index e0396933..5bc60ab7 100644 --- a/query14.sql +++ b/query14.sql @@ -7,3 +7,10 @@ */ -- Enter your SQL query here +select + id as station_id, + name as station_name, + round(st_distance(geog, st_point(-75.192584, 39.952415)::geography) / 50) * 50 as distance +from indego.station_statuses +order by distance asc +limit 1 From ad1b5417303cbf748a03406a61fb8fd0c0c96175 Mon Sep 17 00:00:00 2001 From: Jasonfan28 Date: Sat, 7 Feb 2026 20:14:54 -0500 Subject: [PATCH 2/8] c --- __scripts__/bootstrap_data.sh | 8 +------- __scripts__/create_trip_tables.sql | 26 ++++++++++++++++++++++++++ __scripts__/script | 9 +++++++++ 3 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 __scripts__/script diff --git a/__scripts__/bootstrap_data.sh b/__scripts__/bootstrap_data.sh index 14c4c770..77d0c0a1 100755 --- a/__scripts__/bootstrap_data.sh +++ b/__scripts__/bootstrap_data.sh @@ -3,14 +3,8 @@ set -e set -x -POSTGRES_HOST="localhost" -POSTGRES_PORT="5432" -POSTGRES_NAME="assignment1" -POSTGRES_USER="postgres" -POSTGRES_PASS='P123i,./g456' - SCRIPTDIR=$(readlink -f $(dirname $0)) -DATADIR=$(readlink -f $(dirname $0)/../__data__) +DATADIR=$(readlink -f $(dirname $0)/__data__) mkdir -p ${DATADIR} # Download and unzip data (if not already downloaded) diff --git a/__scripts__/create_trip_tables.sql b/__scripts__/create_trip_tables.sql index 0d1317ee..550a6749 100644 --- a/__scripts__/create_trip_tables.sql +++ b/__scripts__/create_trip_tables.sql @@ -1,3 +1,4 @@ +-- Active: 1770507353299@@localhost@5432@assignment1 create schema if not exists indego; drop table if exists indego.trips_2021_q3; @@ -20,6 +21,12 @@ create table indego.trips_2021_q3 ( bike_type text ); +SET DateStyle = 'MDY'; +copy indego.trips_2021_q3 +from 'F:/Graduate School Stuff/Semester 4/Deep Learning/assignment01/__data__/indego-trips-2021-q3.csv' +with (format csv, header true); + + drop table if exists indego.trips_2022_q3; create table indego.trips_2022_q3 ( @@ -40,4 +47,23 @@ create table indego.trips_2022_q3 ( bike_type text ); +SET DateStyle = 'MDY'; +copy indego.trips_2022_q3 +from 'F:/Graduate School Stuff/Semester 4/Deep Learning/assignment01/__data__/indego-trips-2022-q3.csv' +with (format csv, header true); + + +drop table if exists indego.station_statuses; + +create table indego.station_statuses ( + id integer, + name text, + geog geography +); + + +copy indego.station_statuses +from 'F:/Graduate School Stuff/Semester 4/Deep Learning/assignment01/__data__/station_status.json' +with (format geojson); create extension if not exists postgis; + diff --git a/__scripts__/script b/__scripts__/script new file mode 100644 index 00000000..acda32d4 --- /dev/null +++ b/__scripts__/script @@ -0,0 +1,9 @@ +ogr2ogr \ +-f "PostgreSQL" \ +-nln "stations_geo" \ +-lco "SCHEMA=indego" \ +-lco "GEOM_TYPE=geography" \ +-lco "GEOMETRY_NAME=geog" \ +-lco "OVERWRITE=yes" \ +PG:"host=localhost port=5432 dbname=assignment1 user=postgres password='P123i,./g456'" \ +"F:/Graduate School Stuff/Semester 4/Deep Learning/assignment01/__data__/station-status.json" \ No newline at end of file From e125f45d8fd9c2c92c6be6bcf96e165dfeea6629 Mon Sep 17 00:00:00 2001 From: Jasonfan28 Date: Sat, 7 Feb 2026 21:41:07 -0500 Subject: [PATCH 3/8] cc --- __scripts__/create_trip_tables.sql | 13 ------------- __scripts__/script | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/__scripts__/create_trip_tables.sql b/__scripts__/create_trip_tables.sql index 550a6749..7d66c723 100644 --- a/__scripts__/create_trip_tables.sql +++ b/__scripts__/create_trip_tables.sql @@ -52,18 +52,5 @@ copy indego.trips_2022_q3 from 'F:/Graduate School Stuff/Semester 4/Deep Learning/assignment01/__data__/indego-trips-2022-q3.csv' with (format csv, header true); - -drop table if exists indego.station_statuses; - -create table indego.station_statuses ( - id integer, - name text, - geog geography -); - - -copy indego.station_statuses -from 'F:/Graduate School Stuff/Semester 4/Deep Learning/assignment01/__data__/station_status.json' -with (format geojson); create extension if not exists postgis; diff --git a/__scripts__/script b/__scripts__/script index acda32d4..48e062a6 100644 --- a/__scripts__/script +++ b/__scripts__/script @@ -6,4 +6,4 @@ ogr2ogr \ -lco "GEOMETRY_NAME=geog" \ -lco "OVERWRITE=yes" \ PG:"host=localhost port=5432 dbname=assignment1 user=postgres password='P123i,./g456'" \ -"F:/Graduate School Stuff/Semester 4/Deep Learning/assignment01/__data__/station-status.json" \ No newline at end of file +"/f/Graduate School Stuff/Semester 4/Deep Learning/assignment01/__data__/station_status.json" \ No newline at end of file From 9a0e956bacb4de7c09b2b6e68474730875418e25 Mon Sep 17 00:00:00 2001 From: Jasonfan28 Date: Tue, 10 Feb 2026 08:23:38 -0500 Subject: [PATCH 4/8] c --- query02.sql | 2 +- query06.sql | 4 ++-- query08.sql | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/query02.sql b/query02.sql index 5b63aaa1..2e7b3a61 100644 --- a/query02.sql +++ b/query02.sql @@ -13,7 +13,7 @@ select round( (count_2022 - count_2021) * 100.0 / count_2021, 2 -) as perc_change +) ::text || '%' as perc_change from ( select (select count(*) from indego.trips_2021_q3) as count_2021, diff --git a/query06.sql b/query06.sql index e9efea72..0e7caba8 100644 --- a/query06.sql +++ b/query06.sql @@ -12,7 +12,7 @@ select extract(quarter from start_time)::integer as trip_quarter, count(*) as num_trips from indego.trips_2021_q3 -where duration < 600 +where duration < 10 group by trip_year, trip_quarter union all @@ -22,5 +22,5 @@ select extract(quarter from start_time)::integer as trip_quarter, count(*) as num_trips from indego.trips_2022_q3 -where duration < 600 +where duration < 10 group by trip_year, trip_quarter diff --git a/query08.sql b/query08.sql index 88e778c2..fc15b360 100644 --- a/query08.sql +++ b/query08.sql @@ -11,7 +11,7 @@ -- Enter your SQL query here select start_station as station_id, - st_point(start_lon, start_lat)::geography as station_geog, + st_point(start_lon, start_lat)::geography as stations_geog, count(*) as num_trips from ( select * from indego.trips_2021_q3 From bc4182d09f4e1968858ce1983a82562b16b25206 Mon Sep 17 00:00:00 2001 From: Jasonfan28 Date: Tue, 10 Feb 2026 12:01:11 -0500 Subject: [PATCH 5/8] cc --- script_postgis.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 script_postgis.sql diff --git a/script_postgis.sql b/script_postgis.sql new file mode 100644 index 00000000..5a069fea --- /dev/null +++ b/script_postgis.sql @@ -0,0 +1,2 @@ + +CREATE EXTENSION postgis; From 201d16af03c2ea6b954aae68f43f7eee88407d90 Mon Sep 17 00:00:00 2001 From: Jasonfan28 Date: Tue, 10 Feb 2026 12:15:09 -0500 Subject: [PATCH 6/8] cc --- query10.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/query10.sql b/query10.sql index df9da6bb..4459b431 100644 --- a/query10.sql +++ b/query10.sql @@ -12,5 +12,5 @@ select id as station_id, geog as station_geog, round(st_distance(geog, st_point(-75.192584, 39.952415)::geography) / 50) * 50 as distance -from indego.station_statuses +from indego.stations_geo order by station_id From e512aca9fb8a49937bf09bc723b8754d78696450 Mon Sep 17 00:00:00 2001 From: Jasonfan28 Date: Tue, 10 Feb 2026 12:15:16 -0500 Subject: [PATCH 7/8] ccc --- query11.sql | 2 +- query12.sql | 2 +- query13.sql | 2 +- query14.sql | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/query11.sql b/query11.sql index 3d30ff62..ef8b4a50 100644 --- a/query11.sql +++ b/query11.sql @@ -7,4 +7,4 @@ -- Enter your SQL query here select round(avg(st_distance(geog, st_point(-75.192584, 39.952415)::geography)) / 1000) as avg_distance_km -from indego.station_statuses +from indego.stations_geo diff --git a/query12.sql b/query12.sql index e34d0bdf..674b9b18 100644 --- a/query12.sql +++ b/query12.sql @@ -8,5 +8,5 @@ -- Enter your SQL query here select count(*) as num_stations -from indego.station_statuses +from indego.stations_geo where st_distance(geog, st_point(-75.192584, 39.952415)::geography) <= 1000 diff --git a/query13.sql b/query13.sql index 696c4b34..e1b53d4c 100644 --- a/query13.sql +++ b/query13.sql @@ -11,6 +11,6 @@ select id as station_id, name as station_name, round(st_distance(geog, st_point(-75.192584, 39.952415)::geography) / 50) * 50 as distance -from indego.station_statuses +from indego.stations_geo order by distance desc limit 1 diff --git a/query14.sql b/query14.sql index 5bc60ab7..23547218 100644 --- a/query14.sql +++ b/query14.sql @@ -11,6 +11,6 @@ select id as station_id, name as station_name, round(st_distance(geog, st_point(-75.192584, 39.952415)::geography) / 50) * 50 as distance -from indego.station_statuses +from indego.stations_geo order by distance asc limit 1 From 9e48e057dc32e066d542929278c1dd21e3d83f93 Mon Sep 17 00:00:00 2001 From: Jasonfan28 Date: Wed, 18 Feb 2026 14:25:50 -0500 Subject: [PATCH 8/8] c --- __scripts__/create_trip_tables.sql | 5 ++--- query02.sql | 12 ++++++------ query06.sql | 4 ++-- query07.sql | 5 ++--- query08.sql | 2 +- query09.sql | 2 +- query10.sql | 2 +- query11.sql | 3 +-- query12.sql | 3 +-- query13.sql | 2 +- query14.sql | 2 +- script_postgis.sql | 1 - 12 files changed, 19 insertions(+), 24 deletions(-) diff --git a/__scripts__/create_trip_tables.sql b/__scripts__/create_trip_tables.sql index 7d66c723..4d575c4f 100644 --- a/__scripts__/create_trip_tables.sql +++ b/__scripts__/create_trip_tables.sql @@ -21,7 +21,7 @@ create table indego.trips_2021_q3 ( bike_type text ); -SET DateStyle = 'MDY'; +set DateStyle = 'MDY'; copy indego.trips_2021_q3 from 'F:/Graduate School Stuff/Semester 4/Deep Learning/assignment01/__data__/indego-trips-2021-q3.csv' with (format csv, header true); @@ -47,10 +47,9 @@ create table indego.trips_2022_q3 ( bike_type text ); -SET DateStyle = 'MDY'; +set DateStyle = 'MDY'; copy indego.trips_2022_q3 from 'F:/Graduate School Stuff/Semester 4/Deep Learning/assignment01/__data__/indego-trips-2022-q3.csv' with (format csv, header true); create extension if not exists postgis; - diff --git a/query02.sql b/query02.sql index 2e7b3a61..1948285e 100644 --- a/query02.sql +++ b/query02.sql @@ -10,18 +10,18 @@ */ -- Enter your SQL query here -select round( - (count_2022 - count_2021) * 100.0 / count_2021, - 2 -) ::text || '%' as perc_change +select + round( + (count_2022 - count_2021) * 100.0 / count_2021, + 2 + )::text || '%' as perc_change from ( - select + select (select count(*) from indego.trips_2021_q3) as count_2021, (select count(*) from indego.trips_2022_q3) as count_2022 ) as counts - /* If you want to get fancier here, you can cast the result to a string and concatenate a '%' to the end. For example: diff --git a/query06.sql b/query06.sql index 0e7caba8..ddbfd5b6 100644 --- a/query06.sql +++ b/query06.sql @@ -7,7 +7,7 @@ */ -- Enter your SQL query here -select +select extract(year from start_time)::integer as trip_year, extract(quarter from start_time)::integer as trip_quarter, count(*) as num_trips @@ -17,7 +17,7 @@ group by trip_year, trip_quarter union all -select +select extract(year from start_time)::integer as trip_year, extract(quarter from start_time)::integer as trip_quarter, count(*) as num_trips diff --git a/query07.sql b/query07.sql index 184c878e..5f37192b 100644 --- a/query07.sql +++ b/query07.sql @@ -6,7 +6,7 @@ */ -- Enter your SQL query here -select +select extract(year from start_time)::integer as trip_year, extract(quarter from start_time)::integer as trip_quarter, count(*) as num_trips @@ -16,7 +16,7 @@ group by trip_year, trip_quarter union all -select +select extract(year from start_time)::integer as trip_year, extract(quarter from start_time)::integer as trip_quarter, count(*) as num_trips @@ -25,7 +25,6 @@ where start_time::date != end_time::date group by trip_year, trip_quarter - /* Hint 1: when you cast a TIMESTAMP to a DATE the time component of the value is simply stripped off diff --git a/query08.sql b/query08.sql index fc15b360..294a7075 100644 --- a/query08.sql +++ b/query08.sql @@ -9,7 +9,7 @@ */ -- Enter your SQL query here -select +select start_station as station_id, st_point(start_lon, start_lat)::geography as stations_geog, count(*) as num_trips diff --git a/query09.sql b/query09.sql index 0eefde85..6d5f51ba 100644 --- a/query09.sql +++ b/query09.sql @@ -7,7 +7,7 @@ */ -- Enter your SQL query here -select +select passholder_type, count(*) as num_trips from ( diff --git a/query10.sql b/query10.sql index 4459b431..ec497b9d 100644 --- a/query10.sql +++ b/query10.sql @@ -8,7 +8,7 @@ */ -- Enter your SQL query here -select +select id as station_id, geog as station_geog, round(st_distance(geog, st_point(-75.192584, 39.952415)::geography) / 50) * 50 as distance diff --git a/query11.sql b/query11.sql index ef8b4a50..86b11017 100644 --- a/query11.sql +++ b/query11.sql @@ -5,6 +5,5 @@ */ -- Enter your SQL query here -select - round(avg(st_distance(geog, st_point(-75.192584, 39.952415)::geography)) / 1000) as avg_distance_km +select round(avg(st_distance(geog, st_point(-75.192584, 39.952415)::geography)) / 1000) as avg_distance_km from indego.stations_geo diff --git a/query12.sql b/query12.sql index 674b9b18..bb816224 100644 --- a/query12.sql +++ b/query12.sql @@ -6,7 +6,6 @@ */ -- Enter your SQL query here -select - count(*) as num_stations +select count(*) as num_stations from indego.stations_geo where st_distance(geog, st_point(-75.192584, 39.952415)::geography) <= 1000 diff --git a/query13.sql b/query13.sql index e1b53d4c..091e8bab 100644 --- a/query13.sql +++ b/query13.sql @@ -7,7 +7,7 @@ */ -- Enter your SQL query here -select +select id as station_id, name as station_name, round(st_distance(geog, st_point(-75.192584, 39.952415)::geography) / 50) * 50 as distance diff --git a/query14.sql b/query14.sql index 23547218..7b9b011c 100644 --- a/query14.sql +++ b/query14.sql @@ -7,7 +7,7 @@ */ -- Enter your SQL query here -select +select id as station_id, name as station_name, round(st_distance(geog, st_point(-75.192584, 39.952415)::geography) / 50) * 50 as distance diff --git a/script_postgis.sql b/script_postgis.sql index 5a069fea..8d9700b9 100644 --- a/script_postgis.sql +++ b/script_postgis.sql @@ -1,2 +1 @@ - CREATE EXTENSION postgis;