-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
68,018 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
*.iml | ||
postgis/postgresql_data/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
cd # go to home directory for permisson reasons (/var/lib/postgresql) | ||
if [ ! -f /var/lib/postgresql/airports.csv ]; then | ||
wget https://ourairports.com/data/airports.csv # download the file | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
CREATE TABLE airports | ||
( | ||
gid serial NOT NULL, | ||
ourairports_id integer, | ||
ident varchar(16), | ||
"type" varchar(32), | ||
"name" varchar(255), | ||
lat decimal, | ||
lon decimal, | ||
elevation smallint, | ||
continent varchar(2), | ||
iso_country varchar(2), | ||
iso_region varchar(8), | ||
municipality varchar(64), | ||
scheduled_service boolean, | ||
gps_code varchar(4), | ||
iata_code varchar(3), | ||
local_code varchar(8), | ||
homepage varchar(255), | ||
wikipedia varchar(255), | ||
keywords text, | ||
the_geom geometry(Point, 4326), | ||
CONSTRAINT airports_pkey PRIMARY KEY (gid), | ||
CONSTRAINT enforce_dims_the_geom CHECK (st_ndims(the_geom) = 2), | ||
CONSTRAINT enforce_geotype_geom CHECK (geometrytype(the_geom) = 'POINT'::text OR the_geom IS NULL), | ||
CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = 4326) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
copy airports( | ||
ourairports_id, | ||
ident, | ||
"type", | ||
"name", | ||
lat, | ||
lon, | ||
elevation, | ||
continent, | ||
iso_country, | ||
iso_region, | ||
municipality, | ||
scheduled_service, | ||
gps_code, | ||
iata_code, | ||
local_code, | ||
homepage, | ||
wikipedia, | ||
keywords | ||
) FROM '/var/lib/postgresql/airports.csv' DELIMITERS ',' CSV HEADER; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
UPDATE airports SET the_geom = ST_GeomFromText('POINT(' || lon || ' ' || lat || ')', 4326); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CREATE INDEX airports_the_geom_gist | ||
ON airports | ||
USING gist | ||
(the_geom); |
Large diffs are not rendered by default.
Oops, something went wrong.