Repository: geopandas/geopandas

Issue:
Include example data in distribution
Seems like it'd be helpful to have a simple spatial dataset included in the distribution that we can use when writing examples and which users can just import and play with (I know `igraph` does this). 

Something universal but not to big -- medium or low resolution map of country outlines? Maybe as a GeoSeries with also as a simple GeoDataFrame with population or something?

Here's public domain [shapefiles](http://www.naturalearthdata.com/) ([terms of use say no permission needed for any purpose](http://www.naturalearthdata.com/about/terms-of-use/))



Discussion:
[Discovered `pysal` has example data!](http://www.pysal.org/users/tutorials/examples.html)

Seems like makes more sense to just offer API to that than build our own. 

I would personally in favor for still including _some_ data in geopandas, as pysal is not that easy to install, eg because it is not yet python 3 compatible

@jorisvandenbossche OK. Do you like their API? In our context, it would look like they would live in `gdp.examples`. 

As of [version 1.11](https://github.com/pysal/pysal/releases/tag/v1.11.0), PySAL is Python 3 compatible and has no dependencies other than numpy and scipy, plus it's pure Python. It's available through Pypi too, so it's as easy to install as it gets.

@darribas Aha good to hear! (I struggled with it last summer). But you should update the installation instruction in the docs then :-) http://pysal.readthedocs.org/en/latest/users/installation.html#install-pysal

@jorisvandenbossche Thanks very much for catching that! I've filed a [bug report](https://github.com/pysal/pysal/issues/787) so it should get fixed soon.


Resolving patch:
diff --git a/geopandas/datasets/__init__.py b/geopandas/datasets/__init__.py
new file mode 100644
--- /dev/null
+++ b/geopandas/datasets/__init__.py
@@ -0,0 +1,27 @@
+import os
+
+
+__all__ = ['available', 'get_path']
+
+module_path = os.path.dirname(__file__)
+available = [p for p in next(os.walk(module_path))[1]
+             if not p.startswith('__')]
+
+
+def get_path(dataset):
+    """
+    Get the path to the data file.
+
+    Parameters
+    ----------
+    dataset : str
+        The name of the dataset. See ``geopandas.datasets.available`` for
+        all options.
+
+    """
+    if dataset in available:
+        return os.path.abspath(
+            os.path.join(module_path, dataset, dataset + '.shp'))
+    else:
+        msg = "The dataset '{data}' is not available".format(data=dataset)
+        raise ValueError(msg)
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -81,6 +81,15 @@ def write_version_py(filename=None):
 
 write_version_py()
 
+
+# get all data dirs in the datasets module
+data_files = []
+
+for item in os.listdir("geopandas/datasets"):
+    if os.path.isdir(os.path.join("geopandas/datasets/", item)) \
+            and not item.startswith('__'):
+        data_files.append(os.path.join("datasets", item, '*'))
+
 setup(name='geopandas',
       version=FULLVERSION,
       description='Geographic pandas extensions',
@@ -89,5 +98,7 @@ def write_version_py(filename=None):
       author_email='kjordahl@enthought.com',
       url='http://geopandas.org',
       long_description=LONG_DESCRIPTION,
-      packages=['geopandas', 'geopandas.io', 'geopandas.tools'],
+      packages=['geopandas', 'geopandas.io', 'geopandas.tools',
+                'geopandas.datasets'],
+      package_data={'geopandas': data_files},
       install_requires=INSTALL_REQUIRES)


Test patch: