Skip to content

Commit

Permalink
docs(gis module): docstring tweaks; add to api documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aleaf committed Nov 4, 2024
1 parent 572ef63 commit 19ab7c0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions docs/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Modules
.. toctree::

Flows Module <sfrmaker.flows>
GIS Module <sfrmaker.gis>
Grid Module <sfrmaker.grid>
Lines Module <sfrmaker.lines>
MODFLOW-2005 to 6 Module <sfrmaker.mf5to6>
Expand Down
6 changes: 2 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
import sphinx_rtd_theme

html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down Expand Up @@ -206,5 +203,6 @@
'flopy': ('https://flopy.readthedocs.io/en/latest/', None),
'rasterstats': ('https://pythonhosted.org/rasterstats/', None),
'shapely': ('https://shapely.readthedocs.io/en/latest/', None),
'pyproj': ('http://pyproj4.github.io/pyproj/stable/', None)
'pyproj': ('http://pyproj4.github.io/pyproj/stable/', None),
'rtree': ('https://rtree.readthedocs.io/en/latest/', None)
}
18 changes: 11 additions & 7 deletions sfrmaker/gis.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def get_crs(prjfile=None, crs=None, **kwargs):


def build_rtree_index(geom):
"""Builds an rtree index. Useful for multiple intersections with same index.
"""Builds an :class:`rtree.index.Index` (spatial index) object.
Useful for multiple intersections with same index.
Parameters
==========
Expand Down Expand Up @@ -99,16 +100,19 @@ def intersect_rtree(geom1, geom2, index=None):
"""Intersect features in geom1 with those in geom2. For each feature in geom2, return a list of
the indices of the intersecting features in geom1.
Parameters:
Parameters
----------
geom1 : list
list of shapely geometry objects
geom2 : list
list of shapely geometry objects to be intersected with features in geom1
index :
use an index that has already been created for geom1
index : rtree spatial index
Option to use an r-tree spatial index that has already been created for geom1.
The :func:`sfrmaker.gis.build_rtree_index` function can be used to
create a spatial index for a list of shapely geometriy objects.
by default, None.
Returns:
Returns
-------
A list of the same length as geom2; containing for each feature in geom2,
a list of indicies of intersecting geometries in geom1.
Expand Down Expand Up @@ -140,14 +144,14 @@ def intersect(geom1, geom2):
"""Same as intersect_rtree, except without spatial indexing. Fine for smaller datasets,
but scales by 10^4 with the side of the problem domain.
Parameters:
Parameters
----------
geom1 : list
list of shapely geometry objects
geom2 : list
list of shapely geometry objects to be intersected with features in geom1
Returns:
Returns
-------
A list of the same length as geom2; containing for each feature in geom2,
a list of indicies of intersecting geometries in geom1.
Expand Down

0 comments on commit 19ab7c0

Please sign in to comment.