From 5c2257a080bc04236f12f57829a7783edd585efb Mon Sep 17 00:00:00 2001 From: Nick Eubank Date: Tue, 17 May 2016 14:16:27 -0700 Subject: [PATCH] Docs for geometric manipulations and overlay (#308) --- doc/source/_static/overlay_operations.png | Bin 0 -> 19251 bytes doc/source/data_structures.rst | 2 +- doc/source/geometric_manipulations.rst | 74 ++++++++------------- doc/source/index.rst | 1 + doc/source/reference.rst | 18 ++--- doc/source/set_operations.rst | 76 ++++++++++++++++++++++ 6 files changed, 115 insertions(+), 56 deletions(-) create mode 100644 doc/source/_static/overlay_operations.png create mode 100644 doc/source/set_operations.rst diff --git a/doc/source/_static/overlay_operations.png b/doc/source/_static/overlay_operations.png new file mode 100644 index 0000000000000000000000000000000000000000..38beb8f60e106cfe5bb52d4d5313653325c1a1c7 GIT binary patch literal 19251 zcmeIaWmMH~*Di_((umS2Aky6kg0vtd4N{8+X^<{y5L8M+8l<}$32DRt0qGP}x_i&{ zykoy(oO8z5$)b9YAW)0*c8|(C@6RePh`|lP;QpM z_luaf;D0#>?%##~yWy%XFNIS6g=z!-1Iy`&o+}CpDf|QJ-5XY!-{DtKFx(WBWih5u zsc_Las-(q;;YZ|dvbt{4j`sEz4sIyYE*1zk3v*fz8#ilOc?D%PomcpzC@8cj3Nn(K zp1=OhzBJG}Uhdl^4KksPiuvOHqe#Qb<8`P>VCV42RA|uVTG~TmQOiE1=neLN$+OKx ze3ex=LOiacWv`Nqz|~dK*>|h%m_lqVHNw&ZzgKRdK|BR z%kA);ZE!Ts$;o;0o}IkGaei&4$rU9}B|Y_9uKe|;-%PvThjzbn)SXU@dup}T&)|h9 z%m$6z>7pKQ&h@OUtnBRViCh2k04X)!lC>gL<=;@zadUHT{k?Nvj)0O9=keyRx+2XY zbpw&h+`#s-&#y^cH-8DBa2huEeE;}#+2QZcGD>n@bCfK24Zq!_8jh?C^2zhw=x(2lVvxTlEU@jGw7DloDBqS=93)COW98sg-qgb!R3>ISowC4mMEo zp2P+{@;O@A*ie|Rw`b8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N*L30*4b$dGB>?Og+V_a=kXlBSH7oOI>d{cFP?5@+l8 zCpX>4#>TQrOK|~+M!bF72M{X;kX3GBA*Q{(z31T{;;5*o9q0**b*dj(c)@Tz<-LO5fKr6a%d>g`EvLti#clI zAyA-{4h@tY7kfA;3-G2e%8mi5|LlL#r<}jPIG7=Cd>9FXIg#!~r$7dn=!t-V#jKnh zREWcW?nbn~lE?_XpGr&LB;hnDoEoohY9fbv(hdA0Ji;4?*VB-yvzwaqj+eqS%A=9D z<8+TYpnY9={;G8g9v%}P{}u|g)o3CjBG$IHs3;e}GSB|`v+e51n8%s)H2tZYN{9dD zLjYeGvd^5>hRKy@+r~Sei~jvcY5&6b5R?D*eY2Pf|0hqLaF^ajn9#%ic9e9{I599W zAxEM$JNRhG$p-*QR#jK4U#1u4FdNib-$_?tA_XR2_8Dd%IXQW0Y3Z2nwI67JRJ`Vx zKfZrIS?IhOmj{UzDyFdeKV7hWxxzRMNE2*^oTLhSFe6~@;=+65t8JYN=nuXZCsk{% zDllIUF{`AYfKXJ#US3{KiI4AITeFn5@GLAYHud&?2+1)VpL!6Yw}jHlv!olW62jnC zQ+_T?g@2e96@|_C-~kT{OC(I2ufcU5H+y6wFG&_5=6w(W<7MUs22{a8LDp5e$?x8M z0?cPC=(`d5pUTDy{vSx8djJs);I9q>#wv%)B{o^>SeuD*oXLo=wlP#;cq`|j~cNMwSE zdI4%7?AHJYrn`Xc|CFDjB&Vbdq^45L)*Ay;eEB0Z7(Wq81rP?L@5ww^=JDHXd{IB2}+SW%%cg1)3BUGON>+!${lwKir5G^JuN>dFh{5z)O zotmj=7Dq)+_^)CcOU-o;&-fQ3A`p~hXigtGM&JD*=raK8IsaMe)QF9 Z0Pnoe1vMT9^3P+TD9EbFluMZe{SUXqDQ5rx literal 0 HcmV?d00001 diff --git a/doc/source/data_structures.rst b/doc/source/data_structures.rst index 96fb953..0f72ba1 100644 --- a/doc/source/data_structures.rst +++ b/doc/source/data_structures.rst @@ -70,7 +70,7 @@ Basic Methods Relationship Tests ^^^^^^^^^^^^^^^^^^^ -* ``almost_equals(other)``: is shape almost the same as ``other`` (good when floating point precision issues make shapes slightly different) +* ``geom_almost_equals(other)``: is shape almost the same as ``other`` (good when floating point precision issues make shapes slightly different) * ``contains(other)``: is shape contained within ``other`` * ``intersects(other)``: does shape intersect ``other`` diff --git a/doc/source/geometric_manipulations.rst b/doc/source/geometric_manipulations.rst index 2996ee2..29f6613 100644 --- a/doc/source/geometric_manipulations.rst +++ b/doc/source/geometric_manipulations.rst @@ -1,92 +1,74 @@ Geometric Manipulations ======================== +*geopandas* makes available all the tools for geometric manipulations in the `*shapely* library `_. - - -Set-theoretic Methods -~~~~~~~~~~~~~~~~~~~~~ - -.. attribute:: GeoSeries.boundary - - Returns a ``GeoSeries`` of lower dimensional objects representing - each geometries's set-theoretic `boundary`. - -.. method:: GeoSeries.difference(other) - - Returns a ``GeoSeries`` of the points in each geometry that - are not in the *other* object. - -.. method:: GeoSeries.intersection(other) - - Returns a ``GeoSeries`` of the intersection of each object with the `other` - geometric object. - -.. method:: GeoSeries.symmetric_difference(other) - - Returns a ``GeoSeries`` of the points in each object not in the `other` - geometric object, and the points in the `other` not in this object. - -.. method:: GeoSeries.union(other) - - Returns a ``GeoSeries`` of the union of points from each object and the - `other` geometric object. - - -.. attribute:: GeoSeries.unary_union - - Return a geometry containing the union of all geometries in the ``GeoSeries``. - +Note that documentation for all set-theoretic tools for creating new shapes using the relationship between two different spatial datasets -- like creating intersections, or differences -- can be found on the :doc:`set operations ` page. Constructive Methods -~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~ -.. method:: GeoSeries.buffer(distance, resolution=16) +.. method:: GeoSeries.buffer(distance, resolution=16) Returns a ``GeoSeries`` of geometries representing all points within a given `distance` of each geometric object. -.. attribute:: GeoSeries.convex_hull +.. attribute:: GeoSeries.boundary + + Returns a ``GeoSeries`` of lower dimensional objects representing + each geometries's set-theoretic `boundary`. + +.. attribute:: GeoSeries.centroid + + Returns a ``GeoSeries`` of points for each geometric centroid. + +.. attribute:: GeoSeries.convex_hull Returns a ``GeoSeries`` of geometries representing the smallest convex `Polygon` containing all the points in each object unless the number of points in the object is less than three. For two points, the convex hull collapses to a `LineString`; for 1, a `Point`. -.. attribute:: GeoSeries.envelope +.. attribute:: GeoSeries.envelope Returns a ``GeoSeries`` of geometries representing the point or smallest rectangular polygon (with sides parallel to the coordinate axes) that contains each object. -.. method:: GeoSeries.simplify(tolerance, preserve_topology=True) +.. method:: GeoSeries.simplify(tolerance, preserve_topology=True) Returns a ``GeoSeries`` containing a simplified representation of each object. Affine transformations -~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~ -.. method:: GeoSeries.rotate(self, angle, origin='center', use_radians=False) +.. method:: GeoSeries.rotate(self, angle, origin='center', use_radians=False) Rotate the coordinates of the GeoSeries. -.. method:: GeoSeries.scale(self, xfact=1.0, yfact=1.0, zfact=1.0, origin='center') +.. method:: GeoSeries.scale(self, xfact=1.0, yfact=1.0, zfact=1.0, origin='center') Scale the geometries of the GeoSeries along each (x, y, z) dimensio. -.. method:: GeoSeries.skew(self, angle, origin='center', use_radians=False) +.. method:: GeoSeries.skew(self, angle, origin='center', use_radians=False) Shear/Skew the geometries of the GeoSeries by angles along x and y dimensions. -.. method:: GeoSeries.translate(self, angle, origin='center', use_radians=False) +.. method:: GeoSeries.translate(self, angle, origin='center', use_radians=False) Shift the coordinates of the GeoSeries. -`Aggregating methods` +Aggregation Methods +~~~~~~~~~~~~~~~~~~~~ +.. attribute:: GeoSeries.unary_union + + Return a geometry containing the union of all geometries in the ``GeoSeries``. +Examples of Geometric Manipulations +------------------------------------ .. sourcecode:: python diff --git a/doc/source/index.rst b/doc/source/index.rst index 17d8c81..b380c35 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -32,6 +32,7 @@ such as PostGIS. Making Maps Managing Projections Geometric Manipulations + Set Operations with overlay Merging Data Geocoding Reference to All Attributes and Methods diff --git a/doc/source/reference.rst b/doc/source/reference.rst index a05e840..2b95ab7 100644 --- a/doc/source/reference.rst +++ b/doc/source/reference.rst @@ -124,15 +124,6 @@ The following Shapely methods and attributes are available on `Set-theoretic Methods` -.. attribute:: GeoSeries.boundary - - Returns a ``GeoSeries`` of lower dimensional objects representing - each geometries's set-theoretic `boundary`. - -.. attribute:: GeoSeries.centroid - - Returns a ``GeoSeries`` of points for each geometric centroid. - .. method:: GeoSeries.difference(other) Returns a ``GeoSeries`` of the points in each geometry that @@ -160,6 +151,15 @@ The following Shapely methods and attributes are available on Returns a ``GeoSeries`` of geometries representing all points within a given `distance` of each geometric object. +.. attribute:: GeoSeries.boundary + + Returns a ``GeoSeries`` of lower dimensional objects representing + each geometries's set-theoretic `boundary`. + +.. attribute:: GeoSeries.centroid + + Returns a ``GeoSeries`` of points for each geometric centroid. + .. attribute:: GeoSeries.convex_hull Returns a ``GeoSeries`` of geometries representing the smallest diff --git a/doc/source/set_operations.rst b/doc/source/set_operations.rst new file mode 100644 index 0000000..bd964ba --- /dev/null +++ b/doc/source/set_operations.rst @@ -0,0 +1,76 @@ +.. ipython:: python + :suppress: + + import geopandas as gpd + world = gpd.GeoDataFrame().from_file('_example_data/naturalearth_lowres.shp') + capitals = gpd.GeoDataFrame().from_file('_example_data/naturalearth_cities.shp') + + # For spatial join + countries = world[['geometry', 'name']] + + # Project + countries = countries.to_crs('+init=epsg:3395')[countries.name!="Antarctica"] + capitals = capitals.to_crs('+init=epsg:3395') + + +Set-Operations with Overlay +============================ + +When working with multiple spatial datasets -- especially multiple *polygon* or *line* datasets -- users often wish to create new shapes based on places where those datasets overlap (or don't overlap). These manipulations are often referred using the language of sets -- intersections, unions, and differences. These types of operations are made available in the *geopandas* library through the ``overlay`` function. + +The basic idea is demonstrated by the graphic below but keep in mind that overlays operate at the DataFrame level, not on individual geometries, and the properties from both are retained. In effect, for every shape in the first GeoDataFrame, this operation is executed against every other shape in the other GeoDataFrame: + +.. image:: _static/overlay_operations.png + +**Source: QGIS Documentation** + +(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 +----------------- + +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 + + from geopandas.tools import overlay + country_cores = 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 = 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