Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct the usage of get in its docstring #67

Merged
merged 1 commit into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/GADM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const API_VERSIONS = ("4.1", "4.0", "3.6", "2.8")

Downloads data for `country` using DataDeps.jl and returns path.
The data is provided by the API of the [GADM](https://gadm.org) project.

It is possible to choose the API version by passing it to the
`version` keyword argument as string.
The available API versions are: 4.1 (default), 4.0, 3.6 and 2.8.
Expand Down Expand Up @@ -134,11 +135,13 @@ function filterlayer(layer, qkeys, qvalues)
end

"""
get(country, subregions...; depth=0, version="4.1")
GADM.get(country, subregions...; depth=0, version="4.1")

Returns a Tables.jl columntable for the requested region.

Geometry of the region(s) can be accessed with the key `geom`.

Returns a Tables.jl columntable for the requested region
Geometry of the region(s) can be accessed with the key `geom`
The geometries are GeoInterface compliant Polygons/MultiPolygons.
The geometries are `GeoInterface`-compliant Polygons/MultiPolygons.

1. country: ISO 3166 Alpha 3 country code
2. subregions: Full official names in hierarchial order (provinces, districts, etc.)
Expand All @@ -147,12 +150,13 @@ The geometries are GeoInterface compliant Polygons/MultiPolygons.
## Examples

```julia
using GADM
# columntable of size 1, data of India's borders
data = get("IND")
data = GADM.get("IND")
# columntable of all states and union territories inside India
data = get("IND"; depth=1)
data = GADM.get("IND"; depth=1)
# columntable of all districts inside Uttar Pradesh
data = get("IND", "Uttar Pradesh"; depth=1)
data = GADM.get("IND", "Uttar Pradesh"; depth=1)
```
"""
function get(country, subregions...; depth=0, kwargs...)
Expand Down
Loading