Skip to content

Commit b074da0

Browse files
authored
Bugfix webmercator X check (#44)
* extent 1 and 2 can be equal * test equal x
1 parent 27c4484 commit b074da0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/tiles.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function TileGrid(bbox::Extent, zoom::Int, crs::WGS84)
122122
# Mercantile splits the bbox in two along the antimeridian if this happens.
123123
# Decide if that case should be handled here or before, also considering
124124
# antimeridian discussion in https://github.com/rafaqz/Extents.jl/issues/4
125-
@assert bbox.X[1] < bbox.X[2]
125+
@assert bbox.X[1] <= bbox.X[2]
126126

127127
# Clamp bounding values.
128128
max_bbox = Extent(X = (-180.0, 180.0), Y = (-85.051129, 85.051129))

test/runtests.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ end
4545
# creating a TileGrid from a web mercator extent
4646
webbox = MT.project_extent(bbox, MT.wgs84, MT.web_mercator)
4747
@test tilegrid === TileGrid(webbox, 8, MT.web_mercator)
48+
49+
@testset "equal X works" begin
50+
bbox = Extent(X = (-1.23, -1.23), Y = (-5.68, 4.77))
51+
@test_nowarn tilegrid = TileGrid(bbox, 8, MT.web_mercator)
52+
end
4853
end
4954

5055
@testset "project" begin

0 commit comments

Comments
 (0)