GEOG 868: Jen and Barry's Site Selection
In Lesson 4 of GEOG 868 I completed a site selection using PostGIS.
In Lesson 4 of GEOG 868 I completed a site selection using PostGIS.
In Lesson 3 of GEOG 868 I played around with PostgreSQL and PostGIS for the first time. For the project at the end you are given a class_roster.txt
file that contains a list of students and their postal codes. The task was to join that with data provided earlier in the lesson and then plot the students’ locations on a map in QGIS. Here’s how I went about doing that.
It is possible to create a table in an SQLite database where the columns have no type.
For example, the columns in this STATS
table have no type specified:
sqlite> PRAGMA TABLE_INFO('STATS');
cid name type notnull dflt_value pk
--- --------- ---- ------- ---------- --
0 PLAYER_ID 0 0
1 YEAR 0 0
2 TEAM 0 0
3 AB 0 0
4 HITS 0 0
5 HR 0 0
6 RBI 0 0
This doesn’t seem to make much of a difference if you are storing strings / text data, and writing queries to retrieve things based on those strings.
However, if you are storing numbers, then you’ll notice a problem if you try queries like this:
In the last week I got stuck into GEOG 868 (the Pennsylvania State University Spatial Database Management course I mentioned last week). I started off with a bit of an SQL refresher via SQLBolt and some SQLZOO, then cracked on with GEOG 868 Lesson 1.