Skip to content
This repository has been archived by the owner on May 8, 2021. It is now read-only.

Commit

Permalink
update exercises to more generic problems
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonfarmer committed Nov 17, 2014
1 parent 99e033c commit 977e213
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 153 deletions.
12 changes: 6 additions & 6 deletions exercises/Plotting Great Circles in Python (Ans).ipynb

Large diffs are not rendered by default.

135 changes: 56 additions & 79 deletions exercises/Working with Projections in Python (Ans).ipynb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:86778562b6a37aad0f67bf9bd3791f895ab87ea0ee4b4f6141699c141198f424"
"signature": "sha256:f88a118baefbe109ddf2b29ff65dbe6f6504e8bd8c6baf4643a6f4ed02d73e60"
},
"nbformat": 3,
"nbformat_minor": 0,
Expand All @@ -15,9 +15,9 @@
"# Working with Projections in Python\n",
"## Converting Coordinates\n",
"\n",
"Here are the x/y coordinates for the AT&T Executive Education and Conference Center in the local State Plane coordinate reference system:\n",
"Here are the x/y coordinates for the Empire State Building in the local State Plane coordinate reference system:\n",
"\n",
"(`721188.5688`, `4272112.7388`)\n",
"`(301211.4076849834, 64602.88651922046)`\n",
"\n",
"### 1) Figure out the correct State Plane reference zone, and convert the above coordinates to long/lat (`EPSG: 4326`)"
]
Expand Down Expand Up @@ -45,7 +45,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
"p(-97.740372, 30.282642) # These are the correct long/lat coordinates"
"p(-73.985656, 40.748433) # These are the correct long/lat coordinates"
],
"language": "python",
"metadata": {},
Expand All @@ -55,7 +55,7 @@
"output_type": "pyout",
"prompt_number": 2,
"text": [
"(-10880408.440985134, 3539932.8204972977)"
"(-8236045.5519263055, 4975306.102820314)"
]
}
],
Expand All @@ -65,7 +65,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
"p(-10880408.440985134, 3539932.8204972977, inverse=True) # These are the coordinates in Web Mercator"
"p(-8236045.551926, 4975306.102820, inverse=True) # These are the coordinates in Web Mercator"
],
"language": "python",
"metadata": {},
Expand All @@ -75,7 +75,7 @@
"output_type": "pyout",
"prompt_number": 3,
"text": [
"(-97.740372, 30.282642000000003)"
"(-73.98565599999725, 40.74843299999786)"
]
}
],
Expand All @@ -100,25 +100,16 @@
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stderr",
"text": [
"/Users/cfarmer/anaconda/envs/scipygis/lib/python2.7/site-packages/pandas/io/excel.py:626: UserWarning: Installed openpyxl is not supported at this time. Use >=1.6.1 and <2.0.0.\n",
" .format(openpyxl_compat.start_ver, openpyxl_compat.stop_ver))\n"
]
}
],
"outputs": [],
"prompt_number": 4
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"What about EPSG codes for Texas?\n",
"What about EPSG codes for New York?\n",
"\n",
"Source: http://www.eye4software.com/resources/stateplane/Texas\n",
"Source: http://www.eye4software.com/resources/stateplane/New_York\n",
"\n",
"**Hint**: You can use the DataFrame to figure this out..."
]
Expand All @@ -127,7 +118,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
"df[df.name.str.contains(\"Texas\")]"
"df[df.name.str.contains(\"New York\")]"
],
"language": "python",
"metadata": {},
Expand All @@ -146,64 +137,52 @@
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>86 </th>\n",
" <td> 4201</td>\n",
" <td> NAD83 / Texas North</td>\n",
" <td> 32137</td>\n",
" </tr>\n",
" <tr>\n",
" <th>87 </th>\n",
" <td> 4202</td>\n",
" <td> NAD83 / Texas North Central</td>\n",
" <td> 32138</td>\n",
" </tr>\n",
" <tr>\n",
" <th>88 </th>\n",
" <td> 4203</td>\n",
" <td> NAD83 / Texas Central</td>\n",
" <td> 32139</td>\n",
" <th>66 </th>\n",
" <td> 3101</td>\n",
" <td> NAD83 / New York East</td>\n",
" <td> 32115</td>\n",
" </tr>\n",
" <tr>\n",
" <th>89 </th>\n",
" <td> 4204</td>\n",
" <td> NAD83 / Texas South Central</td>\n",
" <td> 32140</td>\n",
" <th>67 </th>\n",
" <td> 3102</td>\n",
" <td> NAD83 / New York Central</td>\n",
" <td> 32116</td>\n",
" </tr>\n",
" <tr>\n",
" <th>90 </th>\n",
" <td> 4205</td>\n",
" <td> NAD83 / Texas South</td>\n",
" <td> 32141</td>\n",
" <th>68 </th>\n",
" <td> 3103</td>\n",
" <td> NAD83 / New York West</td>\n",
" <td> 32117</td>\n",
" </tr>\n",
" <tr>\n",
" <th>216</th>\n",
" <td> 14201</td>\n",
" <td> NAD27 / Texas North</td>\n",
" <td> 32037</td>\n",
" <th>69 </th>\n",
" <td> 3104</td>\n",
" <td> NAD83 / New York Long Island</td>\n",
" <td> 32118</td>\n",
" </tr>\n",
" <tr>\n",
" <th>217</th>\n",
" <td> 14202</td>\n",
" <td> NAD27 / Texas North Central</td>\n",
" <td> 32038</td>\n",
" <th>195</th>\n",
" <td> 13101</td>\n",
" <td> NAD27 / New York East</td>\n",
" <td> 32015</td>\n",
" </tr>\n",
" <tr>\n",
" <th>218</th>\n",
" <td> 14203</td>\n",
" <td> NAD27 / Texas Central</td>\n",
" <td> 32039</td>\n",
" <th>196</th>\n",
" <td> 13102</td>\n",
" <td> NAD27 / New York Central</td>\n",
" <td> 32016</td>\n",
" </tr>\n",
" <tr>\n",
" <th>219</th>\n",
" <td> 14204</td>\n",
" <td> NAD27 / Texas South Central</td>\n",
" <td> 32040</td>\n",
" <th>197</th>\n",
" <td> 13103</td>\n",
" <td> NAD27 / New York West</td>\n",
" <td> 32017</td>\n",
" </tr>\n",
" <tr>\n",
" <th>220</th>\n",
" <td> 14205</td>\n",
" <td> NAD27 / Texas South</td>\n",
" <td> 32041</td>\n",
" <th>198</th>\n",
" <td> 13104</td>\n",
" <td> NAD27 / New York Long Island</td>\n",
" <td> 32018</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
Expand All @@ -213,17 +192,15 @@
"output_type": "pyout",
"prompt_number": 5,
"text": [
" spcs name epsg\n",
"86 4201 NAD83 / Texas North 32137\n",
"87 4202 NAD83 / Texas North Central 32138\n",
"88 4203 NAD83 / Texas Central 32139\n",
"89 4204 NAD83 / Texas South Central 32140\n",
"90 4205 NAD83 / Texas South 32141\n",
"216 14201 NAD27 / Texas North 32037\n",
"217 14202 NAD27 / Texas North Central 32038\n",
"218 14203 NAD27 / Texas Central 32039\n",
"219 14204 NAD27 / Texas South Central 32040\n",
"220 14205 NAD27 / Texas South 32041"
" spcs name epsg\n",
"66 3101 NAD83 / New York East 32115\n",
"67 3102 NAD83 / New York Central 32116\n",
"68 3103 NAD83 / New York West 32117\n",
"69 3104 NAD83 / New York Long Island 32118\n",
"195 13101 NAD27 / New York East 32015\n",
"196 13102 NAD27 / New York Central 32016\n",
"197 13103 NAD27 / New York West 32017\n",
"198 13104 NAD27 / New York Long Island 32018"
]
}
],
Expand All @@ -233,9 +210,9 @@
"cell_type": "code",
"collapsed": false,
"input": [
"# Austin is the \"South Central Zone\"\n",
"p = Proj(init=\"epsg:32140\")\n",
"p(721188.5687689474, 4272112.738754173, inverse=True)"
"# Manhattan is in \"New York Long Island\"\n",
"p = Proj(init=\"epsg:32118\")\n",
"p(301211.4076849834, 64602.88651922046, inverse=True)"
],
"language": "python",
"metadata": {},
Expand All @@ -245,7 +222,7 @@
"output_type": "pyout",
"prompt_number": 6,
"text": [
"(-97.740372, 30.28264199999949)"
"(-73.985656, 40.74843299999984)"
]
}
],
Expand Down
32 changes: 25 additions & 7 deletions exercises/Working with Projections in Python.ipynb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:b5e4e033d838f474d9b3e5b0e3926dc74163b5d52a76d1b1d63abcdea981f114"
"signature": "sha256:7f089307ae366278e9dcb5b6815fe93c1c8efdd58af1cfa58134d8ce62143b9b"
},
"nbformat": 3,
"nbformat_minor": 0,
Expand All @@ -15,9 +15,9 @@
"# Working with Projections in Python\n",
"## Converting Coordinates\n",
"\n",
"Here are the x/y coordinates for the AT&T Executive Education and Conference Center in the local State Plane coordinate reference system:\n",
"Here are the x/y coordinates for the Empire State Building in the local State Plane coordinate reference system:\n",
"\n",
"(`721188.5688`, `4272112.7388`)\n",
"`(301211.4076849834, 64602.88651922046)`\n",
"\n",
"### 1) Figure out the correct State Plane reference zone, and convert the above coordinates to long/lat (`EPSG: 4326`)"
]
Expand All @@ -44,7 +44,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
"p(-97.740372, 30.282642) # These are the correct long/lat coordinates"
"p(-73.985656, 40.748433) # These are the correct long/lat coordinates"
],
"language": "python",
"metadata": {},
Expand All @@ -54,7 +54,7 @@
"cell_type": "code",
"collapsed": false,
"input": [
"p(-10880408.440985134, 3539932.8204972977, inverse=True) # These are the coordinates in Web Mercator"
"p(-8236045.551926, 4975306.102820, inverse=True) # These are the coordinates in Web Mercator"
],
"language": "python",
"metadata": {},
Expand Down Expand Up @@ -85,12 +85,30 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"What about EPSG codes for Texas?\n",
"What about EPSG codes for New York?\n",
"\n",
"Source: http://www.eye4software.com/resources/stateplane/Texas\n",
"Source: http://www.eye4software.com/resources/stateplane/New_York\n",
"\n",
"**Hint**: You can use the DataFrame to figure this out..."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"df"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
Expand Down
22 changes: 11 additions & 11 deletions exercises/Working with Rasters in Python (Ans).ipynb

