Repository: geopandas/geopandas

Issue:
Add a show_versions function
Similarly to `pandas.show_versions()` and `sklearn.show_versions()`, it would be nice to have a function like that for GeoPandas. We can probably base the code on those examples. 

It could list the versions of the direct python dependencies, but also try to show the versions of the underlying GEOS / GDAL libraries.


Discussion:
I am trying to implement this but I need guidance since this is my first contribution. Where would that function fit? I actually made the basic printing functions and it works in my local machine but I am also trying to figure out how to commit and push this. 
@jorisvandenbossche is there anything I can help with here?
@ocefpaf @sgillies 

For shapely, we can find information about the GEOS it is build against with (or at least, the installed GEOS it finds at run time, I suppose):

```
In [1]: import shapely._buildcfg

In [2]: shapely._buildcfg.geos_version 
Out[2]: (3, 7, 1)

In [3]: shapely._buildcfg.geos_library_path                     
Out[3]: '/home/joris/miniconda3/envs/dev37/lib/libgeos_c.so'
```

Is that the appropriate API to use?

For fiona, I can do something like:

```
In [7]: import fiona.env                                    

In [8]: fiona.env.get_gdal_release_name()                                                   
Out[8]: '2.4.0'
```
I usually do `shapely._buildcfg.geos_version` b/c I like the tuple response in case I need to check only MAJOR and or MINOR, for that reason I use `fiona.gdal_version` instead of `fiona.env.get_gdal_release_name()`.
Even though show_versions has been just merged in #918 I will keep this open as a reminder to add GEOS, GDAL an PROJ versions checking in the future.

Resolving patch:
diff --git a/geopandas/tools/_show_versions.py b/geopandas/tools/_show_versions.py
--- a/geopandas/tools/_show_versions.py
+++ b/geopandas/tools/_show_versions.py
@@ -22,6 +22,53 @@ def _get_sys_info():
     return dict(blob)
 
 
+def _get_C_info():
+    """Information on system PROJ, GDAL, GEOS
+    Returns
+    -------
+    c_info: dict
+        system PROJ information
+    """
+    try:
+        import pyproj
+        from pyproj.exceptions import DataDirError
+        proj = pyproj.proj_version_str
+        try:
+            proj_dir = pyproj.datadir.get_data_dir()
+        except DataDirError:
+            proj_dir = None
+    except Exception:
+        proj = None
+        proj_dir = None
+
+    try:
+        import shapely._buildcfg
+        geos = '{}.{}.{}'.format(*shapely._buildcfg.geos_version)
+        geos_dir = shapely._buildcfg.geos_library_path
+    except Exception:
+        geos = None
+        geos_dir = None
+
+    try:
+        import fiona
+        gdal = fiona.env.get_gdal_release_name()
+        gdal_dir = fiona.env.GDALDataFinder().search()
+    except Exception:
+        gdal = None
+        gdal_dir = None
+
+    blob = [
+            ("GEOS", geos),
+            ("GEOS lib", geos_dir),
+            ("GDAL", gdal),
+            ("GDAL dir", gdal_dir),
+            ("PROJ", proj),
+            ("PROJ data dir", proj_dir)
+            ]
+
+    return dict(blob)
+
+
 def _get_deps_info():
     """Overview of the installed version of main dependencies
 
@@ -34,7 +81,6 @@ def _get_deps_info():
         "geopandas",
         "pandas",
         "fiona",
-        "osgeo.gdal",
         "numpy",
         "shapely",
         "rtree",
@@ -43,8 +89,7 @@ def _get_deps_info():
         "mapclassify",
         "pysal",
         "geopy",
-        "psycopg2",
-        "descartes"
+        "psycopg2"
     ]
 
     def get_version(module):
@@ -60,9 +105,7 @@ def get_version(module):
                 mod = importlib.import_module(modname)
             ver = get_version(mod)
             deps_info[modname] = ver
-        except ImportError:
-            deps_info[modname] = None
-        except AttributeError:
+        except Exception:
             deps_info[modname] = None
 
     return deps_info
@@ -78,6 +121,7 @@ def show_versions():
     """
     sys_info = _get_sys_info()
     deps_info = _get_deps_info()
+    proj_info = _get_C_info()
 
     maxlen = max(len(x) for x in deps_info)
     tpl = "{{k:<{maxlen}}}: {{stat}}".format(maxlen=maxlen)
@@ -85,6 +129,10 @@ def show_versions():
     print("-----------")
     for k, stat in sys_info.items():
         print(tpl.format(k=k, stat=stat))
+    print("\nGEOS, GDAL, PROJ INFO")
+    print("---------------------")
+    for k, stat in proj_info.items():
+        print(tpl.format(k=k, stat=stat))
     print("\nPYTHON DEPENDENCIES")
     print("-------------------")
     for k, stat in deps_info.items():


Test patch:
diff --git a/geopandas/tests/test_show_versions.py b/geopandas/tests/test_show_versions.py
--- a/geopandas/tests/test_show_versions.py
+++ b/geopandas/tests/test_show_versions.py
@@ -1,5 +1,6 @@
 from geopandas.tools._show_versions import _get_sys_info
 from geopandas.tools._show_versions import _get_deps_info
+from geopandas.tools._show_versions import _get_C_info
 from geopandas.tools._show_versions import show_versions
 
 
@@ -11,13 +12,23 @@ def test_get_sys_info():
     assert 'machine' in sys_info
 
 
+def test_get_c_info():
+    C_info = _get_C_info()
+
+    assert 'GEOS' in C_info
+    assert 'GEOS lib' in C_info
+    assert 'GDAL' in C_info
+    assert 'GDAL dir' in C_info
+    assert 'PROJ' in C_info
+    assert 'PROJ data dir' in C_info
+
+
 def test_get_deps_info():
     deps_info = _get_deps_info()
 
     assert 'geopandas' in deps_info
     assert 'pandas' in deps_info
     assert 'fiona' in deps_info
-    assert 'osgeo.gdal' in deps_info
     assert 'numpy' in deps_info
     assert 'shapely' in deps_info
     assert 'rtree' in deps_info
@@ -34,4 +45,5 @@ def test_show_versions(capsys):
     out, err = capsys.readouterr()
 
     assert 'python' in out
+    assert 'GEOS' in out
     assert 'geopandas' in out