From 2f411d260bf390ebd97eaf2c565f7ef2f118b489 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 6 Jun 2016 21:53:08 +0200 Subject: [PATCH] TEMP: remove overlay docs to check speedup --- doc/source/set_operations.rst | 57 ----------------------------------- 1 file changed, 57 deletions(-) diff --git a/doc/source/set_operations.rst b/doc/source/set_operations.rst index 69d7f29..aa894a8 100644 --- a/doc/source/set_operations.rst +++ b/doc/source/set_operations.rst @@ -18,63 +18,6 @@ The basic idea is demonstrated by the graphic below but keep in mind that overla (Note to users familiar with the *shapely* library: ``overlay`` can be thought of as offering versions of the standard *shapely* set-operations that deal with the complexities of applying set operations to two *GeoSeries*. The standard *shapely* set-operations are also available as ``GeoSeries`` methods.) -Overlay Example ------------------ - -First, we load some example data: - -.. ipython:: python - - world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres')) - capitals = gpd.read_file(gpd.datasets.get_path('naturalearth_cities')) - - # Select some columns - countries = world[['geometry', 'name']] - - # Project to crs that uses meters as distance measure - countries = countries.to_crs('+init=epsg:3395')[countries.name!="Antarctica"] - capitals = capitals.to_crs('+init=epsg:3395') - -To illustrate the ``overlay`` function, consider the following case in which one wishes to identify the "core" portion of each country -- defined as areas within 500km of a capital -- using a ``GeoDataFrame`` of countries and a ``GeoDataFrame`` of capitals. - -.. ipython:: python - - # Look at countries: - @savefig world_basic.png width=5in - countries.plot(); - - # Now buffer cities to find area within 500km. - # Check CRS -- World Mercator, units of meters. - capitals.crs - - # make 500km buffer - capitals['geometry']= capitals.buffer(500000) - @savefig capital_buffers.png width=5in - capitals.plot(); - - -To select only the portion of countries within 500km of a capital, we specify the ``how`` option to be "intersect", which creates a new set of polygons where these two layers overlap: - -.. ipython:: python - - country_cores = gpd.overlay(countries, capitals, how='intersection') - @savefig country_cores.png width=5in - country_cores.plot(); - -Changing the "how" option allows for different types of overlay operations. For example, if we were interested in the portions of countries *far* from capitals (the peripheries), we would compute the difference of the two. - -.. ipython:: python - - country_peripheries = gpd.overlay(countries, capitals, how='difference') - @savefig country_peripheries.png width=5in - country_peripheries.plot(); - -More Examples ------------------ - -A larger set of examples of the use of ``overlay`` can be found `here `_ - - .. toctree:: :maxdepth: 2