Skip to content

Commit 40714df

Browse files
committed
Update implementation
1 parent baf5b0c commit 40714df

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/georef.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Georeference `table` using coordinates `coords` of points.
3737
3838
Optionally, specify the coordinate reference system `crs`, which is
3939
set by default based on heuristics, and the `lenunit` (default to meters for unitless values)
40-
that will be used in CRS types that allow this flexibility. Any `CRS` or `EPSG`/`ESRI`
40+
that can only be used in CRS types that allow this flexibility. Any `CRS` or `EPSG`/`ESRI`
4141
code from [CoordRefSystems.jl](https://github.com/JuliaEarth/CoordRefSystems.jl)
4242
is supported.
4343
@@ -65,7 +65,7 @@ Georeference `table` using coordinates of points stored in column `names`.
6565
6666
Optionally, specify the coordinate reference system `crs`, which is
6767
set by default based on heuristics, and the `lenunit` (default to meters for unitless values)
68-
that will be used in CRS types that allow this flexibility. Any `CRS` or `EPSG`/`ESRI`
68+
that can only be used in CRS types that allow this flexibility. Any `CRS` or `EPSG`/`ESRI`
6969
code from [CoordRefSystems.jl](https://github.com/JuliaEarth/CoordRefSystems.jl)
7070
is supported.
7171
@@ -170,7 +170,7 @@ function pointbuilder(crs, u)
170170
elseif crs <: Spherical
171171
(r, θ, ϕ) -> Point(crs(withunit(r, u), withunit(θ, u"rad"), withunit(ϕ, u"rad")))
172172
else
173-
(coords...) -> Point(crs(coords...))
173+
throw(ArgumentError("the length unit of CRS `$crs` cannot be changed"))
174174
end
175175
end
176176
end

test/georef.jl

+2-4
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,7 @@
153153
gtb = georef(table, ("x", "y"), lenunit=u"m")
154154
@test crs(gtb.geometry) <: Cartesian
155155
@test unit(Meshes.lentype(gtb.geometry)) == u"m"
156-
# `lenunit` option only affects Basic CRS
156+
# error: the length unit of CRS `LatLon` cannot be changed
157157
table = (a=rand(10), lat=rand(10), lon=rand(10))
158-
gtb = georef(table, ("lat", "lon"), crs=LatLon, lenunit=u"km")
159-
@test crs(gtb.geometry) <: LatLon
160-
@test unit(Meshes.lentype(gtb.geometry)) == u"m"
158+
@test_throws ArgumentError georef(table, ("lat", "lon"), crs=LatLon, lenunit=u"km")
161159
end

0 commit comments

Comments
 (0)