Large diffs are not rendered by default.

64 changes: 17 additions & 47 deletions exercises/Working with Vectors in Python (Ans).ipynb

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions exercises/Working with Vectors in Python.ipynb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:77c70735715eee7d374e65648b1ca6cd53a8ff372f5380e2b883fc66242cf9ac"
"signature": "sha256:680f715a61852e6bfe3fa34908b6fc2e66481f8915621ab4e63bcd71474f04e9"
},
"nbformat": 3,
"nbformat_minor": 0,
Expand Down Expand Up @@ -223,7 +223,6 @@
"# Let's clean things up a bit...\n",
"for i, l in enumerate(ax.lines):\n",
" l.set_markersize(16)\n",
" l.set_marker(ur\"$\\u2609$\") # Bullseye\n",
" l.set_markeredgecolor(\"green\")\n",
" l.set_color(\"green\")\n",
"ax.axis('off') # Turn off axes\n",
Expand Down Expand Up @@ -423,7 +422,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"If geojson.io isn't working (it wasn't last week), go to the following url (yours will differ) to find the anonymous gist:"
"If geojson.io isn't working (it might not work nicely with Safari?), go to the following url (yours will differ) to find the anonymous gist:"
]
},
{
Expand Down

0 comments on commit 977e213

Please sign in to comment.