diff --git a/area_weights.ipynb b/area_weights.ipynb index 93f0f9c..d90945a 100644 --- a/area_weights.ipynb +++ b/area_weights.ipynb @@ -130,10 +130,10 @@ "cell_type": "code", "collapsed": false, "input": [ - "shp_file = shpreader.natural_earth(resolution='110m',\n", + "filename = shpreader.natural_earth(resolution='110m',\n", " category='cultural',\n", " name='admin_0_countries')\n", - "borders = shpreader.Reader(shp_file)\n", + "borders = shpreader.Reader(filename)\n", "uk_geom, = [g for g in borders.records() if g.attributes['name_long']=='United Kingdom']" ], "language": "python", @@ -147,11 +147,11 @@ "source": [ "Here the shapefile is specified and read using the `cartopy.io.shapereader` module. The UK's geometry is determined by iterating over all the records in the shapefile, choosing the record where the attribute `name_long` matches 'United Kingdom'.\n", "\n", - "This Natural Earth shapefile was chosen here for simplicity's sake, but any loaded shapefile should be able to be accessed using the methods demonstrated here. It is worth noting that all `shpreader.natural_earth()` above returns is a known filepath to the Cartopy default save location for the specific Natural Earth data requested.\n", + "This Natural Earth shapefile was chosen here for simplicity's sake, but any other shapefile can be accessed using the methods demonstrated here. It is worth noting that whilst `shpreader.natural_earth()` will download Natural Earth shapefiles as required, all it returns is a filepath to a shapefile.\n", "\n", "A very similar process should be able to be followed with any standard shapefile, as all shapefiles should be loaded with both `geometries()` and `records()` methods. The former returns a generator object of each geometry within the shapefile while the latter returns a generator object of each record within the shapefile.\n", "\n", - "A record is made up of a geometry (one of the geometries from the geometries method) and an attributes dictionary. The keys within the attributes dictionary will change dependant on the shapefile loaded, but are simple to locate:" + "A record is made up of a geometry (one of the geometries from the geometries method) and an attributes dictionary. The keys within the attributes dictionary are dependant on the shapefile loaded, but are simple to locate:" ] }, { @@ -177,9 +177,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "These operations can be performed on any shapefile records instance.\n", + "These operations can be performed on any shapefile record.\n", "\n", - "Note, however, that the keys within an attributes dictionary are subject to change, and that code that expects a certain key to appear within the attributes may fail if the key is changed unexpectedly." + "Note, however, that the keys within an attributes dictionary are dependent on the shapefile, and that code that expects a certain key to appear within the attributes may fail if a different shapefile is processed." ] }, { @@ -232,4 +232,4 @@ "metadata": {} } ] -} \ No newline at end of file +}