Skip to content

Commit

Permalink
Update docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
eliascarv committed Oct 16, 2024
1 parent e975838 commit 81b8282
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
7 changes: 5 additions & 2 deletions src/transforms/morphological.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
"""
Morphological(fun; boundary=false)
Morphological transform given by a function `fun`
Morphological transform given by a function `fun`,
that maps the coordinates of a geometry or a domain
to new coordinates (`coords -> newcoords`).
Optionally, the transform samples the `boundary` of polytopes,
if this option is `true`, to handle distortions
that occur in manifold conversions.
# Examples
Expand All @@ -16,7 +19,7 @@ ball = Ball((0, 0), 1)
ball |> Morphological(c -> Cartesian(c.x + c.y, c.y, c.x - c.y))
triangle = Triangle(latlon(0, 0), latlon(0, 45), latlon(45, 0))
triangle |> Morphological(c -> LatLonAlt(c.lon, c.lat, 0.0m), boundary=true)
triangle |> Morphological(c -> LatLonAlt(c.lat, c.lon, 0.0m), boundary=true)
```
"""
struct Morphological{Boundary,F<:Function} <: CoordinateTransform
Expand Down
3 changes: 3 additions & 0 deletions src/transforms/proj.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
Convert the coordinates of geometry or domain to a given
coordinate reference system `CRS` or EPSG/ESRI `code`.
Optionally, the transform samples the `boundary` of polytopes,
if this option is `true`, to handle distortions
that occur in manifold conversions.
## Examples
Expand Down
10 changes: 6 additions & 4 deletions test/sets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,24 @@
q = Quadrangle(latlon(0, 0), latlon(0, 1), latlon(1, 1), latlon(1, 0)) |> Proj(WebMercator)
geoms = [s, t, q]
gset = GeometrySet(geoms)
@test eltype(gset) <: Polytope
@test crs(gset) <: LatLon
gset = GeometrySet(g for g in geoms)
@test eltype(gset) <: Polytope
@test crs(gset) <: LatLon
geoms = [t, s, q]
gset = GeometrySet(geoms)
@test eltype(gset) <: TransformedGeometry
@test eltype(gset) <: Polytope
@test crs(gset) <: PlateCarree
gset = GeometrySet(g for g in geoms)
@test eltype(gset) <: TransformedGeometry
@test eltype(gset) <: Polytope
@test crs(gset) <: PlateCarree
geoms = [q, s, t]
gset = GeometrySet(geoms)
@test eltype(gset) <: TransformedGeometry
@test eltype(gset) <: Polytope
@test crs(gset) <: WebMercator
gset = GeometrySet(g for g in geoms)
@test eltype(gset) <: TransformedGeometry
@test eltype(gset) <: Polytope
@test crs(gset) <: WebMercator

# conversion
Expand Down

0 comments on commit 81b8282

Please sign in to comment.