Skip to content

Commit

Permalink
update documentation to reflect crop() inplace=False
Browse files Browse the repository at this point in the history
  • Loading branch information
atedstone committed Jan 18, 2024
1 parent 414e1d5 commit 6fcd2a2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/source/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ For convenience and consistency, nearly all of these methods can be passed solel
# Print initial bounds of the raster
print(rast.bounds)
# Crop raster to vector's extent
rast.crop(vect)
rast = rast.crop(vect)
# Print bounds of cropped raster
print(rast.bounds)
```
Expand Down
4 changes: 2 additions & 2 deletions doc/source/raster_class.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,12 @@ See {ref}`core-match-ref` for more details.
```

The {func}`~geoutils.Raster.crop` function can also be passed a {class}`list` or {class}`tuple` of bounds (`xmin`, `ymin`, `xmax`, `ymax`). By default,
{func}`~geoutils.Raster.crop` is done in-place.
{func}`~geoutils.Raster.crop` returns a new Raster.
For more details, see the {ref}`specific section and function descriptions in the API<api-geo-handle>`.

```{code-cell} ipython3
# Crop raster to smaller bounds
rast_crop = rast.crop(crop_geom=(0.3, 0.3, 1, 1), inplace=False)
rast_crop = rast.crop(crop_geom=(0.3, 0.3, 1, 1))
print(rast_crop.bounds)
```

Expand Down
4 changes: 2 additions & 2 deletions doc/source/vector_class.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ See {ref}`core-match-ref` for more details.

The {func}`~geoutils.Vector.crop` function can also be passed a {class}`list` or {class}`tuple` of bounds (`xmin`, `ymin`, `xmax`, `ymax`).

By default, {func}`~geoutils.Vector.crop` is done in-place and keeps all intersecting geometries. It can also be passed the `clip` argument to clip
By default, {func}`~geoutils.Vector.crop` returns a new {class}`~geoutils.Vector` which keeps all intersecting geometries. It can also be passed the `clip` argument to clip
intersecting geometries to the extent.

```{code-cell} ipython3
# Crop vector to smaller bounds
vect_crop = vect.crop(crop_geom=(-73.5, -46.6, -73.4, -46.5), inplace=False, clip=True)
vect_crop = vect.crop(crop_geom=(-73.5, -46.6, -73.4, -46.5), clip=True)
print(vect_crop.info())
```

Expand Down

0 comments on commit 6fcd2a2

Please sign in to comment.